BUG-981: remove deprecated elements 73/6873/10
authorRobert Varga <rovarga@cisco.com>
Sun, 11 May 2014 05:27:55 +0000 (07:27 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 27 May 2014 11:26:22 +0000 (13:26 +0200)
This patch removes deprecated constructor and setters, such that the
RuntimeGeneratedMappingServiceImpl can be instantiated in one go.

Change-Id: I7941479291210be9b1ee37919feae055c63c228c
Signed-off-by: Robert Varga <rovarga@cisco.com>
code-generator/binding-generator-impl/src/main/java/org/opendaylight/yangtools/sal/binding/generator/impl/RuntimeGeneratedMappingServiceImpl.java
integration-test/yang-runtime-tests/src/test/java/org/opendaylight/yangtools/it/yang/runtime/tests/Bug466EmptyAugmentationCodecs.java
restconf/restconf-client-impl/src/test/java/org/opendaylight/yangtools/restconf/client/RestconfClientImplTest.java
restconf/restconf-util/src/test/java/org/opendaylight/yangtools/restconf/utils/Bug527Test.java

index 767259bc26631c93474c24e513fc91c0083cdc22..08308163ed392a15fac36ce80f0601495133fab0 100644 (file)
@@ -89,10 +89,9 @@ public class RuntimeGeneratedMappingServiceImpl implements BindingIndependentMap
 
     private final ClassLoadingStrategy classLoadingStrategy;
 
-    // FIXME: will become final
-    private ClassPool pool;
-    private AbstractTransformerGenerator binding;
-    private LazyGeneratedCodecRegistry registry;
+    private final AbstractTransformerGenerator binding;
+    private final LazyGeneratedCodecRegistry registry;
+    private final ClassPool pool;
 
     /*
      * FIXME: updated here, access from AbstractTransformer
@@ -106,16 +105,6 @@ public class RuntimeGeneratedMappingServiceImpl implements BindingIndependentMap
     private final ConcurrentMap<Type, Type> typeDefinitions = new ConcurrentHashMap<>();
     private SchemaContext schemaContext;
 
-    @Deprecated
-    public RuntimeGeneratedMappingServiceImpl() {
-        this(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy());
-    }
-
-    @Deprecated
-    public RuntimeGeneratedMappingServiceImpl(final ClassLoadingStrategy strat) {
-        classLoadingStrategy = strat;
-    }
-
     public RuntimeGeneratedMappingServiceImpl(final ClassPool pool) {
         this(pool, GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy());
     }
@@ -124,11 +113,6 @@ public class RuntimeGeneratedMappingServiceImpl implements BindingIndependentMap
         this.pool = Preconditions.checkNotNull(pool);
         this.classLoadingStrategy = Preconditions.checkNotNull(strat);
 
-        // FIXME: merge into constructor once legacy init() is removed
-        doInit();
-    }
-
-    private void doInit() {
         binding = new TransformerGenerator(this, pool);
         registry = new LazyGeneratedCodecRegistry(this, binding, classLoadingStrategy);
         binding.setListener(registry);
@@ -139,11 +123,6 @@ public class RuntimeGeneratedMappingServiceImpl implements BindingIndependentMap
         // }
     }
 
-    @Deprecated
-    public void setPool(final ClassPool pool) {
-        this.pool = pool;
-    }
-
     @Override
     public synchronized SchemaContext getSchemaContext() {
         return schemaContext;
@@ -352,10 +331,6 @@ public class RuntimeGeneratedMappingServiceImpl implements BindingIndependentMap
         }
     }
 
-    @Deprecated
-    public void init() {
-        doInit();
-    }
 
     @Override
     public Set<QName> getRpcQNamesFor(final Class<? extends RpcService> service) {
index d364a70f1c552f7be7fd596d78762528fa40faa1..31890256c009262e472217ba2b7ba8b8001974d8 100644 (file)
@@ -40,9 +40,7 @@ public class Bug466EmptyAugmentationCodecs {
         assertNotNull(schemaContext);
         assertTrue(schemaContext.isPresent());
 
-        mappingService = new RuntimeGeneratedMappingServiceImpl(moduleInfoContext);
-        mappingService.setPool(ClassPool.getDefault());
-        mappingService.init();
+        mappingService = new RuntimeGeneratedMappingServiceImpl(ClassPool.getDefault(), moduleInfoContext);
         mappingService.onGlobalContextUpdated(schemaContext.get());
 
     }
index ce3c61eaf0acd8d8d46494a729492e6edbc40788..174c26ccb9ba1d58da4fb49dd0e7930bcd8dd4c0 100644 (file)
@@ -43,9 +43,7 @@ public class RestconfClientImplTest {
 
     @Before
     public void setupRestconfClientContext() throws MalformedURLException, UnsupportedProtocolException {
-        mappingService = new RuntimeGeneratedMappingServiceImpl();
-        mappingService.setPool(new ClassPool());
-        mappingService.init();
+        mappingService = new RuntimeGeneratedMappingServiceImpl(new ClassPool());
 
         final ModuleInfoBackedContext moduleInfo = ModuleInfoBackedContext.create();
         moduleInfo.addModuleInfos(BindingReflections.loadModuleInfos());
index e4c794dcb7c478255476c63bafbb36870947f9e5..1bbbe8d6fd65333f9877959a39676c661ec06c1d 100644 (file)
@@ -46,9 +46,7 @@ public class Bug527Test {
 
     @Before
     public void setup() {
-        this.mappingService = new RuntimeGeneratedMappingServiceImpl();
-        this.mappingService.setPool(new ClassPool());
-        this.mappingService.init();
+        this.mappingService = new RuntimeGeneratedMappingServiceImpl(new ClassPool());
 
         final ModuleInfoBackedContext moduleInfo = ModuleInfoBackedContext.create();
         moduleInfo.addModuleInfos(BindingReflections.loadModuleInfos());