X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2FDatastoreContextIntrospector.java;h=579e096af77572393ad1e1f0d07439cd16b60210;hp=0f7d80bfde1f08e3c1893d9e74d0d52b565f53bb;hb=220fbf7b619893a063b4e97411f840723e54ddaf;hpb=e2cd5587eb694197d197e7a107cf87967caa96f2 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospector.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospector.java index 0f7d80bfde..579e096af7 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospector.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DatastoreContextIntrospector.java @@ -132,7 +132,8 @@ public class DatastoreContextIntrospector { * Processes a property defined on the DataStoreProperties interface. */ @SuppressWarnings("checkstyle:IllegalCatch") - private static void processDataStoreProperty(final String name, final Class propertyType, Method readMethod) { + private static void processDataStoreProperty(final String name, final Class propertyType, + final Method readMethod) { Preconditions.checkArgument(BUILDER_SETTERS.containsKey(name), String.format( "DataStoreProperties property \"%s\" does not have corresponding setter in DatastoreContext.Builder", name)); @@ -167,7 +168,7 @@ public class DatastoreContextIntrospector { // constructors but the one we want has the bean ConstructorProperties annotation. for (final Constructor ctor: propertyType.getConstructors()) { final ConstructorProperties ctorPropsAnnotation = ctor.getAnnotation(ConstructorProperties.class); - if (ctor.getParameterTypes().length == 1 && ctorPropsAnnotation != null) { + if (ctor.getParameterCount() == 1 && ctorPropsAnnotation != null) { findYangTypeGetter(propertyType, ctorPropsAnnotation.value()[0]); CONSTRUCTORS.put(propertyType, ctor); break;