*/
package org.opendaylight.controller.cluster.datastore;
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.primitives.Primitives;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
-import javax.annotation.concurrent.GuardedBy;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.text.WordUtils;
+import org.checkerframework.checker.lock.qual.GuardedBy;
import org.opendaylight.controller.cluster.datastore.DatastoreContext.Builder;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
* Processes a property defined on the DataStoreProperties interface.
*/
@SuppressWarnings("checkstyle:IllegalCatch")
- private static void processDataStoreProperty(final String name, final Class<?> propertyType, Method readMethod) {
- Preconditions.checkArgument(BUILDER_SETTERS.containsKey(name), String.format(
+ private static void processDataStoreProperty(final String name, final Class<?> propertyType,
+ final Method readMethod) {
+ checkArgument(BUILDER_SETTERS.containsKey(name),
"DataStoreProperties property \"%s\" does not have corresponding setter in DatastoreContext.Builder",
- name));
+ name);
try {
processPropertyType(propertyType);
DATA_STORE_PROP_INFO.put(name, new SimpleImmutableEntry<>(propertyType, readMethod));
// 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;