Remove unused arguments from UnionTypeCodec.loader() 39/10339/1
authorRobert Varga <rovarga@cisco.com>
Tue, 26 Aug 2014 18:42:17 +0000 (20:42 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 26 Aug 2014 18:42:17 +0000 (20:42 +0200)
The two codecs passed in were unused, so remove them, fix the callsite
and remove the useless warnings suppression.

Change-Id: Ib3d052109303c1c18f9a4d58d2eafeefea37caba
Signed-off-by: Robert Varga <rovarga@cisco.com>
code-generator/binding-data-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/BindingCodecContext.java
code-generator/binding-data-codec/src/main/java/org/opendaylight/yangtools/binding/data/codec/impl/UnionTypeCodec.java

index 46fd45960f3572affcd4993d08d8b87e6489f9e0..155bbae7612cea07ca5349cd1f76890dd8cd98b0 100644 (file)
@@ -264,12 +264,11 @@ class BindingCodecContext implements CodecContextFactory, Immutable {
         } else if (rootType instanceof InstanceIdentifierTypeDefinition) {
             return ValueTypeCodec.encapsulatedValueCodecFor(valueType, instanceIdentifierCodec);
         } else if (rootType instanceof UnionTypeDefinition) {
-            Callable<UnionTypeCodec> loader = UnionTypeCodec.loader(valueType, (UnionTypeDefinition) rootType,
-                    getInstanceIdentifierCodec(), getIdentityCodec());
+            Callable<UnionTypeCodec> loader = UnionTypeCodec.loader(valueType, (UnionTypeDefinition) rootType);
             try {
                 return loader.call();
             } catch (Exception e) {
-                throw new IllegalStateException("Unable to load codec for "+valueType,e);
+                throw new IllegalStateException("Unable to load codec for " + valueType, e);
             }
         }
         return ValueTypeCodec.getCodecFor(valueType, instantiatedType);
index 6cad44c738ca47c156c8ec365f22f1ba16dbd658..f94673c28897baa1eb67d79b12ae18efdb14a017 100644 (file)
@@ -16,7 +16,6 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.concurrent.Callable;
 
-import org.opendaylight.yangtools.concepts.Codec;
 import org.opendaylight.yangtools.yang.binding.BindingMapping;
 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
 import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
@@ -36,10 +35,8 @@ final class UnionTypeCodec extends ReflectionBasedCodec {
         }
     }
 
-    @SuppressWarnings("rawtypes")
-    static final Callable<UnionTypeCodec> loader(final Class<?> unionCls,final UnionTypeDefinition unionType, final Codec instanceIdentifier, final Codec identity) {
+    static final Callable<UnionTypeCodec> loader(final Class<?> unionCls, final UnionTypeDefinition unionType) {
         return new Callable<UnionTypeCodec>() {
-
             @Override
             public UnionTypeCodec call() throws NoSuchMethodException, SecurityException {
                 Set<UnionValueOptionContext> values = new HashSet<>();