BUG-868: remove the use of Javassist.init() 22/7322/2
authorRobert Varga <rovarga@cisco.com>
Wed, 21 May 2014 21:55:18 +0000 (23:55 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 22 May 2014 06:58:47 +0000 (08:58 +0200)
The init method, as well as setPool() have been deprecated. Prefer the
in-one-go costructor.

Change-Id: I73298d3b36502c0bad0c09f2f7f2d87bb67bbb37
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/osgi/mapping/CodecRegistryProvider.java

index 9d0fbd8..ec46219 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.controller.config.manager.impl.osgi.mapping;
 
 import javassist.ClassPool;
+
 import org.opendaylight.controller.config.manager.impl.util.OsgiRegistrationUtil;
 import org.opendaylight.yangtools.sal.binding.generator.api.ClassLoadingStrategy;
 import org.opendaylight.yangtools.sal.binding.generator.impl.RuntimeGeneratedMappingServiceImpl;
@@ -27,10 +28,8 @@ public class CodecRegistryProvider implements AutoCloseable {
     private final RuntimeGeneratedMappingServiceImpl service;
     private final AutoCloseable registration;
 
-    public CodecRegistryProvider(ClassLoadingStrategy classLoadingStrategy, BundleContext context) {
-        service = new RuntimeGeneratedMappingServiceImpl(classLoadingStrategy);
-        service.setPool(CLASS_POOL);
-        service.init();
+    public CodecRegistryProvider(final ClassLoadingStrategy classLoadingStrategy, final BundleContext context) {
+        service = new RuntimeGeneratedMappingServiceImpl(CLASS_POOL, classLoadingStrategy);
         registration = OsgiRegistrationUtil.registerService(context, service,
                 SchemaServiceListener.class, BindingIndependentMappingService.class);
     }