@Test(expected = IllegalArgumentException.class) public void testNullValuesAreNotToleratedForModelRegistration() { this.testee.register(null); }
public synchronized void register(OsgiModelSource<?> modelSource) { if (modelSource == null) { throw new IllegalArgumentException("method parameter modelSource must not be null"); } Class<?> modelType = modelSource.getModelType(); ResourceModelMetaData modelMetaData = new ResourceModelMetaData(modelType); ResourceModelMetadataHolder holder = new ResourceModelMetadataHolder(modelSource, modelMetaData); Map<Class<?>, ResourceModelMetadataHolder> newCache = copyCache(); newCache.put(getUserClass(modelType), holder); this.cache = newCache; }
ResourceModelMetaDataRegistrar { public synchronized void register(OsgiModelSource<?> modelSource) { if (modelSource == null) { throw new IllegalArgumentException("method parameter modelSource must not be null"); } Class<?> modelType = modelSource.getModelType(); ResourceModelMetaData modelMetaData = new ResourceModelMetaData(modelType); ResourceModelMetadataHolder holder = new ResourceModelMetadataHolder(modelSource, modelMetaData); Map<Class<?>, ResourceModelMetadataHolder> newCache = copyCache(); newCache.put(getUserClass(modelType), holder); this.cache = newCache; } }
ResourceModelMetaDataRegistrar { public synchronized void register(OsgiModelSource<?> modelSource) { if (modelSource == null) { throw new IllegalArgumentException("method parameter modelSource must not be null"); } Class<?> modelType = modelSource.getModelType(); ResourceModelMetaData modelMetaData = new ResourceModelMetaData(modelType); ResourceModelMetadataHolder holder = new ResourceModelMetadataHolder(modelSource, modelMetaData); Map<Class<?>, ResourceModelMetadataHolder> newCache = copyCache(); newCache.put(getUserClass(modelType), holder); this.cache = newCache; }  }
ResourceModelMetaDataRegistrar { public synchronized void register(OsgiModelSource<?> modelSource) { if (modelSource == null) { throw new IllegalArgumentException("method parameter modelSource must not be null"); } Class<?> modelType = modelSource.getModelType(); ResourceModelMetaData modelMetaData = new ResourceModelMetaData(modelType); ResourceModelMetadataHolder holder = new ResourceModelMetadataHolder(modelSource, modelMetaData); Map<Class<?>, ResourceModelMetadataHolder> newCache = copyCache(); newCache.put(getUserClass(modelType), holder); this.cache = newCache; }  Collection<ResourceModelMetaData> get(); ResourceModelMetaData get(Class<?> modelType); synchronized void register(OsgiModelSource<?> modelSource); synchronized void removeMetadataForModelsIn(Bundle bundle); }
ResourceModelMetaDataRegistrar { public synchronized void register(OsgiModelSource<?> modelSource) { if (modelSource == null) { throw new IllegalArgumentException("method parameter modelSource must not be null"); } Class<?> modelType = modelSource.getModelType(); ResourceModelMetaData modelMetaData = new ResourceModelMetaData(modelType); ResourceModelMetadataHolder holder = new ResourceModelMetadataHolder(modelSource, modelMetaData); Map<Class<?>, ResourceModelMetadataHolder> newCache = copyCache(); newCache.put(getUserClass(modelType), holder); this.cache = newCache; }  Collection<ResourceModelMetaData> get(); ResourceModelMetaData get(Class<?> modelType); synchronized void register(OsgiModelSource<?> modelSource); synchronized void removeMetadataForModelsIn(Bundle bundle);  }