@Test(expected = IllegalArgumentException.class) public void testLookupDaoNull() { DaoManager.lookupDao(null, Foo.class); }
public synchronized static <D extends Dao<T, ?>, T> D lookupDao(ConnectionSource connectionSource, Class<T> clazz) { if (connectionSource == null) { throw new IllegalArgumentException("connectionSource argument cannot be null"); } ClassConnectionSource key = new ClassConnectionSource(connectionSource, clazz); Dao<?, ?> dao = lookupDao(key); @SuppressWarnings("unchecked") D castDao = (D) dao; return castDao; }
DaoManager { public synchronized static <D extends Dao<T, ?>, T> D lookupDao(ConnectionSource connectionSource, Class<T> clazz) { if (connectionSource == null) { throw new IllegalArgumentException("connectionSource argument cannot be null"); } ClassConnectionSource key = new ClassConnectionSource(connectionSource, clazz); Dao<?, ?> dao = lookupDao(key); @SuppressWarnings("unchecked") D castDao = (D) dao; return castDao; } }
DaoManager { public synchronized static <D extends Dao<T, ?>, T> D lookupDao(ConnectionSource connectionSource, Class<T> clazz) { if (connectionSource == null) { throw new IllegalArgumentException("connectionSource argument cannot be null"); } ClassConnectionSource key = new ClassConnectionSource(connectionSource, clazz); Dao<?, ?> dao = lookupDao(key); @SuppressWarnings("unchecked") D castDao = (D) dao; return castDao; }  }
DaoManager { public synchronized static <D extends Dao<T, ?>, T> D lookupDao(ConnectionSource connectionSource, Class<T> clazz) { if (connectionSource == null) { throw new IllegalArgumentException("connectionSource argument cannot be null"); } ClassConnectionSource key = new ClassConnectionSource(connectionSource, clazz); Dao<?, ?> dao = lookupDao(key); @SuppressWarnings("unchecked") D castDao = (D) dao; return castDao; }  synchronized static D createDao(ConnectionSource connectionSource, Class<T> clazz); synchronized static D lookupDao(ConnectionSource connectionSource, Class<T> clazz); synchronized static D createDao(ConnectionSource connectionSource,
			DatabaseTableConfig<T> tableConfig); synchronized static D lookupDao(ConnectionSource connectionSource,
			DatabaseTableConfig<T> tableConfig); static synchronized void registerDao(ConnectionSource connectionSource, Dao<?, ?> dao); static synchronized void unregisterDao(ConnectionSource connectionSource, Dao<?, ?> dao); static synchronized void registerDaoWithTableConfig(ConnectionSource connectionSource, Dao<?, ?> dao); static synchronized void clearCache(); static synchronized void clearDaoCache(); static synchronized void addCachedDatabaseConfigs(Collection<DatabaseTableConfig<?>> configs); }
DaoManager { public synchronized static <D extends Dao<T, ?>, T> D lookupDao(ConnectionSource connectionSource, Class<T> clazz) { if (connectionSource == null) { throw new IllegalArgumentException("connectionSource argument cannot be null"); } ClassConnectionSource key = new ClassConnectionSource(connectionSource, clazz); Dao<?, ?> dao = lookupDao(key); @SuppressWarnings("unchecked") D castDao = (D) dao; return castDao; }  synchronized static D createDao(ConnectionSource connectionSource, Class<T> clazz); synchronized static D lookupDao(ConnectionSource connectionSource, Class<T> clazz); synchronized static D createDao(ConnectionSource connectionSource,
			DatabaseTableConfig<T> tableConfig); synchronized static D lookupDao(ConnectionSource connectionSource,
			DatabaseTableConfig<T> tableConfig); static synchronized void registerDao(ConnectionSource connectionSource, Dao<?, ?> dao); static synchronized void unregisterDao(ConnectionSource connectionSource, Dao<?, ?> dao); static synchronized void registerDaoWithTableConfig(ConnectionSource connectionSource, Dao<?, ?> dao); static synchronized void clearCache(); static synchronized void clearDaoCache(); static synchronized void addCachedDatabaseConfigs(Collection<DatabaseTableConfig<?>> configs);  }