import java.util.AbstractMap.SimpleImmutableEntry;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
* 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));
// 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;
// Sort the property keys by putting the names prefixed with the data store type last. This
// is done so data store specific settings are applied after global settings.
final ArrayList<String> keys = new ArrayList<>(inKeys);
- Collections.sort(keys, (key1, key2) -> key1.startsWith(dataStoreTypePrefix) ? 1 :
- key2.startsWith(dataStoreTypePrefix) ? -1 : key1.compareTo(key2));
+ keys.sort((key1, key2) -> key1.startsWith(dataStoreTypePrefix) ? 1 :
+ key2.startsWith(dataStoreTypePrefix) ? -1 : key1.compareTo(key2));
return keys;
}