Drop unneeded generic type specifiers 50/37550/2
authorStephen Kitt <skitt@redhat.com>
Wed, 13 Apr 2016 15:03:25 +0000 (17:03 +0200)
committerStephen Kitt <skitt@redhat.com>
Thu, 14 Apr 2016 07:32:44 +0000 (09:32 +0200)
Change-Id: Ifd28a6dda26da901925970ae86dc8c4c1a5bd4ee
Signed-off-by: Stephen Kitt <skitt@redhat.com>
112 files changed:
common/util/src/main/java/org/opendaylight/yangtools/util/ClassLoaderUtils.java
common/util/src/main/java/org/opendaylight/yangtools/util/Immutables.java
common/util/src/main/java/org/opendaylight/yangtools/util/ListenerRegistry.java
common/util/src/main/java/org/opendaylight/yangtools/util/MutableOffsetMap.java
common/util/src/main/java/org/opendaylight/yangtools/util/ReadWriteTrieMap.java
common/util/src/main/java/org/opendaylight/yangtools/util/SharedSingletonMap.java
common/util/src/main/java/org/opendaylight/yangtools/util/SingletonSet.java
common/util/src/main/java/org/opendaylight/yangtools/util/UnmodifiableCollection.java
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/AsyncNotifyingListenableFutureTask.java
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/FastThreadPoolExecutor.java
common/util/src/main/java/org/opendaylight/yangtools/util/concurrent/MappingCheckedFuture.java
common/util/src/test/java/org/opendaylight/yangtools/util/OffsetMapTest.java
common/util/src/test/java/org/opendaylight/yangtools/util/ReadWriteTrieMapTest.java
common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/CountingRejectedExecutionHandlerTest.java
common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/QueuedNotificationManagerTest.java
websocket/websocket-client/src/test/java/org/opendaylight/yangtools/websocket/WebSocketClientTest.java
websocket/websocket-client/src/test/java/org/opendaylight/yangtools/websocket/server/WebSocketServer.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/OperationFailedException.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/RpcResultBuilder.java
yang/yang-common/src/test/java/org/opendaylight/yangtools/yang/common/RpcResultBuilderTest.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/FixedYangInstanceIdentifier.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNodes.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/NormalizedNodeDataTreeCandidateNode.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/StoreTreeNodes.java
yang/yang-data-api/src/test/java/org/opendaylight/yangtools/yang/data/api/YangInstanceIdentifierTest.java
yang/yang-data-codec-gson/src/test/java/org/opendaylight/yangtools/yang/data/codec/gson/TestUtils.java
yang/yang-data-codec-gson/src/test/java/org/opendaylight/yangtools/yang/data/codec/gson/retest/TestUtils.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/EmptyStringCodec.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlDocumentUtils.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlStreamUtils.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/retest/XmlStreamUtils.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefContextTreeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefContextUtils.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPathParserListenerImpl.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/Builders.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/ImmutableNodes.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/InstanceIdToCompositeNodes.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/SchemaUtils.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedLeafSetNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedLeafSetNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableDataContainerNode.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/transform/base/parser/ListNodeBaseParser.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractDataTreeCandidateNode.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractDataTreeTip.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractLeafCandidateNode.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractModifiedNodeBasedCandidateNode.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/InMemoryDataTreeModification.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModifiedNode.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/OrderedLeafSetModificationStrategy.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/OrderedMapModificationStrategy.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/RecursiveReplaceCandidateNode.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ReplaceLeafCandidateNode.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/SchemaAwareApplyOperation.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/UnkeyedListModificationStrategy.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/UnorderedLeafSetModificationStrategy.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/UnorderedMapModificationStrategy.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/XmlStreamUtilsTest.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/codec/xml/retest/XmlStreamUtilsTest.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/DataTreeCandidateValidatorTest.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/test/retest/DataTreeCandidateValidatorTest.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/test/BuilderTest.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/test/codecs/BitsCodecStringTest.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/test/codecs/TypeDefinitionAwareCodecTestHelper.java
yang/yang-data-util/src/main/java/org/opendaylight/yangtools/yang/data/util/UnorderedMapMixinContextNode.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaResolutionException.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/SchemaSourceFilter.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/YangTextSchemaSource.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/YinTextSchemaSource.java
yang/yang-model-export/src/test/java/org/opendaylight/yangtools/yang/model/export/test/SimpleModuleTest.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/repo/util/AbstractSchemaRepository.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/repo/util/FilesystemSchemaSourceCache.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/repo/util/InMemorySchemaSourceCache.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/AbstractSchemaContext.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/BaseTypes.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/FilteringSchemaContextProxy.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/SchemaContextUtil.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/AbstractBaseType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/AbstractRangedBaseType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/BaseDecimalType.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/JavaLengthConstraints.java
yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/repo/util/SchemaSourceTransformerTest.java
yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/MustDefinitionImplTest.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/impl/BuilderUtils.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/impl/ChoiceBuilder.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/impl/ModuleBuilder.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/builder/impl/ModuleImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/impl/ParserListenerUtils.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/impl/SchemaContextImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/impl/YangParserImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/DependencyResolver.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/YangTextSchemaContextResolver.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StatementSupportBundle.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/ModifierImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/BelongsToStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/ImportStatementDefinition.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/IncludeStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/ModuleStatementSupport.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/PatternStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/SubmoduleStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/YangValidationBundles.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/AbstractEffectiveSchemaContext.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/EffectiveSchemaContext.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/IdentityEffectiveStatementImpl.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/util/ModuleDependencySort.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/builder/impl/BuilderUtilsTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/impl/YangModelValidationTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/impl/YangParserTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaContextFactoryTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaRepositoryTest.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/util/ModuleDependencySortTest.java

index f258cf839deea5fdb6066483924ff4edfdb6699d..41f0c9b472c34f49acd86afbdd7b2c13ee17e78d 100644 (file)
@@ -149,7 +149,7 @@ public final class ClassLoaderUtils {
     }
 
     public static <S,G,P> Class<P> findFirstGenericArgument(final Class<S> scannedClass, final Class<G> genericType) {
-        return withClassLoader(scannedClass.getClassLoader(), ClassLoaderUtils.<S,G,P>findFirstGenericArgumentTask(scannedClass, genericType));
+        return withClassLoader(scannedClass.getClassLoader(), ClassLoaderUtils.findFirstGenericArgumentTask(scannedClass, genericType));
     }
 
     private static <S,G,P> Supplier<Class<P>> findFirstGenericArgumentTask(final Class<S> scannedClass, final Class<G> genericType) {
index 3d3f02b4b0fd196310f58dcc753fcd312e0c014a..73e254abe7d122cd5d6813dab65b7c3e81f39ac9 100644 (file)
@@ -21,7 +21,7 @@ public final class Immutables {
         throw new UnsupportedOperationException("Helper class");
     }
 
-    public static final Set<Class<?>> KNOWN_IMMUTABLES = ImmutableSet.<Class<?>>of(
+    public static final Set<Class<?>> KNOWN_IMMUTABLES = ImmutableSet.of(
             Integer.class, Short.class, BigDecimal.class, BigInteger.class, Byte.class, Character.class, Double.class,
             Float.class, String.class, Boolean.class, Void.class);
 
index 38868cbc0fd5855899ee82abb021fa1c6cba197c..32876f6885210f9e0f50d4bf8992d497a9b3d8ee 100644 (file)
@@ -39,13 +39,13 @@ public class ListenerRegistry<T extends EventListener> implements Iterable<Liste
         if (listener == null) {
             throw new IllegalArgumentException("Listener should not be null.");
         }
-        final ListenerRegistrationImpl<T> ret = new ListenerRegistrationImpl<T>(listener);
+        final ListenerRegistrationImpl<T> ret = new ListenerRegistrationImpl<>(listener);
         listeners.put(ret,ret);
         return ret;
     }
 
     public <L extends T> ListenerRegistration<L> registerWithType(final L listener) {
-        final ListenerRegistrationImpl<L> ret = new ListenerRegistrationImpl<L>(listener);
+        final ListenerRegistrationImpl<L> ret = new ListenerRegistrationImpl<>(listener);
         listeners.put(ret,ret);
         return ret;
     }
index 45798d622b36f3b667f4167a0b672005ba2751e6..dee904fbe7ff0ef52ac99d763d4c59cf450fbe61 100644 (file)
@@ -44,15 +44,15 @@ import java.util.Set;
 public abstract class MutableOffsetMap<K, V> extends AbstractMap<K, V> implements Cloneable, ModifiableMapPhase<K, V> {
     static final class Ordered<K, V> extends MutableOffsetMap<K, V> {
         Ordered() {
-            super(new LinkedHashMap<K, V>());
+            super(new LinkedHashMap<>());
         }
 
         Ordered(final Map<K, V> source) {
-            super(OffsetMapCache.orderedOffsets(source.keySet()), source, new LinkedHashMap<K, V>());
+            super(OffsetMapCache.orderedOffsets(source.keySet()), source, new LinkedHashMap<>());
         }
 
         Ordered(final Map<K, Integer> offsets, final V[] objects) {
-            super(offsets, objects, new LinkedHashMap<K, V>());
+            super(offsets, objects, new LinkedHashMap<>());
         }
 
         @Override
@@ -78,15 +78,15 @@ public abstract class MutableOffsetMap<K, V> extends AbstractMap<K, V> implement
 
     static final class Unordered<K, V> extends MutableOffsetMap<K, V> {
         Unordered() {
-            super(new HashMap<K, V>());
+            super(new HashMap<>());
         }
 
         Unordered(final Map<K, V> source) {
-            super(OffsetMapCache.unorderedOffsets(source.keySet()), source, new HashMap<K, V>());
+            super(OffsetMapCache.unorderedOffsets(source.keySet()), source, new HashMap<>());
         }
 
         Unordered(final Map<K, Integer> offsets, final V[] objects) {
-            super(offsets, objects, new HashMap<K, V>());
+            super(offsets, objects, new HashMap<>());
         }
 
         @Override
@@ -129,7 +129,7 @@ public abstract class MutableOffsetMap<K, V> extends AbstractMap<K, V> implement
 
     @SuppressWarnings("unchecked")
     MutableOffsetMap(final HashMap<K, V> newKeys) {
-        this(ImmutableMap.<K, Integer>of(), (V[]) EMPTY_ARRAY, newKeys);
+        this(ImmutableMap.of(), (V[]) EMPTY_ARRAY, newKeys);
     }
 
     @SuppressWarnings("unchecked")
index 99cb628f89d86e78c9aba68e5139b3b36d8af719..f860a7b4641e931e830c9f05cadf0f1e7aebc7ed 100644 (file)
@@ -33,7 +33,7 @@ final class ReadWriteTrieMap<K, V> implements Map<K, V> {
     private int size;
 
     ReadWriteTrieMap() {
-        this.delegate = new TrieMap<K, V>();
+        this.delegate = new TrieMap<>();
         this.size = 0;
     }
 
index 6295e182e98ed9c726e4e2f8959a1ccfc4eeee91..e8366120dd9ffe71acca1f12848980408f3df831 100644 (file)
@@ -93,7 +93,7 @@ public abstract class SharedSingletonMap<K, V> implements Serializable, Unmodifi
 
     @Override
     public final SingletonSet<Entry<K, V>> entrySet() {
-        return SingletonSet.<Entry<K, V>>of(new SimpleImmutableEntry<>(keySet.getElement(), value));
+        return SingletonSet.of(new SimpleImmutableEntry<>(keySet.getElement(), value));
     }
 
     @Override
index 9587d1104efcfb4340ab8d64725b5f34436059eb..8f036931329cce6ec99db8e9ec4595677f8f10a2 100644 (file)
@@ -58,7 +58,7 @@ public abstract class SingletonSet<E> implements Set<E>, Immutable, Serializable
         if (element == null) {
             return (SingletonSet<E>) NULL_SINGLETON;
         }
-        return new RegularSingletonSet<E>(element);
+        return new RegularSingletonSet<>(element);
     }
 
     public abstract E getElement();
index e99659d286b657579469c06e72b7aecba0443861..ca6415f0e31b928c9f5d6ef11b5472262dc87ef0 100644 (file)
@@ -37,7 +37,7 @@ public final class UnmodifiableCollection<E> implements Collection<E>, Serializa
     private static final Collection<Class<?>> SINGLETON_CLASSES;
 
     static {
-        UNMODIFIABLE_COLLECTION_CLASS = Collections.unmodifiableCollection(new ArrayList<Object>()).getClass();
+        UNMODIFIABLE_COLLECTION_CLASS = Collections.unmodifiableCollection(new ArrayList<>()).getClass();
 
         final Builder<Class<?>> b = ImmutableSet.builder();
         b.add(Collections.singleton(null).getClass());
index f77a99895ecd035f5cdd23b57eb086b53458d18d..bd0919aecfc56e6d87f94046339df589a7b0c52b 100644 (file)
@@ -133,9 +133,9 @@ public class AsyncNotifyingListenableFutureTask<V> extends FutureTask<V> impleme
     public static <V> AsyncNotifyingListenableFutureTask<V> create(final Callable<V> callable,
             @Nullable final Executor listenerExecutor) {
         if (listenerExecutor != null) {
-            return new DelegatingAsyncNotifyingListenableFutureTask<V>(callable, listenerExecutor);
+            return new DelegatingAsyncNotifyingListenableFutureTask<>(callable, listenerExecutor);
         } else {
-            return new AsyncNotifyingListenableFutureTask<V>(callable);
+            return new AsyncNotifyingListenableFutureTask<>(callable);
         }
     }
 
@@ -152,9 +152,9 @@ public class AsyncNotifyingListenableFutureTask<V> extends FutureTask<V> impleme
     public static <V> AsyncNotifyingListenableFutureTask<V> create(final Runnable runnable, @Nullable final V result,
             @Nullable final Executor listenerExecutor) {
         if (listenerExecutor != null) {
-            return new DelegatingAsyncNotifyingListenableFutureTask<V>(runnable, result, listenerExecutor);
+            return new DelegatingAsyncNotifyingListenableFutureTask<>(runnable, result, listenerExecutor);
         } else {
-            return new AsyncNotifyingListenableFutureTask<V>(runnable, result);
+            return new AsyncNotifyingListenableFutureTask<>(runnable, result);
         }
     }
 
index 77a5846419e9db142c172d4dd30782a2827dbd37..f46dcbcd5cc75f64b36151ebcab847b7bdeacc8d 100644 (file)
@@ -68,7 +68,7 @@ public class FastThreadPoolExecutor extends ThreadPoolExecutor {
         // reached, subsequent tasks will be queued. If the queue is full, tasks will be rejected.
 
         super( maximumPoolSize, maximumPoolSize, keepAliveTime, unit,
-               new TrackingLinkedBlockingQueue<Runnable>( maximumQueueSize ) );
+                new TrackingLinkedBlockingQueue<>(maximumQueueSize) );
 
         this.threadPrefix = threadPrefix;
         this.maximumQueueSize = maximumQueueSize;
index 62385fdbc555a6c84e3c25601022783c2cffcb73..571411d24fd37878b74faed6a88582b5a0b6a7f6 100644 (file)
@@ -51,7 +51,7 @@ public final class MappingCheckedFuture<V, X extends Exception> extends Abstract
      */
     public static <V, X extends Exception> MappingCheckedFuture<V, X> create(
             final ListenableFuture<V> delegate, final Function<Exception, X> mapper ) {
-        return new MappingCheckedFuture<V, X>( delegate, mapper );
+        return new MappingCheckedFuture<>(delegate, mapper);
     }
 
     @Override
index fad44069e593a6a3270288b304fd0676da852212..bcd5da6367f64461286ac16e28db5d7681693d4c 100644 (file)
@@ -52,7 +52,7 @@ public class OffsetMapTest {
 
     @Test(expected=IllegalArgumentException.class)
     public void testWrongImmutableConstruction() {
-        new ImmutableOffsetMap.Ordered<String, String>(Collections.<String, Integer>emptyMap(), new String[1]);
+        new ImmutableOffsetMap.Ordered<>(Collections.<String, Integer>emptyMap(), new String[1]);
     }
 
     @Test
index 3389ccb1724644b151ec3c9b08fd33225112f000..f0d1ec8de97293b0af52db379a9d96be7a1ef5a3 100644 (file)
@@ -28,7 +28,7 @@ public class ReadWriteTrieMapTest {
         trieMap.put("0", "zero");
         trieMap.put("1", "one");
 
-        final ReadWriteTrieMap<String, String> readWriteTrieMap = new ReadWriteTrieMap<String, String>(trieMap, 5);
+        final ReadWriteTrieMap<String, String> readWriteTrieMap = new ReadWriteTrieMap<>(trieMap, 5);
 
         assertNotNull("Object readOnlyTrieMap shouldn't be 'null'.", readWriteTrieMap);
 
@@ -54,7 +54,7 @@ public class ReadWriteTrieMapTest {
         assertTrue("Entry set of readWriteTrieMap and trieMap should by equals.", convertSetEntryToMap(readWriteTrieMap.entrySet()).equals(trieMap));
 
         trieMap.put("2", "two");
-        final ReadWriteTrieMap<String, String> readWriteTrieMap2 = new ReadWriteTrieMap<String, String>(trieMap, 4);
+        final ReadWriteTrieMap<String, String> readWriteTrieMap2 = new ReadWriteTrieMap<>(trieMap, 4);
 
         assertFalse("Objects readWriteTrieMap and readOnlyTrieMap2 should be different.", readWriteTrieMap.equals(readWriteTrieMap2));
         assertFalse("Hash codes of object readWriteTrieMap and readOnelyTrieMap2 should be different.", readWriteTrieMap.hashCode() == readWriteTrieMap2.hashCode());
index 42c939ab34b6dc4f065faf4ab029d0a74b9c3c86..8c45dc25bb6ceb03582a7386a21b6f36566bdcef 100644 (file)
@@ -46,7 +46,7 @@ public class CountingRejectedExecutionHandlerTest {
         CountDownLatch blockLatch = new CountDownLatch( 1 );
 
         executor = new ThreadPoolExecutor( 1, 1, 0, TimeUnit.SECONDS,
-                ExecutorServiceUtil.offerFailingBlockingQueue( new LinkedBlockingQueue<Runnable>() ) );
+                ExecutorServiceUtil.offerFailingBlockingQueue(new LinkedBlockingQueue<>() ) );
 
         CountingRejectedExecutionHandler countingHandler =
                 CountingRejectedExecutionHandler.newCallerRunsPolicy();
@@ -73,7 +73,7 @@ public class CountingRejectedExecutionHandlerTest {
         CountDownLatch blockLatch = new CountDownLatch( 1 );
 
         executor = new ThreadPoolExecutor( 1, 1, 0, TimeUnit.SECONDS,
-                ExecutorServiceUtil.offerFailingBlockingQueue( new LinkedBlockingQueue<Runnable>() ) );
+                ExecutorServiceUtil.offerFailingBlockingQueue(new LinkedBlockingQueue<>() ) );
 
         CountingRejectedExecutionHandler countingHandler =
                 CountingRejectedExecutionHandler.newAbortPolicy();
index 7cc028a9f0ae1caee48b58f8f57f1e218440b275..455ccdd1b0b974ad248bd46b7b01945a54cc1a81 100644 (file)
@@ -48,7 +48,7 @@ public class QueuedNotificationManagerTest {
 
         TestListener( int expCount, int id ) {
             name = "TestListener " + id;
-            actual = Collections.synchronizedList( Lists.<N>newArrayListWithCapacity( expCount ) );
+            actual = Collections.synchronizedList( Lists.newArrayListWithCapacity( expCount ) );
             reset( expCount );
         }
 
@@ -148,7 +148,7 @@ public class QueuedNotificationManagerTest {
 
         queueExecutor = Executors.newFixedThreadPool( 2 );
         NotificationManager<TestListener<Integer>, Integer> manager =
-                new QueuedNotificationManager<>( queueExecutor, new TestNotifier<Integer>(),
+                new QueuedNotificationManager<>( queueExecutor, new TestNotifier<>(),
                 10, "TestMgr" );
 
         int initialCount = 6;
@@ -162,7 +162,7 @@ public class QueuedNotificationManagerTest {
         manager.submitNotifications( listener, Arrays.asList( 4, 5 ) );
         manager.submitNotification( listener, 6 );
 
-        manager.submitNotifications( null, Collections.<Integer>emptyList() );
+        manager.submitNotifications( null, Collections.emptyList() );
         manager.submitNotifications( listener, null );
         manager.submitNotification( listener, null );
 
@@ -188,7 +188,7 @@ public class QueuedNotificationManagerTest {
         queueExecutor = Executors.newFixedThreadPool( nListeners );
         final ExecutorService stagingExecutor = Executors.newFixedThreadPool( nListeners );
         final NotificationManager<TestListener<Integer>, Integer> manager =
-                new QueuedNotificationManager<>( queueExecutor, new TestNotifier<Integer>(),
+                new QueuedNotificationManager<>( queueExecutor, new TestNotifier<>(),
                 5000, "TestMgr" );
 
         final int nNotifications = 100000;
@@ -206,9 +206,9 @@ public class QueuedNotificationManagerTest {
         List<TestListener<Integer>> listeners = Lists.newArrayList();
         for( int i = 1; i <= nListeners; i++ ) {
             final TestListener<Integer> listener =
-                    i == 2 ? new TestListener2<Integer>( nNotifications, i ) :
-                    i == 3 ? new TestListener3<Integer>( nNotifications, i ) :
-                                      new TestListener<Integer>( nNotifications, i );
+                    i == 2 ? new TestListener2<>(nNotifications, i) :
+                    i == 3 ? new TestListener3<>(nNotifications, i) :
+                            new TestListener<>(nNotifications, i);
             listeners.add( listener );
 
             new Thread( new Runnable() {
@@ -247,7 +247,7 @@ public class QueuedNotificationManagerTest {
 
         queueExecutor = Executors.newFixedThreadPool( 1 );
         NotificationManager<TestListener<Integer>, Integer> manager =
-                new QueuedNotificationManager<>( queueExecutor, new TestNotifier<Integer>(),
+                new QueuedNotificationManager<>( queueExecutor, new TestNotifier<>(),
                 10, "TestMgr" );
 
 
@@ -265,7 +265,7 @@ public class QueuedNotificationManagerTest {
 
         final CountDownLatch errorCaughtLatch = new CountDownLatch( 1 );
         queueExecutor = new ThreadPoolExecutor( 1, 1, 0, TimeUnit.SECONDS,
-                                                new LinkedBlockingQueue<Runnable>() ) {
+                new LinkedBlockingQueue<>() ) {
              @Override
              public void execute( final Runnable command ) {
                  super.execute( new Runnable() {
@@ -282,7 +282,7 @@ public class QueuedNotificationManagerTest {
         };
 
         NotificationManager<TestListener<Integer>, Integer> manager =
-                new QueuedNotificationManager<>( queueExecutor, new TestNotifier<Integer>(),
+                new QueuedNotificationManager<>( queueExecutor, new TestNotifier<>(),
                 10, "TestMgr" );
 
         TestListener<Integer> listener = new TestListener<>( 2, 1 );
index a5bbb87b491dc37af1bbf0dc87030281f48bcadd..5718e5a8c567c3b46817d1adbc5695a61e048e70 100644 (file)
@@ -36,7 +36,7 @@ public class WebSocketClientTest {
     /**
      * Tracks if the message from the server has been received
      */
-    private SettableFuture<Boolean> messageReceived = SettableFuture.<Boolean>create();
+    private SettableFuture<Boolean> messageReceived = SettableFuture.create();
 
     /**
      * Tracks the port on which the server is listening
index 8659eac92de592301d97f1c6693cd7214ff5d29d..2ba02b7bce3846618dcde10e67e621e4e304b957 100644 (file)
@@ -71,7 +71,7 @@ public class WebSocketServer implements Runnable {
 
     public WebSocketServer(final int inPort) {
         this.inPort = inPort;
-        port = SettableFuture.<Integer>create();
+        port = SettableFuture.create();
     }
 
     @Override
index 55974a3f87dda49ced9014273e1d763a79125390..e47f31529771bbbc4bdb9e271af80c21d37a8eef 100644 (file)
@@ -50,7 +50,7 @@ public class OperationFailedException extends Exception {
         super(Preconditions.checkNotNull(message), cause);
 
         if (errors != null && errors.length > 0) {
-            errorList = ImmutableList.<RpcError>copyOf( Arrays.asList( errors ) );
+            errorList = ImmutableList.copyOf( Arrays.asList( errors ) );
         } else {
             // Add a default RpcError.
             errorList = ImmutableList.of(RpcResultBuilder.newError(ErrorType.APPLICATION, null,
index 690e29517dde914ae3c3dac9add327431d474f40..7b5ef531c9033d191146902dd14b8cc1a292d1de 100644 (file)
@@ -143,7 +143,7 @@ public final class RpcResultBuilder<T> implements Builder<RpcResult<T>> {
      * Returns a builder for a successful result.
      */
     public static <T> RpcResultBuilder<T> success() {
-        return new RpcResultBuilder<T>( true, null );
+        return new RpcResultBuilder<>(true, null);
     }
 
     /**
@@ -152,7 +152,7 @@ public final class RpcResultBuilder<T> implements Builder<RpcResult<T>> {
      * @param result the result value
      */
     public static <T> RpcResultBuilder<T> success( final T result ) {
-        return new RpcResultBuilder<T>( true, result );
+        return new RpcResultBuilder<>(true, result);
     }
 
     /**
@@ -168,7 +168,7 @@ public final class RpcResultBuilder<T> implements Builder<RpcResult<T>> {
      * Returns a builder for a failed result.
      */
     public static <T> RpcResultBuilder<T> failed() {
-        return new RpcResultBuilder<T>( false, null );
+        return new RpcResultBuilder<>(false, null);
     }
 
     /**
@@ -177,7 +177,7 @@ public final class RpcResultBuilder<T> implements Builder<RpcResult<T>> {
      * @param success true if successful, false otherwise.
      */
     public static <T> RpcResultBuilder<T> status( final boolean success ) {
-        return new RpcResultBuilder<T>( success, null );
+        return new RpcResultBuilder<>(success, null);
     }
 
     /**
@@ -186,7 +186,7 @@ public final class RpcResultBuilder<T> implements Builder<RpcResult<T>> {
      * @param other the other RpcResult.
      */
     public static <T> RpcResultBuilder<T> from( final RpcResult<T> other ) {
-        return new RpcResultBuilder<T>( other.isSuccessful(), other.getResult() )
+        return new RpcResultBuilder<>(other.isSuccessful(), other.getResult())
                                                       .withRpcErrors( other.getErrors() );
     }
 
@@ -290,7 +290,7 @@ public final class RpcResultBuilder<T> implements Builder<RpcResult<T>> {
     private void addError( final RpcError error ) {
 
         if (errors == null) {
-            errors = new ImmutableList.Builder<RpcError>();
+            errors = new ImmutableList.Builder<>();
         }
 
         errors.add( error );
@@ -409,8 +409,8 @@ public final class RpcResultBuilder<T> implements Builder<RpcResult<T>> {
     @Override
     public RpcResult<T> build() {
 
-        return new RpcResultImpl<T>( successful, result,
-                errors != null ? errors.build() : Collections.<RpcError>emptyList() );
+        return new RpcResultImpl<>(successful, result,
+                errors != null ? errors.build() : Collections.emptyList());
     }
 
     /**
index 3b714a5b51af37162bc77dfb31691c72f19c7d70..ef26846400561893fdef982947dcea0ec50c6930 100644 (file)
@@ -37,7 +37,7 @@ public class RpcResultBuilderTest {
         assertNotNull( "getErrors returned null", result.getErrors() );
         assertEquals( "getErrors size", 0, result.getErrors().size() );
 
-        result = RpcResultBuilder.<String>success( "bar" ).build();
+        result = RpcResultBuilder.success( "bar" ).build();
         verifyRpcResult( result, true, "bar" );
     }
 
@@ -86,7 +86,7 @@ public class RpcResultBuilderTest {
                 .withWarning( ErrorType.RPC, "in-use", "message", "my-app-tag", "my-info", cause )
                 .build();
 
-        RpcResult<String> copy = RpcResultBuilder.<String>from( result )
+        RpcResult<String> copy = RpcResultBuilder.from( result )
                 .withError( ErrorType.PROTOCOL, "error message" )
                 .build();
         verifyRpcResult( copy, true, "foo" );
index 59f58c09e44a5090b60aee04d1c1ab1de329fd48..39afcacba28b74c855da5ebd1a4b35b20aac2658 100644 (file)
@@ -14,7 +14,7 @@ import java.util.List;
 import org.opendaylight.yangtools.util.HashCodeBuilder;
 
 final class FixedYangInstanceIdentifier extends YangInstanceIdentifier implements Cloneable {
-    static final FixedYangInstanceIdentifier EMPTY_INSTANCE = new FixedYangInstanceIdentifier(ImmutableList.<PathArgument>of(), new HashCodeBuilder<>().build());
+    static final FixedYangInstanceIdentifier EMPTY_INSTANCE = new FixedYangInstanceIdentifier(ImmutableList.of(), new HashCodeBuilder<>().build());
     private static final long serialVersionUID = 1L;
     private final ImmutableList<PathArgument> path;
     private transient volatile YangInstanceIdentifier parent;
index 835855f45e109f87ef68100ebedec18ea25bbcdb..fb9b261e5df844465cc9f7f4269d27f4f4d3f7c1 100644 (file)
@@ -66,7 +66,7 @@ public final class NormalizedNodes {
     }
 
     public static Optional<NormalizedNode<?, ?>> findNode(final NormalizedNode<?, ?> parent, final Iterable<PathArgument> relativePath) {
-        return findNode(Optional.<NormalizedNode<?, ?>>fromNullable(parent), relativePath);
+        return findNode(Optional.fromNullable(parent), relativePath);
     }
 
     public static Optional<NormalizedNode<?, ?>> findNode(final NormalizedNode<?, ?> parent, final PathArgument... relativePath) {
@@ -77,7 +77,7 @@ public final class NormalizedNodes {
         checkNotNull(tree, "Tree must not be null");
         checkNotNull(path, "Path must not be null");
 
-        return findNode(Optional.<NormalizedNode<?, ?>>of(tree), path.getPathArguments());
+        return findNode(Optional.of(tree), path.getPathArguments());
     }
 
     @SuppressWarnings({ "unchecked", "rawtypes" })
index 59424a4fc2e7754484677895fd580df4882466bc..f471e858ff8335bed1f2ad40fd030d845bf89e01 100644 (file)
@@ -76,7 +76,7 @@ final class NormalizedNodeDataTreeCandidateNode implements DataTreeCandidateNode
 
     @Override
     public Optional<NormalizedNode<?, ?>> getDataAfter() {
-        return Optional.<NormalizedNode<?, ?>>of(data);
+        return Optional.of(data);
     }
 
     @Override
index a7a15385a9e48be1d51f294bfb25eb280eb6f8aa..0fb94c54ac33f01171d485c7666dda5e0a8b41c9 100644 (file)
@@ -36,7 +36,7 @@ public final class StoreTreeNodes {
      * @return Optional with node if the node is present in tree, {@link Optional#absent()} otherwise.
      */
     public static <T extends StoreTreeNode<T>> Optional<T> findNode(final T tree, final YangInstanceIdentifier path) {
-        Optional<T> current = Optional.<T> of(tree);
+        Optional<T> current = Optional.of(tree);
         Iterator<PathArgument> pathIter = path.getPathArguments().iterator();
         while (current.isPresent() && pathIter.hasNext()) {
             current = current.get().getChild(pathIter.next());
@@ -71,13 +71,13 @@ public final class StoreTreeNodes {
      */
     public static <T extends StoreTreeNode<T>> Entry<YangInstanceIdentifier, T> findClosest(final T tree,
             final YangInstanceIdentifier path) {
-        return findClosestsOrFirstMatch(tree, path, Predicates.<T>alwaysFalse());
+        return findClosestsOrFirstMatch(tree, path, Predicates.alwaysFalse());
     }
 
     public static <T extends StoreTreeNode<T>> Entry<YangInstanceIdentifier, T> findClosestsOrFirstMatch(final T tree,
             final YangInstanceIdentifier path, final Predicate<T> predicate) {
-        Optional<T> parent = Optional.<T>of(tree);
-        Optional<T> current = Optional.<T> of(tree);
+        Optional<T> parent = Optional.of(tree);
+        Optional<T> current = Optional.of(tree);
 
         int nesting = 0;
         Iterator<PathArgument> pathIter = path.getPathArguments().iterator();
@@ -88,7 +88,7 @@ public final class StoreTreeNodes {
         }
         if (current.isPresent()) {
             final YangInstanceIdentifier currentPath = path.getAncestor(nesting);
-            return new SimpleImmutableEntry<YangInstanceIdentifier, T>(currentPath, current.get());
+            return new SimpleImmutableEntry<>(currentPath, current.get());
         }
 
         /*
@@ -98,7 +98,7 @@ public final class StoreTreeNodes {
          * present. At any rate we verify state just to be on the safe side.
          */
         Verify.verify(nesting > 0);
-        return new SimpleImmutableEntry<YangInstanceIdentifier, T>(path.getAncestor(nesting - 1), parent.get());
+        return new SimpleImmutableEntry<>(path.getAncestor(nesting - 1), parent.get());
     }
 
     public static <T extends StoreTreeNode<T>> Optional<T> getChild(final Optional<T> parent, final PathArgument child) {
index 0f1483444faaedd809dff96a585c72dd1659a4f6..00877d96a7c806bb6860177eeddd9c0ceabd3bcf 100644 (file)
@@ -178,7 +178,7 @@ public class YangInstanceIdentifierTest {
 
         YangInstanceIdentifier newID = YangInstanceIdentifier.builder()
                 .node( NODENAME1 )
-                .nodeWithKey( NODENAME2, Collections.<QName,Object>singletonMap( KEY1, "foo" ) )
+                .nodeWithKey( NODENAME2, Collections.singletonMap( KEY1, "foo" ) )
                 .nodeWithKey( NODENAME3, KEY2, "bar" ).build();
 
         assertNotNull( "InstanceIdentifier is null", newID );
index 260bf502e11b033a9b2f4c9b3dec27dc5b3a370d..c5b6d80c2e775f635e6ab39f9245c5c8cbb339ed 100644 (file)
@@ -37,7 +37,7 @@ public class TestUtils {
         URI path = StreamToNormalizedNodeTest.class.getResource(resourceDirectory).toURI();
         final File testDir = new File(path);
         final String[] fileList = testDir.list();
-        final List<File> testFiles = new ArrayList<File>();
+        final List<File> testFiles = new ArrayList<>();
         if (fileList == null) {
             throw new FileNotFoundException(resourceDirectory);
         }
index 9d57d47d6070fe7b3e9d64235c2eb1ee58b07934..ed539d785a0627c9a5852f020bc24e259c8635de 100644 (file)
@@ -35,7 +35,7 @@ public class TestUtils {
         URI path = StreamToNormalizedNodeTest.class.getResource(resourceDirectory).toURI();
         final File testDir = new File(path);
         final String[] fileList = testDir.list();
-        final List<File> testFiles = new ArrayList<File>();
+        final List<File> testFiles = new ArrayList<>();
         if (fileList == null) {
             throw new FileNotFoundException(resourceDirectory);
         }
index dde3ec96293ac3a74eaf9f9e5dc2205c2f4abf12..46aac96180658e4c905585bba84bd709d240ad0f 100644 (file)
@@ -18,7 +18,7 @@ final class EmptyStringCodec extends TypeDefinitionAwareCodec<Void, EmptyTypeDef
     static final EmptyStringCodec INSTANCE = new EmptyStringCodec();
 
     private EmptyStringCodec() {
-        super(Optional.<EmptyTypeDefinition>absent(), Void.class);
+        super(Optional.absent(), Void.class);
     }
 
     @Override
index 19122a00cb18ffdfedfa38f1bcc2d6545b96876b..bdfb928ff7101619ae372e1810d8917e0a0e4774 100644 (file)
@@ -94,7 +94,7 @@ public final class XmlDocumentUtils {
         if (dataSchemaNode != null && qname != null) {
             for (DataSchemaNode dsn : dataSchemaNode) {
                 if (qname.isEqualWithoutRevision(dsn.getQName())) {
-                    return Optional.<DataSchemaNode> of(dsn);
+                    return Optional.of(dsn);
                 } else if (dsn instanceof ChoiceSchemaNode) {
                     for (ChoiceCaseNode choiceCase : ((ChoiceSchemaNode) dsn).getCases()) {
                         Optional<DataSchemaNode> foundDsn = findFirstSchema(qname, choiceCase.getChildNodes());
index eeda8954c79231371567d674eda12e8b3fc6b482..dfce4751b0b3e60ce86322a01605f63d6a141ca1 100644 (file)
@@ -116,7 +116,7 @@ public class XmlStreamUtils {
     }
 
     public void writeValue(@Nonnull final XMLStreamWriter writer, @Nonnull final SchemaNode schemaNode, final Object value) throws XMLStreamException {
-        writeValue(writer, schemaNode, value, Optional.<QNameModule>absent());
+        writeValue(writer, schemaNode, value, Optional.absent());
     }
 
     public void writeValue(@Nonnull final XMLStreamWriter writer, @Nonnull final SchemaNode schemaNode, final Object value, final QNameModule parent) throws XMLStreamException {
@@ -144,7 +144,7 @@ public class XmlStreamUtils {
             if (parent.isPresent()) {
                 write(writer, (IdentityrefTypeDefinition) baseType, value, parent);
             } else {
-                write(writer, (IdentityrefTypeDefinition) baseType, value, Optional.<QNameModule>absent());
+                write(writer, (IdentityrefTypeDefinition) baseType, value, Optional.absent());
             }
         } else if (baseType instanceof InstanceIdentifierTypeDefinition) {
             write(writer, (InstanceIdentifierTypeDefinition) baseType, value);
@@ -171,7 +171,7 @@ public class XmlStreamUtils {
     }
 
     public void writeValue(@Nonnull final XMLStreamWriter writer, @Nonnull final TypeDefinition<?> type, final Object value) throws XMLStreamException {
-        writeValue(writer, type, value, Optional.<QNameModule>absent());
+        writeValue(writer, type, value, Optional.absent());
     }
 
     @VisibleForTesting
index ab51f8a05f0f438eefcf2c47c7c9a1e0bc4a8f81..bad3552cb34574e0fe8ab49e26bb862834d0a94b 100644 (file)
@@ -145,7 +145,7 @@ public class XmlStreamUtils {
 
     public void writeValue(@Nonnull final XMLStreamWriter writer, @Nonnull final SchemaNode schemaNode,
             final Object value) throws XMLStreamException {
-        writeValue(writer, schemaNode, value, Optional.<QNameModule> absent());
+        writeValue(writer, schemaNode, value, Optional.absent());
     }
 
     public void writeValue(@Nonnull final XMLStreamWriter writer, @Nonnull final SchemaNode schemaNode,
@@ -181,7 +181,7 @@ public class XmlStreamUtils {
             if (parent.isPresent()) {
                 write(writer, (IdentityrefTypeDefinition) baseType, value, parent);
             } else {
-                write(writer, (IdentityrefTypeDefinition) baseType, value, Optional.<QNameModule> absent());
+                write(writer, (IdentityrefTypeDefinition) baseType, value, Optional.absent());
             }
         } else if (baseType instanceof InstanceIdentifierTypeDefinition) {
             write(writer, (InstanceIdentifierTypeDefinition) baseType, value);
@@ -211,7 +211,7 @@ public class XmlStreamUtils {
 
     public void writeValue(@Nonnull final XMLStreamWriter writer, @Nonnull final TypeDefinition<?> type,
             final Object value) throws XMLStreamException {
-        writeValue(writer, type, value, Optional.<QNameModule> absent());
+        writeValue(writer, type, value, Optional.absent());
     }
 
     @VisibleForTesting
index c5d81bac11f57a15562f5b7e52910ac257164b1f..be38b2b0ff31ef9abd5fe9804b4c4a9e24cf2229 100644 (file)
@@ -31,7 +31,7 @@ class LeafRefContextTreeBuilder {
 
     public LeafRefContextTreeBuilder(final SchemaContext schemaContext) {
         this.schemaContext = schemaContext;
-        this.leafRefs = new LinkedList<LeafRefContext>();
+        this.leafRefs = new LinkedList<>();
     }
 
     public LeafRefContext buildLeafRefContextTree() throws IOException,
@@ -214,7 +214,7 @@ class LeafRefContextTreeBuilder {
         final LeafRefPath nodeXPath = LeafRefUtils.schemaPathToLeafRefPath(
                 node.getPath(), module);
 
-        final List<LeafRefContext> foundLeafRefs = new LinkedList<LeafRefContext>();
+        final List<LeafRefContext> foundLeafRefs = new LinkedList<>();
 
         for (final LeafRefContext leafref : leafRefs) {
             final LeafRefPath leafRefTargetPath = leafref
index 07158edb6ae44e5f04695c2a52bcd87601b8bb43..c4705eae40b67f9303c699b2c6dd3a9a888e8a03 100644 (file)
@@ -167,7 +167,7 @@ public final class LeafRefContextUtils {
     public static List<LeafRefContext> findAllLeafRefChilds(
             final LeafRefContext parent) {
 
-        final LinkedList<LeafRefContext> leafRefChilds = new LinkedList<LeafRefContext>();
+        final LinkedList<LeafRefContext> leafRefChilds = new LinkedList<>();
 
         if (parent == null) {
             return leafRefChilds;
@@ -212,7 +212,7 @@ public final class LeafRefContextUtils {
     public static List<LeafRefContext> findAllChildsReferencedByLeafRef(
             final LeafRefContext parent) {
 
-        final LinkedList<LeafRefContext> childsReferencedByLeafRef = new LinkedList<LeafRefContext>();
+        final LinkedList<LeafRefContext> childsReferencedByLeafRef = new LinkedList<>();
 
         if (parent == null) {
             return childsReferencedByLeafRef;
@@ -250,7 +250,7 @@ public final class LeafRefContextUtils {
                 pathFromRoot, root);
 
         if (leafRefReferencedByContext == null) {
-            return new HashMap<QName, LeafRefContext>();
+            return new HashMap<>();
         }
 
         return leafRefReferencedByContext.getAllReferencedByLeafRefCtxs();
index b1762982a7ad6f1c5725107f09594ecd78707cc4..5f5e0b23d71d7478808ebd3a81d810f7b7593a45 100644 (file)
@@ -61,7 +61,7 @@ final class LeafRefPathParserListenerImpl extends LeafRefPathParserBaseListener{
     public LeafRefPathParserListenerImpl(final SchemaContext schemaContext, final Module currentModule, final SchemaNode currentNode) {
        this.schemaContext = schemaContext;
        this.module = currentModule;
-       this.leafRefPathQnameList = new LinkedList<QNameWithPredicateBuilder>();
+       this.leafRefPathQnameList = new LinkedList<>();
        this.node=currentNode;
        this.currentParsingState = ParsingState.LEAF_REF_PATH;
     }
@@ -84,7 +84,7 @@ final class LeafRefPathParserListenerImpl extends LeafRefPathParserBaseListener{
     @Override
     public void enterRel_path_keyexpr(final Rel_path_keyexprContext ctx) {
         currentParsingState=ParsingState.PATH_KEY_EXPR;
-        predicatePathKeyQnameList = new LinkedList<QNameWithPredicateBuilder>();
+        predicatePathKeyQnameList = new LinkedList<>();
         final List<TerminalNode> dots = ctx.DOTS();
         for (final TerminalNode parent : dots) {
             predicatePathKeyQnameList.add(QNameWithPredicateBuilder.UP_PARENT_BUILDER);
index b732ace51d6544d57f6b051894ba2cc05af3a5c1..e930de63c84942489019f4ed1e337ec84570b1da 100644 (file)
@@ -111,7 +111,7 @@ public final class Builders {
     }
 
     public static <T> ListNodeBuilder<T,LeafSetEntryNode<T>> orderedLeafSetBuilder(final LeafListSchemaNode schema) {
-        return ImmutableOrderedLeafSetNodeSchemaAwareBuilder.<T>create(schema);
+        return ImmutableOrderedLeafSetNodeSchemaAwareBuilder.create(schema);
     }
 
     public static <T> ListNodeBuilder<T,LeafSetEntryNode<T>> leafSetBuilder(final LeafSetNode<T> node) {
@@ -119,11 +119,11 @@ public final class Builders {
     }
 
     public static <T> ListNodeBuilder<T,LeafSetEntryNode<T>> leafSetBuilder(final LeafListSchemaNode schema) {
-        return ImmutableLeafSetNodeSchemaAwareBuilder.<T>create(schema);
+        return ImmutableLeafSetNodeSchemaAwareBuilder.create(schema);
     }
 
     public static <T> ListNodeBuilder<T,LeafSetEntryNode<T>> leafSetBuilder(final LeafListSchemaNode schema, final LeafSetNode<T> node) {
-        return ImmutableLeafSetNodeSchemaAwareBuilder.<T>create(schema, node);
+        return ImmutableLeafSetNodeSchemaAwareBuilder.create(schema, node);
     }
 
     public static DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> containerBuilder() {
index 14b200fef414a651c24e4102d761e98c766d16bc..a7f9b79dd471a629c87e0df354a541cfa0cad373 100644 (file)
@@ -102,7 +102,7 @@ public final class ImmutableNodes {
      * @return serialized normalized node for provided instance Id
      */
     public static NormalizedNode<?, ?> fromInstanceId(final SchemaContext ctx, final YangInstanceIdentifier id) {
-        return fromInstanceId(ctx, id, Optional.<NormalizedNode<?, ?>>absent(), Optional.<Map.Entry<QName, ModifyAction>>absent());
+        return fromInstanceId(ctx, id, Optional.absent(), Optional.absent());
     }
 
     /**
@@ -114,7 +114,7 @@ public final class ImmutableNodes {
      * @return serialized normalized node for provided instance Id with overridden last child.
      */
     public static NormalizedNode<?, ?> fromInstanceId(final SchemaContext ctx, final YangInstanceIdentifier id, final NormalizedNode<?, ?> deepestElement) {
-        return fromInstanceId(ctx, id, Optional.<NormalizedNode<?, ?>>of(deepestElement), Optional.<Map.Entry<QName, ModifyAction>>absent());
+        return fromInstanceId(ctx, id, Optional.of(deepestElement), Optional.absent());
     }
 
     /**
index aa777d2fecaf395758ceae54a03e9215a2003671..f2530f73bbadada5978890727ab6b6885e05600e 100644 (file)
@@ -284,7 +284,7 @@ abstract class InstanceIdToCompositeNodes<T extends PathArgument> extends Instan
         public UnorderedMapMixinNormalization(final ListSchemaNode list) {
             super(NodeIdentifier.create(list.getQName()));
             this.innerNode = new ListItemNormalization(new NodeIdentifierWithPredicates(list.getQName(),
-                    Collections.<QName, Object>emptyMap()), list);
+                    Collections.emptyMap()), list);
         }
 
         @Override
index 04abae09054e4853bc077637af1b6fee94a917f9..6869b57d619d61f283c5367a3a06a6619454f707 100644 (file)
@@ -447,15 +447,15 @@ public final class SchemaUtils {
     }
 
     private static Optional<SchemaNode> tryFindGroupings(final SchemaContext ctx, final QName qname) {
-        return Optional.<SchemaNode> fromNullable(Iterables.find(ctx.getGroupings(), new SchemaNodePredicate(qname), null));
+        return Optional.fromNullable(Iterables.find(ctx.getGroupings(), new SchemaNodePredicate(qname), null));
     }
 
     private static Optional<SchemaNode> tryFindRpc(final SchemaContext ctx, final QName qname) {
-        return Optional.<SchemaNode>fromNullable(Iterables.find(ctx.getOperations(), new SchemaNodePredicate(qname), null));
+        return Optional.fromNullable(Iterables.find(ctx.getOperations(), new SchemaNodePredicate(qname), null));
     }
 
     private static Optional<SchemaNode> tryFindNotification(final SchemaContext ctx, final QName qname) {
-        return Optional.<SchemaNode>fromNullable(Iterables.find(ctx.getNotifications(), new SchemaNodePredicate(qname), null));
+        return Optional.fromNullable(Iterables.find(ctx.getNotifications(), new SchemaNodePredicate(qname), null));
     }
 
     private static final class SchemaNodePredicate implements Predicate<SchemaNode> {
index 943c78975126f50801c322ff10f498296a76375f..72572704e348497dfaa8df6b50357bc44934a5c8 100644 (file)
@@ -62,7 +62,7 @@ public class ImmutableLeafSetNodeBuilder<T> implements ListNodeBuilder<T, LeafSe
             throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass()));
         }
 
-        return new ImmutableLeafSetNodeBuilder<T>((ImmutableLeafSetNode<T>) node);
+        return new ImmutableLeafSetNodeBuilder<>((ImmutableLeafSetNode<T>) node);
     }
 
     @Override
@@ -108,7 +108,7 @@ public class ImmutableLeafSetNodeBuilder<T> implements ListNodeBuilder<T, LeafSe
 
     @Override
     public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T value) {
-        return withChildValue(value, Collections.<QName,String>emptyMap());
+        return withChildValue(value, Collections.emptyMap());
     }
 
     protected final static class ImmutableLeafSetNode<T> extends
index e636a4ac4f2340aee46b2e62e11fdd4086c0e8b9..ba0d64a1e3fc7943e165098ce4c0810e77a0295d 100644 (file)
@@ -42,7 +42,7 @@ public final class ImmutableLeafSetNodeSchemaAwareBuilder<T> extends ImmutableLe
             throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass()));
         }
 
-        return new ImmutableLeafSetNodeSchemaAwareBuilder<T>(schema, (ImmutableLeafSetNode<T>) node);
+        return new ImmutableLeafSetNodeSchemaAwareBuilder<>(schema, (ImmutableLeafSetNode<T>) node);
     }
 
     @Override
index 059741d6a01fd656ed422575f8c2c8de06cb69e8..d2558319dd3114c35cf8d6326bf4af8359eb1c92 100644 (file)
@@ -52,7 +52,7 @@ public class ImmutableOrderedLeafSetNodeBuilder<T> implements ListNodeBuilder<T,
             throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass()));
         }
 
-        return new ImmutableOrderedLeafSetNodeBuilder<T>((ImmutableOrderedLeafSetNode<T>) node);
+        return new ImmutableOrderedLeafSetNodeBuilder<>((ImmutableOrderedLeafSetNode<T>) node);
     }
 
     private void checkDirty() {
@@ -108,7 +108,7 @@ public class ImmutableOrderedLeafSetNodeBuilder<T> implements ListNodeBuilder<T,
 
     @Override
     public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T value) {
-        return withChildValue(value, Collections.<QName,String>emptyMap());
+        return withChildValue(value, Collections.emptyMap());
     }
 
     protected static final class ImmutableOrderedLeafSetNode<T> extends
index 5d467180aaa1e64fb7c98f94145e5b8b8383163e..a3ad5501f56742b0d81bda2268b61930c9cdb6a6 100644 (file)
@@ -42,7 +42,7 @@ public final class ImmutableOrderedLeafSetNodeSchemaAwareBuilder<T> extends Immu
             throw new UnsupportedOperationException(String.format("Cannot initialize from class %s", node.getClass()));
         }
 
-        return new ImmutableOrderedLeafSetNodeSchemaAwareBuilder<T>(schema, (ImmutableOrderedLeafSetNode<T>) node);
+        return new ImmutableOrderedLeafSetNodeSchemaAwareBuilder<>(schema, (ImmutableOrderedLeafSetNode<T>) node);
     }
 
     @Override
index 8151b2a02ac159af4112c3c7435330a29b078206..f2677571f04b717708776dea0567f4154b6e7da2 100644 (file)
@@ -30,7 +30,7 @@ public abstract class AbstractImmutableDataContainerNode<K extends PathArgument>
 
     @Override
     public final Optional<DataContainerChild<? extends PathArgument, ?>> getChild(final PathArgument child) {
-        return Optional.<DataContainerChild<? extends PathArgument, ?>> fromNullable(children.get(child));
+        return Optional.fromNullable(children.get(child));
     }
 
     @Override
index b5bd5c8f7e06c65905baf5d49c481f66313bbdde..b72eb3a7e76a1a2a174e185b1b37bbf23f14b680 100644 (file)
@@ -40,7 +40,7 @@ public abstract class ListNodeBaseParser<E, N extends NormalizedNode<?, ?>, O ex
     public O parse(Iterable<E> childNodes, S schema) {
         CollectionNodeBuilder<N, O> listBuilder = provideBuilder(schema);
 
-        buildingStrategy.prepareAttributes(Collections.<QName, String>emptyMap(), listBuilder);
+        buildingStrategy.prepareAttributes(Collections.emptyMap(), listBuilder);
 
         for (E childNode : childNodes) {
             N listChild = getListEntryNodeParser().parse(Collections.singletonList(childNode), schema);
index d9ff8928cdc69ea045f4caf9ce32c04d7fdd0128..90ecd84b771f132b9b0bc3b370af2bb8a47be839 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2015, 2016 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -116,7 +116,7 @@ abstract class AbstractDataTreeCandidateNode implements DataTreeCandidateNode {
     }
 
     protected final Optional<NormalizedNode<?, ?>> dataOptional() {
-        return Optional.<NormalizedNode<?, ?>>of(data);
+        return Optional.of(data);
     }
 
     @Override
index 973c6fa0b072bb4488c83d6b3f494470f3a59152..036e0af765ba54289ffd049668d34a2a4c6acd19 100644 (file)
@@ -20,7 +20,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailed
 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
 
 abstract class AbstractDataTreeTip implements DataTreeTip {
-    private static final YangInstanceIdentifier PUBLIC_ROOT_PATH = YangInstanceIdentifier.create(Collections.<PathArgument>emptyList());
+    private static final YangInstanceIdentifier PUBLIC_ROOT_PATH = YangInstanceIdentifier.create(Collections.emptyList());
 
     /**
      * Return the current root node of this tip.
index 5e9a6766c73e4e5ee705a4c05c3ce879907d71f9..b77cb17af762e0a7bc0a58c27c2c1a9487427afa 100644 (file)
@@ -24,7 +24,7 @@ abstract class AbstractLeafCandidateNode implements DataTreeCandidateNode {
     }
 
     protected final Optional<NormalizedNode<?, ?>> dataOptional() {
-        return Optional.<NormalizedNode<?, ?>>of(data);
+        return Optional.of(data);
     }
 
     @Override
index 439c43193a9bc228dcaa808b277a3d4b86a43478..92586972e9a132aa4f5617874605a5d0de42d330 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2015, 2016 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -125,7 +125,7 @@ abstract class AbstractModifiedNodeBasedCandidateNode implements DataTreeCandida
 
     private static Optional<NormalizedNode<?, ?>> optionalData(final TreeNode meta) {
         if (meta != null) {
-            return Optional.<NormalizedNode<?,?>>of(meta.getData());
+            return Optional.of(meta.getData());
         } else {
             return Optional.absent();
         }
index 0a137ab3b15eec6f97d7a2ea5dee0c22266c9088..cd361ce32852eba5aff6fe1286f4bbb8adec4393 100644 (file)
@@ -131,7 +131,7 @@ final class InMemoryDataTreeModification extends AbstractCursorAware implements
         LOG.trace("Resolving modification apply strategy for {}", path);
 
         upgradeIfPossible();
-        return StoreTreeNodes.<ModificationApplyOperation>findNodeChecked(strategyTree, path);
+        return StoreTreeNodes.findNodeChecked(strategyTree, path);
     }
 
     private OperationWithModification resolveModificationFor(final YangInstanceIdentifier path) {
index 26261bdfba9a0913622a73dfc7f28550cd5b32ca..7360e988d23c08003e6ec71817dda1eea4bfadaf 100644 (file)
@@ -119,7 +119,7 @@ final class ModifiedNode extends NodeModification implements StoreTreeNode<Modif
     }
 
     private Optional<TreeNode> metadataFromSnapshot(@Nonnull final PathArgument child) {
-        return original.isPresent() ? original.get().getChild(child) : Optional.<TreeNode>absent();
+        return original.isPresent() ? original.get().getChild(child) : Optional.absent();
     }
 
     private Optional<TreeNode> metadataFromData(@Nonnull final PathArgument child, final Version modVersion) {
index 488cc2281f01c1851f8142228016920871315028..f1e545b0cf1d5521ac2172dce339f2b20876df0f 100644 (file)
@@ -25,7 +25,7 @@ final class OrderedLeafSetModificationStrategy extends AbstractNodeContainerModi
     @SuppressWarnings({ "unchecked", "rawtypes" })
     OrderedLeafSetModificationStrategy(final LeafListSchemaNode schema, final TreeType treeType) {
         super((Class) LeafSetNode.class, treeType);
-        entryStrategy = Optional.<ModificationApplyOperation> of(new LeafSetEntryModificationStrategy(schema));
+        entryStrategy = Optional.of(new LeafSetEntryModificationStrategy(schema));
     }
 
     @Override
index c69a170f246550b8a2f53ef5899ad47c7cc86ce0..4143fb83ec98d98faaa88ba6ea8b13ab681ad3e6 100644 (file)
@@ -24,7 +24,7 @@ final class OrderedMapModificationStrategy extends AbstractNodeContainerModifica
 
     OrderedMapModificationStrategy(final ListSchemaNode schema, final TreeType treeType) {
         super(OrderedMapNode.class, treeType);
-        entryStrategy = Optional.<ModificationApplyOperation> of(new ListEntryModificationStrategy(schema, treeType));
+        entryStrategy = Optional.of(new ListEntryModificationStrategy(schema, treeType));
     }
 
     @Override
index 6538c0a1cee24132fc48597ccc42126be7bd500a..224aa32dce52fa8c5a244fd3754a1434e94040a7 100644 (file)
@@ -40,7 +40,7 @@ final class RecursiveReplaceCandidateNode extends AbstractDataTreeCandidateNode
 
     @Override
     public Optional<NormalizedNode<?, ?>> getDataBefore() {
-        return Optional.<NormalizedNode<?, ?>>of(oldData);
+        return Optional.of(oldData);
     }
 
     @Override
index 9b48744b7fadd0ccb089d02483cbd1407046f3fc..b264a20e1e150bd9b11ef7b808dcf9b36f27d139 100644 (file)
@@ -21,6 +21,6 @@ final class ReplaceLeafCandidateNode extends AbstractWriteCandidate {
 
     @Override
     public Optional<NormalizedNode<?, ?>> getDataBefore() {
-        return Optional.<NormalizedNode<?, ?>>of(oldData);
+        return Optional.of(oldData);
     }
 }
\ No newline at end of file
index ea40848084745f448bb5a739b10edbb36170050f..2ca70603d4cf33db7a5ab2131a326cde8d78d0b5 100644 (file)
@@ -192,7 +192,7 @@ abstract class SchemaAwareApplyOperation extends ModificationApplyOperation {
         case DELETE:
             // Deletion of a non-existing node is a no-op, report it as such
             modification.resolveModificationType(currentMeta.isPresent() ? ModificationType.DELETE : ModificationType.UNMODIFIED);
-            return modification.setSnapshot(Optional.<TreeNode> absent());
+            return modification.setSnapshot(Optional.absent());
         case TOUCH:
             Preconditions.checkArgument(currentMeta.isPresent(), "Metadata not available for modification %s",
                     modification);
index 561f5fcc7876ee17cc98138a8cfab40895561c5a..fd538cb0f1c50958a361dc4d3cd6bbb623e3103e 100644 (file)
@@ -28,7 +28,7 @@ final class UnkeyedListModificationStrategy extends SchemaAwareApplyOperation {
     private final Optional<ModificationApplyOperation> entryStrategy;
 
     UnkeyedListModificationStrategy(final ListSchemaNode schema, final TreeType treeType) {
-        entryStrategy = Optional.<ModificationApplyOperation> of(new UnkeyedListItemModificationStrategy(schema, treeType));
+        entryStrategy = Optional.of(new UnkeyedListItemModificationStrategy(schema, treeType));
     }
 
     @Override
index e52325ea79a7936b74f06f79ef78cab587609017..709a4a9a0df4ccd3792a27b79667825028ea0d45 100644 (file)
@@ -24,7 +24,7 @@ final class UnorderedLeafSetModificationStrategy extends AbstractNodeContainerMo
     @SuppressWarnings({ "unchecked", "rawtypes" })
     UnorderedLeafSetModificationStrategy(final LeafListSchemaNode schema, final TreeType treeType) {
         super((Class) LeafSetNode.class, treeType);
-        entryStrategy = Optional.<ModificationApplyOperation> of(new LeafSetEntryModificationStrategy(schema));
+        entryStrategy = Optional.of(new LeafSetEntryModificationStrategy(schema));
     }
 
     @SuppressWarnings("rawtypes")
index 601939bc9710910153a99daf3812040f60c1bf17..1e66f4a24c46569515cee1aa9836ae66445b1a02 100644 (file)
@@ -24,7 +24,7 @@ final class UnorderedMapModificationStrategy extends AbstractNodeContainerModifi
 
     UnorderedMapModificationStrategy(final ListSchemaNode schema, final TreeType treeType) {
         super(MapNode.class, treeType);
-        entryStrategy = Optional.<ModificationApplyOperation>of(new ListEntryModificationStrategy(schema, treeType));
+        entryStrategy = Optional.of(new ListEntryModificationStrategy(schema, treeType));
     }
 
     @SuppressWarnings("rawtypes")
index 3b436236040f90beda2ddbf2875e4b88bca2a224..50dab8e3a296e5a88fca19e277b71dd845a088d6 100644 (file)
@@ -75,7 +75,7 @@ public class XmlStreamUtilsTest {
         QName name = getAttrQName("namespace", "2012-12-12", "attr", Optional.of("prefix"));
         final Map.Entry<QName, String> attributeEntry = new AbstractMap.SimpleEntry<>(name, "value");
 
-        name = getAttrQName("namespace2", "2012-12-12", "attr", Optional.<String>absent());
+        name = getAttrQName("namespace2", "2012-12-12", "attr", Optional.absent());
         final Map.Entry<QName, String> attributeEntryNoPrefix = new AbstractMap.SimpleEntry<>(name, "value");
 
         final RandomPrefix randomPrefix = new RandomPrefix();
index 77a2a80ba0c4e8912b310435500b574ab4924dd5..457ea4315d09f30b20bcab2fc9a8bb98b5f31385 100644 (file)
@@ -74,7 +74,7 @@ public class XmlStreamUtilsTest {
         QName name = getAttrQName("namespace", "2012-12-12", "attr", Optional.of("prefix"));
         final Map.Entry<QName, String> attributeEntry = new AbstractMap.SimpleEntry<>(name, "value");
 
-        name = getAttrQName("namespace2", "2012-12-12", "attr", Optional.<String> absent());
+        name = getAttrQName("namespace2", "2012-12-12", "attr", Optional.absent());
         final Map.Entry<QName, String> attributeEntryNoPrefix = new AbstractMap.SimpleEntry<>(name, "value");
 
         final RandomPrefix randomPrefix = new RandomPrefix();
index 2e13a4fe0ece31f9b5cfb070c406e4c00f16b085..e5080965113684e75e428252f16e2339632c0e63 100644 (file)
@@ -259,7 +259,7 @@ public class DataTreeCandidateValidatorTest {
 
     private static void writeIntoMapEntry() {
 
-        final Map<QName, Object> keys = new HashMap<QName, Object>();
+        final Map<QName, Object> keys = new HashMap<>();
         keys.put(name, "New Project");
         final NodeIdentifierWithPredicates mapEntryPath = new NodeIdentifierWithPredicates(
                 project, keys);
@@ -305,7 +305,7 @@ public class DataTreeCandidateValidatorTest {
 
     private static void writeMapEntry() {
 
-        final Map<QName, Object> keys = new HashMap<QName, Object>();
+        final Map<QName, Object> keys = new HashMap<>();
         keys.put(name, "New Project");
         final NodeIdentifierWithPredicates mapEntryPath = new NodeIdentifierWithPredicates(
                 project, keys);
index 211a50b0a68c1a4418a410a7ce7dd025806875e2..c8368cafdf91613b4277ab2a50bcdf0fe24641a4 100644 (file)
@@ -259,7 +259,7 @@ public class DataTreeCandidateValidatorTest {
 
     private static void writeIntoMapEntry() {
 
-        final Map<QName, Object> keys = new HashMap<QName, Object>();
+        final Map<QName, Object> keys = new HashMap<>();
         keys.put(name, "New Project");
         final NodeIdentifierWithPredicates mapEntryPath = new NodeIdentifierWithPredicates(
                 project, keys);
@@ -306,7 +306,7 @@ public class DataTreeCandidateValidatorTest {
 
     private static void writeMapEntry() {
 
-        final Map<QName, Object> keys = new HashMap<QName, Object>();
+        final Map<QName, Object> keys = new HashMap<>();
         keys.put(name, "New Project");
         final NodeIdentifierWithPredicates mapEntryPath = new NodeIdentifierWithPredicates(
                 project, keys);
index b81b15428f1bd44b04c3074f40f6d82a89fdb160..76e7189d058a371c41f3f033da400a40ad9e250c 100644 (file)
@@ -106,7 +106,7 @@ public class BuilderTest {
     public void immutableOrderedMapBuilderTest() {
         final LinkedList<MapEntryNode> mapEntryNodeColl = new LinkedList();
         mapEntryNodeColl.add(LIST_MAIN_CHILD_3);
-        final Map<QName, Object> keys = new HashMap<QName, Object>();
+        final Map<QName, Object> keys = new HashMap<>();
         keys.put(LIST_MAIN_CHILD_QNAME_1, 1);
         final YangInstanceIdentifier.NodeIdentifierWithPredicates mapEntryPath = new YangInstanceIdentifier
                 .NodeIdentifierWithPredicates(LIST_MAIN, keys);
index 300076ecec35a5aa3d49bad955313bdfd97f7636..fe1b029aeb294d267c3f0c1141db9c18ecdd8a3b 100644 (file)
@@ -41,7 +41,7 @@ public class BitsCodecStringTest {
         assertTrue(serialized.contains("bar"));
 
         assertEquals("serialize", "",
-                codec.serialize(ImmutableSet.<String> of()));
+                codec.serialize(ImmutableSet.of()));
         assertEquals("serialize", "", codec.serialize(null));
     }
 
index df0dd758afec015306d16260e6dd7ea1950ee8ed..15d90515e84652ea65e005d455278ab301cb73eb 100644 (file)
@@ -58,7 +58,7 @@ public class TypeDefinitionAwareCodecTestHelper {
         }
 
         return EnumerationType.create( mock( SchemaPath.class ), enumList,
-                                       Optional.<EnumTypeDefinition.EnumPair>absent() );
+                                       Optional.absent() );
     }
 
     public static UnionTypeDefinition toUnionTypeDefinition( TypeDefinition<?>... types ) {
index 9446ff6b7bf394c6e6de88efa7f2d63e589553e1..5adaae675033b87d8a0a8e46bdde433e31d887da 100644 (file)
@@ -21,7 +21,7 @@ class UnorderedMapMixinContextNode extends AbstractMixinContextNode<NodeIdentifi
     public UnorderedMapMixinContextNode(final ListSchemaNode list) {
         super(NodeIdentifier.create(list.getQName()), list);
         this.innerNode = new ListItemContextNode(new NodeIdentifierWithPredicates(list.getQName(),
-                Collections.<QName, Object> emptyMap()), list);
+                Collections.emptyMap()), list);
     }
 
     @Override
index 528ea7e173e8b5efbd32c1ee78706eae5a50bdc5..b864611bb3bc0a9265a71cc522dc2199df56c163 100644 (file)
@@ -35,7 +35,7 @@ public class SchemaResolutionException extends SchemaSourceException {
     }
 
     public SchemaResolutionException(@Nonnull final String message, final Throwable cause) {
-        this(message, cause, Collections.<SourceIdentifier>emptySet(), ImmutableMultimap.<SourceIdentifier, ModuleImport>of());
+        this(message, cause, Collections.emptySet(), ImmutableMultimap.of());
     }
 
     public SchemaResolutionException(@Nonnull final String message, final Collection<SourceIdentifier> resolvedSources,
index f3122ebec06c7bd7e6f3c7fc29623b90a56f7de6..2deaab6dc4cf35bdb855a926b8eb0ae3cb838f46 100644 (file)
@@ -25,7 +25,7 @@ public interface SchemaSourceFilter {
      */
     SchemaSourceFilter ALWAYS_ACCEPT = new SchemaSourceFilter() {
         private final Iterable<Class<? extends SchemaSourceRepresentation>> representations =
-                Collections.<Class<? extends SchemaSourceRepresentation>>singletonList(SchemaSourceRepresentation.class);
+                Collections.singletonList(SchemaSourceRepresentation.class);
         private final ListenableFuture<Boolean> applyFuture = Futures.immediateFuture(Boolean.TRUE);
 
         @Override
index d1f8807a30adb2570d68bd310434bcf7a1605083..1c3783f98e5d362f674c59d0cdff57aaca5bbcfe 100644 (file)
@@ -33,7 +33,7 @@ public abstract class YangTextSchemaSource extends ByteSource implements YangSch
     public static SourceIdentifier identifierFromFilename(final String name) {
         checkArgument(name.endsWith(".yang"), "Filename %s does not have a .yang extension", name);
         // FIXME: add revision-awareness
-        return SourceIdentifier.create(name.substring(0, name.length() - 5), Optional.<String>absent());
+        return SourceIdentifier.create(name.substring(0, name.length() - 5), Optional.absent());
     }
 
     /**
index 3fea163af8670358799d6be46b41ac72b74f81d7..2afe45f81e8728b704d7fafae3f7f2607e941f94 100644 (file)
@@ -32,7 +32,7 @@ public abstract class YinTextSchemaSource extends ByteSource implements YinSchem
     public static SourceIdentifier identifierFromFilename(final String name) {
         checkArgument(name.endsWith(".yin"), "Filename %s does not have a .yin extension", name);
         // FIXME: add revision-awareness
-        return SourceIdentifier.create(name.substring(0, name.length() - 4), Optional.<String>absent());
+        return SourceIdentifier.create(name.substring(0, name.length() - 4), Optional.absent());
     }
 
     /**
index 1ce27d2ea8d98ee0d1b54f2e01ff7ffc32462214..546741aa9ce378fc434439d279e1458cba626a9e 100644 (file)
@@ -44,7 +44,7 @@ public class SimpleModuleTest {
     @Before
     public void init() {
         schemaRegistry = new SharedSchemaRepository("test");
-        fileSourceProvider = new FilesystemSchemaSourceCache<YangTextSchemaSource>(schemaRegistry,
+        fileSourceProvider = new FilesystemSchemaSourceCache<>(schemaRegistry,
                 YangTextSchemaSource.class, TEST_MODELS_FOLDER);
         final TextToASTTransformer astTransformer = TextToASTTransformer.create(schemaRegistry, schemaRegistry);
         schemaRegistry.registerSchemaSourceListener(astTransformer);
index bb6d1d4eb86ec71752ba472a68ae4631b69fcef2..ce8bdc784e7975ed6d3b03444f2aacd898c7d31b 100644 (file)
@@ -89,7 +89,7 @@ public abstract class AbstractSchemaRepository implements SchemaRepository, Sche
     public <T extends SchemaSourceRepresentation> CheckedFuture<T, SchemaSourceException> getSchemaSource(final SourceIdentifier id, final Class<T> representation) {
         final ListMultimap<Class<? extends SchemaSourceRepresentation>, AbstractSchemaSourceRegistration<?>> srcs = sources.get(id);
         if (srcs == null) {
-            return Futures.<T, SchemaSourceException>immediateFailedCheckedFuture(new MissingSchemaSourceException("No providers registered for source" + id, id));
+            return Futures.immediateFailedCheckedFuture(new MissingSchemaSourceException("No providers registered for source" + id, id));
         }
 
         // TODO, remove and make sources keep sorted multimap (e.g. ArrayListMultimap with SortedLists)
@@ -98,7 +98,7 @@ public abstract class AbstractSchemaRepository implements SchemaRepository, Sche
 
         final Iterator<AbstractSchemaSourceRegistration<?>> regs = sortedSchemaSourceRegistrations.iterator();
         if (!regs.hasNext()) {
-            return Futures.<T, SchemaSourceException>immediateFailedCheckedFuture(
+            return Futures.immediateFailedCheckedFuture(
                     new MissingSchemaSourceException("No providers for source " + id + " representation " + representation + " available", id));
         }
 
@@ -130,7 +130,7 @@ public abstract class AbstractSchemaRepository implements SchemaRepository, Sche
 
         m.put(source.getRepresentation(), reg);
 
-        final Collection<PotentialSchemaSource<?>> reps = Collections.<PotentialSchemaSource<?>>singleton(source);
+        final Collection<PotentialSchemaSource<?>> reps = Collections.singleton(source);
         for (SchemaListenerRegistration l : listeners) {
             l.getInstance().schemaSourceRegistered(reps);
         }
index 427a91ba2f2267eb6b49d27ab957518da6ef9108..0234cc7759f74bc84e0f65190834da0a32e6c300 100644 (file)
@@ -54,7 +54,7 @@ public final class FilesystemSchemaSourceCache<T extends SchemaSourceRepresentat
 
     // Init storage adapters
     private static final Map<Class<? extends SchemaSourceRepresentation>, StorageAdapter<? extends SchemaSourceRepresentation>> STORAGE_ADAPTERS =
-            Collections.<Class<? extends SchemaSourceRepresentation>, StorageAdapter<? extends SchemaSourceRepresentation>> singletonMap(
+            Collections.singletonMap(
                     YangTextSchemaSource.class, new YangTextSchemaStorageAdapter());
 
     private static final Pattern CACHED_FILE_PATTERN =
@@ -123,7 +123,7 @@ public final class FilesystemSchemaSourceCache<T extends SchemaSourceRepresentat
         }
 
         LOG.debug("Source {} not found in cache as {}", sourceIdentifier, file);
-        return Futures.<T, SchemaSourceException>immediateFailedCheckedFuture(new MissingSchemaSourceException("Source not found", sourceIdentifier));
+        return Futures.immediateFailedCheckedFuture(new MissingSchemaSourceException("Source not found", sourceIdentifier));
     }
 
     @Override
index 52a5a957ebf6d0fd55605a01778bb2d89fee15af..141cdb52bbe0c8a02806d1073d8aef6d099f090c 100644 (file)
@@ -28,7 +28,7 @@ import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceRegistry;
 
 @Beta
 public class InMemorySchemaSourceCache<T extends SchemaSourceRepresentation> extends AbstractSchemaSourceCache<T> implements AutoCloseable {
-    private final List<FinalizablePhantomReference<T>> regs = Collections.synchronizedList(new ArrayList<FinalizablePhantomReference<T>>());
+    private final List<FinalizablePhantomReference<T>> regs = Collections.synchronizedList(new ArrayList<>());
     private final FinalizableReferenceQueue queue = new FinalizableReferenceQueue();
     private final Cache<SourceIdentifier, T> cache;
 
@@ -54,7 +54,7 @@ public class InMemorySchemaSourceCache<T extends SchemaSourceRepresentation> ext
             return Futures.immediateCheckedFuture(present);
         }
 
-        return Futures.<T, SchemaSourceException>immediateFailedCheckedFuture(new MissingSchemaSourceException("Source not found", sourceIdentifier));
+        return Futures.immediateFailedCheckedFuture(new MissingSchemaSourceException("Source not found", sourceIdentifier));
     }
 
     @Override
index fa69b5354576d5bdf83aac1fa6a22695d5313ad6..28c4ab417f4603ab704087985ad05707fd20dfb2 100644 (file)
@@ -125,7 +125,7 @@ public abstract class AbstractSchemaContext implements SchemaContext {
     @Override
     public Set<Module> findModuleByNamespace(final URI namespace) {
         final Set<Module> ret = getNamespaceToModules().get(namespace);
-        return ret == null ? Collections.<Module>emptySet() : ret;
+        return ret == null ? Collections.emptySet() : ret;
     }
 
     @Override
index cfe3d8625f4e4719c32f89b8a6c3929c8e9916a9..a6087d06aa6ef08c40b1a4508fde2ea14947ebd3 100644 (file)
@@ -134,7 +134,7 @@ public final class BaseTypes {
      */
     @Deprecated
     public static Optional<TypeDefinition<?>> defaultBaseTypeFor(final String typeName) {
-        return Optional.<TypeDefinition<?>> fromNullable(defaultBaseTypeForImpl(typeName));
+        return Optional.fromNullable(defaultBaseTypeForImpl(typeName));
     }
 
     @Deprecated
index b507099d6453c9223d1aea0260624812c9465096..728f52d4580c906e86101a65c4c03dd3e3c30e45 100644 (file)
@@ -64,8 +64,8 @@ public final class FilteringSchemaContextProxy extends AbstractSchemaContext {
 
         final Builder<Module> filteredModulesBuilder = new Builder<>();
 
-        final SetMultimap<URI, Module> nsMap = Multimaps.newSetMultimap(new TreeMap<URI, Collection<Module>>(), MODULE_SET_SUPPLIER);
-        final SetMultimap<String, Module> nameMap = Multimaps.newSetMultimap(new TreeMap<String, Collection<Module>>(), MODULE_SET_SUPPLIER);
+        final SetMultimap<URI, Module> nsMap = Multimaps.newSetMultimap(new TreeMap<>(), MODULE_SET_SUPPLIER);
+        final SetMultimap<String, Module> nameMap = Multimaps.newSetMultimap(new TreeMap<>(), MODULE_SET_SUPPLIER);
 
         ImmutableMap.Builder<ModuleIdentifier, String> identifiersToSourcesBuilder = ImmutableMap.builder();
 
index 2b7d5dc83b15ffecf400b6568fca3e2b96ced28a..b10633a2ea20e8d503fd886e92fe7dbad4335a61 100644 (file)
@@ -470,7 +470,7 @@ public final class SchemaContextUtil {
         Preconditions.checkArgument(parentModule != null, "Parent Module reference cannot be NULL");
         Preconditions.checkArgument(xpath != null, "XPath string reference cannot be NULL");
 
-        final List<QName> path = new LinkedList<QName>();
+        final List<QName> path = new LinkedList<>();
         for (final String pathComponent : SLASH_SPLITTER.split(xpath)) {
             if (!pathComponent.isEmpty()) {
                 path.add(stringPathPartToQName(context, parentModule, pathComponent));
index a9d171ca2c98b932d6786d6aab6b514c3695b006..237fa5e6b048ca96cea766e18325430775473a6e 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 
 abstract class AbstractBaseType<T extends TypeDefinition<T>> extends AbstractTypeDefinition<T> {
     AbstractBaseType(final QName qname) {
-        this(SchemaPath.create(true, qname), ImmutableList.<UnknownSchemaNode>of());
+        this(SchemaPath.create(true, qname), ImmutableList.of());
     }
 
     AbstractBaseType(final SchemaPath path, final List<UnknownSchemaNode> unknownSchemaNodes) {
index 30bff700cdee49615498a6977740cf2a62612523..4ab19cbb2ae041d30dc2bfbdcc2f8327183266c5 100644 (file)
@@ -22,8 +22,8 @@ abstract class AbstractRangedBaseType<T extends TypeDefinition<T>> extends Abstr
 
     AbstractRangedBaseType(final QName qname, final Number minValue, final Number maxValue) {
         super(qname);
-        this.rangeConstraints = ImmutableList.<RangeConstraint>of(BaseConstraints.newRangeConstraint(
-                minValue, maxValue, Optional.<String>absent(), Optional.<String>absent()));
+        this.rangeConstraints = ImmutableList.of(BaseConstraints.newRangeConstraint(
+                minValue, maxValue, Optional.absent(), Optional.absent()));
     }
 
     AbstractRangedBaseType(final SchemaPath path, final List<UnknownSchemaNode> unknownSchemaNodes,
index 7520da92598ed4b4484d18db6284756b6a1dec39..cdbc403f9563aaf76ca477abbc5669d9b77f4ec8 100644 (file)
@@ -45,7 +45,7 @@ final class BaseDecimalType extends AbstractRangedBaseType<DecimalTypeDefinition
 
     private static List<RangeConstraint> createRangeConstraint(final String min, final String max) {
         return ImmutableList.of(BaseConstraints.newRangeConstraint(new BigDecimal(min), new BigDecimal(max),
-            Optional.<String>absent(), Optional.of("https://tools.ietf.org/html/rfc6020#section-9.3.4")));
+            Optional.absent(), Optional.of("https://tools.ietf.org/html/rfc6020#section-9.3.4")));
     }
 
     static List<RangeConstraint> constraintsForDigits(final int fractionDigits) {
index 26c88398edffd29daadb09ec4c25ecb4977e0ff8..dcf11c5bafcfeb6a9948c2982e10d5e37e7ce651 100644 (file)
@@ -19,5 +19,5 @@ final class JavaLengthConstraints {
     }
 
     static final List<LengthConstraint> INTEGER_SIZE_CONSTRAINTS = ImmutableList.of(
-        BaseConstraints.newLengthConstraint(0, Integer.MAX_VALUE, Optional.<String>absent(), Optional.<String>absent()));
+        BaseConstraints.newLengthConstraint(0, Integer.MAX_VALUE, Optional.absent(), Optional.absent()));
 }
index 05c4127e5eeadf0d4d4e68ab2b782b6f6dae1a07..20a43df62d2966c811229dd637ccfd23235a10a1 100644 (file)
@@ -49,8 +49,9 @@ public class SchemaSourceTransformerTest {
 
     @Test
     public void schemaSourceTransformerTest() {
-        this.schema = new SchemaSourceTransformer<YangSchemaSourceRepresentation, YinXmlSchemaSource>(
-                this.provider, SchemaSourceTransformerTest.SRC_CLASS, this.consumer, SchemaSourceTransformerTest.DST_CLASS, this.function);
+        this.schema = new SchemaSourceTransformer<>(
+                this.provider, SchemaSourceTransformerTest.SRC_CLASS, this.consumer,
+                SchemaSourceTransformerTest.DST_CLASS, this.function);
         Assert.assertNotNull(this.schema);
     }
 
@@ -60,7 +61,7 @@ public class SchemaSourceTransformerTest {
         final Registrator reg = new Registrator(p, SchemaSourceTransformerTest.SRC_CLASS, PotentialSchemaSource.Costs.IMMEDIATE);
         final SourceIdentifier sourceIdentifier = new SourceIdentifier("source");
         reg.register(sourceIdentifier);
-        this.schema = new SchemaSourceTransformer<YangSchemaSourceRepresentation, YinXmlSchemaSource>(p,
+        this.schema = new SchemaSourceTransformer<>(p,
                 SchemaSourceTransformerTest.SRC_CLASS, this.consumer, SchemaSourceTransformerTest.DST_CLASS,
                 this.function);
         final SchemaSourceProvider<YinXmlSchemaSource> provider = this.schema;
@@ -83,7 +84,7 @@ public class SchemaSourceTransformerTest {
         reg.register(sourceIdentifier);
 
         final Consumer c = new Consumer();
-        this.schema = new SchemaSourceTransformer<YangSchemaSourceRepresentation, YinXmlSchemaSource>(p,
+        this.schema = new SchemaSourceTransformer<>(p,
                 SchemaSourceTransformerTest.SRC_CLASS, c, SchemaSourceTransformerTest.DST_CLASS, this.function);
 
         final SchemaSourceListener listener = this.schema;
index 839f1e72ba8e63a602c565bdbae59499e2ea446e..20c7b37d497b897b421869a5a01a967d7d459815 100644 (file)
@@ -48,7 +48,7 @@ public class MustDefinitionImplTest {
         assertFalse("mdiA shouldn't equal to mdiB", mdiA.equals(mdiB));
 
         // //description
-        mdiA = MustDefinitionImpl.create("mustStr", Optional.<String>absent(), reference, errorAppTag, errorMessage);
+        mdiA = MustDefinitionImpl.create("mustStr", Optional.absent(), reference, errorAppTag, errorMessage);
         mdiB = MustDefinitionImpl.create("mustStr", description, reference, errorAppTag, errorMessage);
         assertFalse("mdiA shouldn't equal to mdiB", mdiA.equals(mdiB));
 
@@ -57,7 +57,7 @@ public class MustDefinitionImplTest {
         assertFalse("mdiA shouldn't equal to mdiB", mdiA.equals(mdiB));
 
         // //reference
-        mdiA = MustDefinitionImpl.create("mustStr", description, Optional.<String>absent(), errorAppTag, errorMessage);
+        mdiA = MustDefinitionImpl.create("mustStr", description, Optional.absent(), errorAppTag, errorMessage);
         mdiB = MustDefinitionImpl.create("mustStr", description, reference, errorAppTag, errorMessage);
         assertFalse("mdiA shouldn't equal to mdiB", mdiA.equals(mdiB));
 
index 792db8d9c84b8a1a677df8511343fa097565845b..b8f9e7e1df6fe80013062f42a3faba831ca40cf9 100644 (file)
@@ -625,7 +625,7 @@ public final class BuilderUtils {
         Set<NotificationBuilder> notifications = module.getAddedNotifications();
         for (NotificationBuilder notification : notifications) {
             if (notification.getQName().equals(child)) {
-                return Optional.<SchemaNodeBuilder> of(notification);
+                return Optional.of(notification);
             }
         }
 
@@ -635,7 +635,7 @@ public final class BuilderUtils {
         Set<RpcDefinitionBuilder> rpcs = module.getAddedRpcs();
         for (RpcDefinitionBuilder rpc : rpcs) {
             if (rpc.getQName().equals(child)) {
-                return Optional.<SchemaNodeBuilder> of(rpc);
+                return Optional.of(rpc);
             }
         }
         LOG.trace("Child {} not found in data namespace of module {}", child, module);
@@ -645,7 +645,7 @@ public final class BuilderUtils {
     private static Optional<SchemaNodeBuilder> getDataChildByQName(final DataNodeContainerBuilder builder, final QName child) {
         for (DataSchemaNodeBuilder childNode : builder.getChildNodeBuilders()) {
             if (childNode.getQName().equals(child)) {
-                return Optional.<SchemaNodeBuilder> of(childNode);
+                return Optional.of(childNode);
             }
         }
         LOG.trace(CHILD_NOT_FOUND_IN_NODE_STR, child, builder);
index 03c1341184a34d52f74aec1b6c74b5d2137c8827..9b6fb50059c9b8a02a8b72d5ab6264b22f795110 100644 (file)
@@ -74,7 +74,7 @@ public final class ChoiceBuilder extends AbstractSchemaNodeBuilder implements Da
         configuration = base.isConfiguration();
         augmentations.addAll(base.getAvailableAugmentations());
 
-        Set<DataSchemaNodeBuilder> wrapped = BuilderUtils.wrapChildNodes(moduleName, line, new HashSet<DataSchemaNode>(
+        Set<DataSchemaNodeBuilder> wrapped = BuilderUtils.wrapChildNodes(moduleName, line, new HashSet<>(
                 base.getCases()), path, qname);
         for (DataSchemaNodeBuilder wrap : wrapped) {
             if (wrap instanceof ChoiceCaseBuilder) {
index 79e992028dc52f7e2ee3f299393f9b9e7e9c7f19..e7808dc37db17d26727c6470357e5f952e8e455b 100644 (file)
@@ -72,7 +72,7 @@ public class ModuleBuilder extends AbstractDocumentedDataNodeContainerBuilder im
     private ModuleImpl instance;
     private final String name;
     private final String sourcePath;
-    private static final SchemaPath SCHEMA_PATH = SchemaPath.create(Collections.<QName> emptyList(), true);
+    private static final SchemaPath SCHEMA_PATH = SchemaPath.create(Collections.emptyList(), true);
     private String prefix;
     private QNameModule qnameModule = EMPTY_QNAME_MODULE;
 
index a17dc56f1fc3daba303661f0c51f9305bbca9ed4..e6abb121b3fa5c26be6e6087e3a5a215f928a5e5 100644 (file)
@@ -74,8 +74,8 @@ public final class ModuleImpl extends AbstractDocumentedDataNodeContainer implem
         super(builder);
         this.name = checkNotNull(name, "Missing name");
         this.sourcePath = sourcePath; //TODO: can this be nullable?
-        this.imports = ImmutableSet.<ModuleImport> copyOf(builder.imports.values());
-        this.submodules = ImmutableSet.<Module> copyOf(builder.submodules);
+        this.imports = ImmutableSet.copyOf(builder.imports.values());
+        this.submodules = ImmutableSet.copyOf(builder.submodules);
         this.prefix = builder.getPrefix();
 
         this.qnameModule = QNameModule.create(builder.getNamespace(),
index 44b83477f63531540ba41092e72c5639b73473b4..2cdf33ae2690dee1d378204410dab8d85882f382 100644 (file)
@@ -531,7 +531,7 @@ public final class ParserListenerUtils {
      */
     public static Set<String> createListKey(final Key_stmtContext ctx) {
         final String keyDefinition = stringFromNode(ctx);
-        return Sets.<String>newLinkedHashSet(KEYDEF_SPLITTER.split(keyDefinition));
+        return Sets.newLinkedHashSet(KEYDEF_SPLITTER.split(keyDefinition));
     }
 
     /**
@@ -1466,7 +1466,7 @@ public final class ParserListenerUtils {
             baseType = uintType;
         } else if ("enumeration".equals(typeName)) {
             List<EnumTypeDefinition.EnumPair> enumConstants = getEnumConstants(typeBody, actualPath, moduleName);
-            return EnumerationType.create(baseTypePath, enumConstants, Optional.<EnumPair> absent());
+            return EnumerationType.create(baseTypePath, enumConstants, Optional.absent());
         } else if ("string".equals(typeName)) {
             StringTypeDefinition stringType = StringType.getInstance();
             constraints.addLengths(stringType.getLengthConstraints());
index 652011a2250d681bc0e81b22650dd143a93a021d..c5e87a1053069fff018a7fb5cda871a05e622e17 100644 (file)
@@ -49,9 +49,9 @@ final class SchemaContextImpl extends AbstractSchemaContext {
          * Invest some quality time in building up lookup tables for both.
          */
         final SetMultimap<URI, Module> nsMap = Multimaps.newSetMultimap(
-                new TreeMap<URI, Collection<Module>>(), MODULE_SET_SUPPLIER);
+                new TreeMap<>(), MODULE_SET_SUPPLIER);
         final SetMultimap<String, Module> nameMap = Multimaps.newSetMultimap(
-                new TreeMap<String, Collection<Module>>(), MODULE_SET_SUPPLIER);
+                new TreeMap<>(), MODULE_SET_SUPPLIER);
 
         for (Module m : modules) {
             nameMap.put(m.getName(), m);
index b25986d34db17c3b1fb089c331f525b9df9bc54c..c8e88c4dfa2d94fbf93904c54d2d8c56e7b6815b 100644 (file)
@@ -181,7 +181,7 @@ public final class YangParserImpl implements YangContextParser {
     public SchemaContext parseFiles(final Collection<File> yangFiles, final SchemaContext context) throws IOException,
     YangSyntaxErrorException {
         if (yangFiles == null) {
-            return resolveSchemaContext(Collections.<Module> emptySet());
+            return resolveSchemaContext(Collections.emptySet());
         }
 
         Collection<ByteSource> sources = BuilderUtils.filesToByteSources(yangFiles);
@@ -219,7 +219,7 @@ public final class YangParserImpl implements YangContextParser {
     public SchemaContext parseSources(final Collection<ByteSource> sources, final SchemaContext context)
             throws IOException, YangSyntaxErrorException {
         if (sources == null) {
-            return resolveSchemaContext(Collections.<Module> emptySet());
+            return resolveSchemaContext(Collections.emptySet());
         }
 
         final List<ModuleBuilder> sorted = resolveModuleBuilders(sources, context);
@@ -961,7 +961,7 @@ public final class YangParserImpl implements YangContextParser {
             // Conflicting elements in other namespaces are still not present
             // since resolveUsesAugment occurs before augmenting from external
             // modules.
-            potentialTargetNode = Optional.<SchemaNodeBuilder> fromNullable(findTargetNode(augment.getTargetPath()
+            potentialTargetNode = Optional.fromNullable(findTargetNode(augment.getTargetPath()
                     .getPathFromRoot(), parentNode));
         }
 
index a96ac87991df986fc10a1d792697594d8baa4fa1..affa642e43db3f0dcfcc4628e79dee119bde33c0 100644 (file)
@@ -142,7 +142,7 @@ final class DependencyResolver {
 
             return new DependencyResolver(resolved, pending, imports);
         } else {
-            return new DependencyResolver(resolved, Collections.<SourceIdentifier>emptyList(), ImmutableMultimap.<SourceIdentifier, ModuleImport>of());
+            return new DependencyResolver(resolved, Collections.emptyList(), ImmutableMultimap.of());
         }
     }
 
index 9b5fb1ee916cbd0f9576a58c4c3b81a283084c6b..3a79452e7ad7ce67bd0b79071362c117283b360f 100644 (file)
@@ -54,7 +54,7 @@ public final class YangTextSchemaContextResolver implements AutoCloseable, Schem
     private final Collection<SourceIdentifier> requiredSources = new ConcurrentLinkedDeque<>();
     private final Multimap<SourceIdentifier, YangTextSchemaSource> texts = ArrayListMultimap.create();
     private final AtomicReference<Optional<SchemaContext>> currentSchemaContext =
-            new AtomicReference<>(Optional.<SchemaContext>absent());
+            new AtomicReference<>(Optional.absent());
     private final InMemorySchemaSourceCache<ASTSchemaSource> cache;
     private final SchemaListenerRegistration transReg;
     private final SchemaSourceRegistry registry;
@@ -159,7 +159,7 @@ public final class YangTextSchemaContextResolver implements AutoCloseable, Schem
     public YangTextSchemaSourceRegistration registerSource(@Nonnull final URL url) throws SchemaSourceException, IOException, YangSyntaxErrorException {
         checkArgument(url != null, "Supplied URL must not be null");
 
-        final SourceIdentifier guessedId = new SourceIdentifier(url.getFile(), Optional.<String>absent());
+        final SourceIdentifier guessedId = new SourceIdentifier(url.getFile(), Optional.absent());
         return registerSource(new YangTextSchemaSource(guessedId) {
             @Override
             public InputStream openStream() throws IOException {
@@ -230,7 +230,7 @@ public final class YangTextSchemaContextResolver implements AutoCloseable, Schem
 
         LOG.debug("Lookup {} result {}", sourceIdentifier, ret);
         if (ret.isEmpty()) {
-            return Futures.<YangTextSchemaSource, SchemaSourceException>immediateFailedCheckedFuture(
+            return Futures.immediateFailedCheckedFuture(
                     new MissingSchemaSourceException("URL for " + sourceIdentifier + " not registered", sourceIdentifier));
         }
 
index f137faf6677280f75afacad1e806728e9fc935cd..08e723ecce63c70dc872675997e61c765d4c2606 100644 (file)
@@ -17,7 +17,7 @@ import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 
 public final class StatementSupportBundle implements Immutable,NamespaceBehaviour.Registry {
 
-    private static final StatementSupportBundle EMPTY = new StatementSupportBundle(null, ImmutableMap.<QName, StatementSupport<?, ?, ?>>of(), ImmutableMap.<Class<?>, NamespaceBehaviour<?, ?, ?>>of());
+    private static final StatementSupportBundle EMPTY = new StatementSupportBundle(null, ImmutableMap.of(), ImmutableMap.of());
 
     private final StatementSupportBundle parent;
     private final ImmutableMap<QName, StatementSupport<?,?,?>> definitions;
index 31ab8b381b47336ad19b68ec31dbc8cd229df115..296624567300c0c012fbb233b0b639dd04755566 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2015, 2016 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -102,7 +102,7 @@ class ModifierImpl implements ModelActionBuilder {
     private <K, C extends StmtContext<?,?,?>, N extends StatementNamespace<K, ?, ?>> AbstractPrerequisite<C> requiresCtxImpl(final StmtContext<?, ?, ?> context, final Class<N> namespace, final K key,final ModelProcessingPhase phase)  {
         checkNotRegistered();
         try {
-            AddedToNamespace<C> addedToNs = new AddedToNamespace<C>(phase);
+            AddedToNamespace<C> addedToNs = new AddedToNamespace<>(phase);
             addReq(addedToNs);
             contextImpl(context).onNamespaceItemAddedAction((Class) namespace,key,addedToNs);
             return addedToNs;
@@ -114,7 +114,7 @@ class ModifierImpl implements ModelActionBuilder {
     private <C extends StmtContext<?, ?, ?>> AbstractPrerequisite<C> requiresCtxImpl(final C context, final ModelProcessingPhase phase) {
         Preconditions.checkState(action == null, "Action was already registered.");
         try {
-            PhaseFinished<C> phaseFin = new PhaseFinished<C>();
+            PhaseFinished<C> phaseFin = new PhaseFinished<>();
             addReq(phaseFin);
             contextImpl(context).addPhaseCompletedListener(phase,phaseFin);
             return phaseFin;
@@ -127,7 +127,7 @@ class ModifierImpl implements ModelActionBuilder {
     private <K, C extends StmtContext.Mutable<?, ?, ?> , N extends IdentifierNamespace<K, ? extends StmtContext<?, ?, ?>>> AbstractPrerequisite<C> mutatesCtxImpl(
                 final StmtContext<?, ?, ?> context, final Class<N> namespace, final K key, final ModelProcessingPhase phase) {
             try {
-                PhaseModificationInNamespace<C> mod = new PhaseModificationInNamespace<C>(phase);
+                PhaseModificationInNamespace<C> mod = new PhaseModificationInNamespace<>(phase);
                 addReq(mod);
                 addMutation(mod);
                 contextImpl(context).onNamespaceItemAddedAction((Class) namespace,key,mod);
@@ -155,7 +155,7 @@ class ModifierImpl implements ModelActionBuilder {
     @Override
     public <C extends Mutable<?, ?, ?>, CT extends C> Prerequisite<C> mutatesCtx(final CT context, final ModelProcessingPhase phase) {
         try {
-            return addMutation(new PhaseMutation<C>(contextImpl(context),phase));
+            return addMutation(new PhaseMutation<>(contextImpl(context), phase));
         } catch (InferenceException e) {
             throw shouldNotHappenProbablyBug(e);
         }
@@ -174,7 +174,7 @@ class ModifierImpl implements ModelActionBuilder {
 
     @Override
     public <D extends DeclaredStatement<?>> Prerequisite<D> requiresDeclared(final StmtContext<?, ? extends D, ?> context) {
-        return requiresCtxImpl(context, FULL_DECLARATION).transform(StmtContextUtils.<D>buildDeclared());
+        return requiresCtxImpl(context, FULL_DECLARATION).transform(StmtContextUtils.buildDeclared());
     }
 
     @Override
@@ -187,12 +187,12 @@ class ModifierImpl implements ModelActionBuilder {
     public <K, D extends DeclaredStatement<?>, N extends StatementNamespace<K, ? extends D, ?>> Prerequisite<D> requiresDeclared(
             final StmtContext<?, ?, ?> context, final Class<N> namespace, final K key) {
         final AbstractPrerequisite<StmtContext<?,D,?>> rawContext = requiresCtxImpl(context, namespace, key, FULL_DECLARATION);
-        return rawContext.transform(StmtContextUtils.<D>buildDeclared());
+        return rawContext.transform(StmtContextUtils.buildDeclared());
     }
 
     @Override
     public <E extends EffectiveStatement<?, ?>> Prerequisite<E> requiresEffective(final StmtContext<?, ?, ? extends E> stmt) {
-        return requiresCtxImpl(stmt, EFFECTIVE_MODEL).transform(StmtContextUtils.<E>buildEffective());
+        return requiresCtxImpl(stmt, EFFECTIVE_MODEL).transform(StmtContextUtils.buildEffective());
     }
 
     @Override
@@ -205,7 +205,7 @@ class ModifierImpl implements ModelActionBuilder {
     public <K, E extends EffectiveStatement<?, ?>, N extends StatementNamespace<K, ?, ? extends E>> Prerequisite<E> requiresEffective(
             final StmtContext<?, ?, ?> context, final Class<N> namespace, final K key) {
         final AbstractPrerequisite<StmtContext<?,?,E>> rawContext = requiresCtxImpl(context, namespace, key, EFFECTIVE_MODEL);
-        return rawContext.transform(StmtContextUtils.<E>buildEffective());
+        return rawContext.transform(StmtContextUtils.buildEffective());
     }
 
 
@@ -213,7 +213,7 @@ class ModifierImpl implements ModelActionBuilder {
     public <N extends IdentifierNamespace<?, ?>> Prerequisite<Mutable<?, ?, ?>> mutatesNs(final Mutable<?, ?, ?> context,
             final Class<N> namespace) {
         try {
-            return addMutation(new NamespaceMutation<N>(contextImpl(context),namespace));
+            return addMutation(new NamespaceMutation<>(contextImpl(context), namespace));
         } catch (SourceException e) {
             throw shouldNotHappenProbablyBug(e);
         }
index 0b5cb9a0952d9fccb43109d75edf5c2a6707a8f0..bff6225ae3a4b1ae6902ed48747f9cf7282ca329 100644 (file)
@@ -99,7 +99,7 @@ public class BelongsToStatementImpl extends AbstractDeclaredStatement<String>
         private static ModuleIdentifier getModuleIdentifier(
                 final StmtContext.Mutable<String, BelongsToStatement, EffectiveStatement<String, BelongsToStatement>> belongsToCtx) {
             String moduleName = belongsToCtx.getStatementArgument();
-            return new ModuleIdentifierImpl(moduleName, Optional.<URI> absent(),
+            return new ModuleIdentifierImpl(moduleName, Optional.absent(),
                 Optional.of(SimpleDateFormatUtil.DEFAULT_BELONGS_TO_DATE));
         }
 
index 6bf310158fc9a866697310dada0ce70bca48d082..fc28e13d1178e79c4672bb03b84205044a5c58df 100644 (file)
@@ -144,8 +144,8 @@ public class ImportStatementDefinition
             revision = SimpleDateFormatUtil.DEFAULT_DATE_IMP;
         }
 
-        return new ModuleIdentifierImpl(stmt.getStatementArgument(), Optional.<URI> absent(),
-                Optional.<Date> of(revision));
+        return new ModuleIdentifierImpl(stmt.getStatementArgument(), Optional.absent(),
+                Optional.of(revision));
     }
 
 }
\ No newline at end of file
index ea7b3db9869e3b25f12697b575fa89143a5257b0..8e44c5cbe1427190caddc221c779976e588ff02a 100644 (file)
@@ -103,7 +103,7 @@ public class IncludeStatementImpl extends AbstractDeclaredStatement<String> impl
                 revisionDate = SimpleDateFormatUtil.DEFAULT_DATE_IMP;
             }
 
-            return new ModuleIdentifierImpl(subModuleName, Optional.<URI> absent(), Optional.<Date> of(revisionDate));
+            return new ModuleIdentifierImpl(subModuleName, Optional.absent(), Optional.of(revisionDate));
         }
 
         @Override
index 4044d5ebad25d3b7a9a5299d5ee82641f52583bd..1f3722c9f4bc5f6e2ebcf1343fbf6cfa1205fa73 100644 (file)
@@ -104,7 +104,7 @@ public class ModuleStatementSupport extends
 
         QNameModule qNameModule = QNameModule.create(moduleNs.get(), revisionDate.orNull()).intern();
         ModuleIdentifier moduleIdentifier = new ModuleIdentifierImpl(stmt.getStatementArgument(),
-                Optional.<URI> absent(), revisionDate);
+                Optional.absent(), revisionDate);
 
         stmt.addContext(ModuleNamespace.class, moduleIdentifier, stmt);
         stmt.addContext(ModuleNamespaceForBelongsTo.class, moduleIdentifier.getName(), stmt);
index 2a4ab6c9c4402caebc1f85540afad1b630935dfb..8e43278b36c3c131fbf90ffaf6e2ddc1143c9ecd 100644 (file)
@@ -60,7 +60,7 @@ public class PatternStatementImpl extends AbstractDeclaredStatement<PatternConst
                 return null;
             }
 
-            return new PatternConstraintEffectiveImpl(pattern, Optional.<String>absent(), Optional.<String>absent());
+            return new PatternConstraintEffectiveImpl(pattern, Optional.absent(), Optional.absent());
         }
 
         @Override
index ec614c79521b0088ad637aeb014ca58092e659ae..e86c7851874f3bf1d41c9b586e2b6374cc1473a9 100644 (file)
@@ -98,7 +98,7 @@ public class SubmoduleStatementImpl extends AbstractRootStatement<SubmoduleState
                 Utils.getLatestRevision(stmt.declaredSubstatements())).or(DEFAULT_REVISION);
 
             ModuleIdentifier submoduleIdentifier = new ModuleIdentifierImpl(stmt.getStatementArgument(),
-                Optional.<URI> absent(), revisionDate);
+                Optional.absent(), revisionDate);
 
             stmt.addContext(SubmoduleNamespace.class, submoduleIdentifier, stmt);
 
index 4e70719be12d7300850b936611d1b5767da29f9b..3c7ec211f70248d5abc6ea6a8d55429533eb4ad9 100644 (file)
@@ -20,7 +20,7 @@ public final class YangValidationBundles {
         throw new UnsupportedOperationException("Utility class");
     }
 
-    public static final Set<StatementDefinition> SUPPORTED_REFINE_SUBSTATEMENTS = ImmutableSet.<StatementDefinition>of(
+    public static final Set<StatementDefinition> SUPPORTED_REFINE_SUBSTATEMENTS = ImmutableSet.of(
         Rfc6020Mapping.DEFAULT, Rfc6020Mapping.DESCRIPTION, Rfc6020Mapping.REFERENCE, Rfc6020Mapping.CONFIG,
         Rfc6020Mapping.MANDATORY, Rfc6020Mapping.MUST, Rfc6020Mapping.PRESENCE, Rfc6020Mapping.MIN_ELEMENTS,
         Rfc6020Mapping.MAX_ELEMENTS);
@@ -28,30 +28,30 @@ public final class YangValidationBundles {
     public static final Map<StatementDefinition, Set<StatementDefinition>> SUPPORTED_REFINE_TARGETS;
     static {
         final Builder<StatementDefinition, Set<StatementDefinition>> b = ImmutableMap.builder();
-        b.put(Rfc6020Mapping.DEFAULT, ImmutableSet.<StatementDefinition>of(Rfc6020Mapping.LEAF, Rfc6020Mapping.CHOICE));
-        b.put(Rfc6020Mapping.MANDATORY, ImmutableSet.<StatementDefinition>of(
+        b.put(Rfc6020Mapping.DEFAULT, ImmutableSet.of(Rfc6020Mapping.LEAF, Rfc6020Mapping.CHOICE));
+        b.put(Rfc6020Mapping.MANDATORY, ImmutableSet.of(
                 Rfc6020Mapping.LEAF, Rfc6020Mapping.CHOICE, Rfc6020Mapping.ANYXML));
-        b.put(Rfc6020Mapping.PRESENCE, ImmutableSet.<StatementDefinition>of(Rfc6020Mapping.CONTAINER));
-        b.put(Rfc6020Mapping.MUST, ImmutableSet.<StatementDefinition>of(
+        b.put(Rfc6020Mapping.PRESENCE, ImmutableSet.of(Rfc6020Mapping.CONTAINER));
+        b.put(Rfc6020Mapping.MUST, ImmutableSet.of(
                 Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF,
                 Rfc6020Mapping.LEAF_LIST, Rfc6020Mapping.ANYXML));
-        b.put(Rfc6020Mapping.MIN_ELEMENTS, ImmutableSet.<StatementDefinition>of(
+        b.put(Rfc6020Mapping.MIN_ELEMENTS, ImmutableSet.of(
                 Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF_LIST));
-        b.put(Rfc6020Mapping.MAX_ELEMENTS, ImmutableSet.<StatementDefinition>of(
+        b.put(Rfc6020Mapping.MAX_ELEMENTS, ImmutableSet.of(
                 Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF_LIST));
         SUPPORTED_REFINE_TARGETS = b.build();
     }
 
 
-    public static final Set<StatementDefinition> SUPPORTED_AUGMENT_TARGETS = ImmutableSet.<StatementDefinition>of(
+    public static final Set<StatementDefinition> SUPPORTED_AUGMENT_TARGETS = ImmutableSet.of(
         Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.CASE, Rfc6020Mapping.INPUT, Rfc6020Mapping.OUTPUT,
         Rfc6020Mapping.NOTIFICATION, Rfc6020Mapping.CHOICE, Rfc6020Mapping.RPC);
 
-    public static final Set<StatementDefinition> SUPPORTED_CASE_SHORTHANDS = ImmutableSet.<StatementDefinition>of(
+    public static final Set<StatementDefinition> SUPPORTED_CASE_SHORTHANDS = ImmutableSet.of(
         Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF, Rfc6020Mapping.LEAF_LIST,
         Rfc6020Mapping.ANYXML);
 
-    public static final Set<StatementDefinition> SUPPORTED_DATA_NODES = ImmutableSet.<StatementDefinition>of(
+    public static final Set<StatementDefinition> SUPPORTED_DATA_NODES = ImmutableSet.of(
         Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF, Rfc6020Mapping.LEAF_LIST,
         Rfc6020Mapping.ANYXML);
 }
index 9ec3d8c71d70dd6d5f7b3865e10266f39af6d811..0a57e04c318e2a76630c705d9bd57b92cc18fccd 100644 (file)
@@ -124,7 +124,7 @@ abstract class AbstractEffectiveSchemaContext implements SchemaContext {
     @Override
     public Set<Module> findModuleByNamespace(final URI namespace) {
         final Set<Module> ret = getNamespaceToModules().get(namespace);
-        return ret == null ? Collections.<Module> emptySet() : ret;
+        return ret == null ? Collections.emptySet() : ret;
     }
 
     @Override
index c76b86f82809415f99e632ddbc5798d118c2c9a0..f9604c8216de22d98bb21df36da3c6be17211fc2 100644 (file)
@@ -57,9 +57,9 @@ public final class EffectiveSchemaContext extends AbstractEffectiveSchemaContext
         this.modules = ImmutableSet.copyOf(sortedModuleList);
 
         final SetMultimap<URI, Module> nsMap = Multimaps.newSetMultimap(
-                new TreeMap<URI, Collection<Module>>(), MODULE_SET_SUPPLIER);
+                new TreeMap<>(), MODULE_SET_SUPPLIER);
         final SetMultimap<String, Module> nameMap = Multimaps.newSetMultimap(
-                new TreeMap<String, Collection<Module>>(), MODULE_SET_SUPPLIER);
+                new TreeMap<>(), MODULE_SET_SUPPLIER);
         Set<ModuleIdentifier> modIdBuilder = new HashSet<>();
         for (Module m : modulesInit) {
             nameMap.put(m.getName(), m);
@@ -89,9 +89,9 @@ public final class EffectiveSchemaContext extends AbstractEffectiveSchemaContext
          * Invest some quality time in building up lookup tables for both.
          */
         final SetMultimap<URI, Module> nsMap = Multimaps.newSetMultimap(
-                new TreeMap<URI, Collection<Module>>(), MODULE_SET_SUPPLIER);
+                new TreeMap<>(), MODULE_SET_SUPPLIER);
         final SetMultimap<String, Module> nameMap = Multimaps.newSetMultimap(
-                new TreeMap<String, Collection<Module>>(), MODULE_SET_SUPPLIER);
+                new TreeMap<>(), MODULE_SET_SUPPLIER);
 
         Set<ModuleIdentifier> modIdBuilder = new HashSet<>();
         for (Module m : modules) {
index d6ae604622fce7146563168b774f349bfdc2cf7b..610a69dfeda1ae010f5327f57bb0e6627fb64bf9 100644 (file)
@@ -30,7 +30,7 @@ public final class IdentityEffectiveStatementImpl extends AbstractEffectiveSchem
         super(ctx);
 
         // initDerivedIdentities
-        Set<IdentitySchemaNode> derivedIdentitiesInit = new HashSet<IdentitySchemaNode>();
+        Set<IdentitySchemaNode> derivedIdentitiesInit = new HashSet<>();
         List<StmtContext<?, ?, ?>> derivedIdentitiesCtxList = ctx.getFromNamespace(
                 DerivedIdentitiesNamespace.class, ctx.getStatementArgument());
         if (derivedIdentitiesCtxList == null) {
index c34a8f421824dc494aa3b08e330fcc134618960a..b74b9fcf696e8560c7f4329084f5411f207fdd79 100644 (file)
@@ -94,7 +94,7 @@ public final class ModuleDependencySort {
     @Deprecated
     public static List<ModuleBuilder> sort(final Collection<ModuleBuilder> builders) {
         List<TopologicalSort.Node> sorted = sortInternal(ModuleOrModuleBuilder.fromAll(
-                Collections.<Module>emptySet(),builders));
+                Collections.emptySet(),builders));
         return Lists.transform(sorted, NODE_TO_MODULEBUILDER);
     }
 
@@ -129,7 +129,7 @@ public final class ModuleDependencySort {
      */
     public static List<Module> sort(final Module... modules) {
         List<TopologicalSort.Node> sorted = sortInternal(ModuleOrModuleBuilder.fromAll(asList(modules),
-                Collections.<ModuleBuilder>emptyList()));
+                Collections.emptyList()));
         // Cast to Module from Node and return
         return Lists.transform(sorted, TOPOLOGY_FUNCTION);
     }
@@ -300,7 +300,7 @@ public final class ModuleDependencySort {
             }
 
             if (moduleGraph.get(name) == null) {
-                moduleGraph.put(name, Maps.<Date, ModuleNodeImpl> newHashMap());
+                moduleGraph.put(name, Maps.newHashMap());
             }
 
             if (moduleGraph.get(name).get(rev) != null) {
index 7573e934a50fdaf4922f4977b6b6fde84c6ede49..11a3f842616cb40ad2f5f5cd0cf2e31c37234d10 100644 (file)
@@ -390,7 +390,7 @@ public class BuilderUtilsTest {
 
     @Test
     public void testFindIdentity() {
-        assertNull(BuilderUtils.findIdentity(Collections.<IdentitySchemaNodeBuilder>emptySet(), "test-identity"));
+        assertNull(BuilderUtils.findIdentity(Collections.emptySet(), "test-identity"));
     }
 
     @Test
index 05d7a64853ecbdce021a3f84a2c26853a4a54219..1fb4303b02553241bd0d9b1db68408c385e328a5 100644 (file)
@@ -139,7 +139,7 @@ public class YangModelValidationTest {
 
     @Test
     public void testIdentifierMatching() {
-        List<String> ids = new ArrayList<String>();
+        List<String> ids = new ArrayList<>();
         // valid
         ids.add("_ok98-.87.-.8...88-asdAD");
         ids.add("AA.bcd");
index ea910c62115d202478bb60b4b6e5bcc6f1abb410..a8da2ba4f207063f67ed99938e789cb6a3ac189d 100644 (file)
@@ -822,7 +822,7 @@ public class YangParserTest {
         File dependenciesDir = new File(getClass().getResource("/sorting-test").toURI());
         YangContextParser parser = new YangParserImpl();
         modules = parser.parseFile(yangFile, dependenciesDir).getModules();
-        SchemaContext ctx = new SchemaContextImpl(modules, Collections.<ModuleIdentifier, String> emptyMap());
+        SchemaContext ctx = new SchemaContextImpl(modules, Collections.emptyMap());
         checkOrder(modules);
         assertSetEquals(modules, ctx.getModules());
 
@@ -839,12 +839,12 @@ public class YangParserTest {
         }
         Set<Module> newModules = parser.parseFiles(testFiles).getModules();
         assertSetEquals(newModules, modules);
-        ctx = new SchemaContextImpl(newModules, Collections.<ModuleIdentifier, String> emptyMap());
+        ctx = new SchemaContextImpl(newModules, Collections.emptyMap());
         assertSetEquals(newModules, ctx.getModules());
         // ##########
         newModules = parser.parseFiles(testFiles, null).getModules();
         assertSetEquals(newModules, modules);
-        ctx = new SchemaContextImpl(newModules, Collections.<ModuleIdentifier, String> emptyMap());
+        ctx = new SchemaContextImpl(newModules, Collections.emptyMap());
         assertSetEquals(newModules, ctx.getModules());
         // ##########
         List<InputStream> streams = new ArrayList<>();
@@ -853,7 +853,7 @@ public class YangParserTest {
         }
         newModules = parser.parseSources(BuilderUtils.filesToByteSources(testFiles)).getModules();
         assertSetEquals(newModules, modules);
-        ctx = new SchemaContextImpl(newModules, Collections.<ModuleIdentifier, String> emptyMap());
+        ctx = new SchemaContextImpl(newModules, Collections.emptyMap());
         assertSetEquals(newModules, ctx.getModules());
         // ##########
         streams.clear();
@@ -862,7 +862,7 @@ public class YangParserTest {
         }
         newModules = parser.parseSources(BuilderUtils.filesToByteSources(testFiles), null).getModules();
         assertSetEquals(newModules, modules);
-        ctx = new SchemaContextImpl(newModules, Collections.<ModuleIdentifier, String> emptyMap());
+        ctx = new SchemaContextImpl(newModules, Collections.emptyMap());
         assertSetEquals(newModules, ctx.getModules());
     }
 
@@ -930,7 +930,7 @@ public class YangParserTest {
         File yangSubmodul = new File(getClass().getResource("/yang-grammar-test/submodule-header-extension.yang")
                 .toURI());
 
-        List<File> yangs = new ArrayList<File>();
+        List<File> yangs = new ArrayList<>();
         yangs.add(yangModul);
         yangs.add(yangSubmodul);
 
@@ -948,7 +948,7 @@ public class YangParserTest {
         File yangModule2 = new File(getClass().getResource("/yang-grammar-test/stmtsep-in-statements2.yang").toURI());
         File yangSubModule = new File(getClass().getResource("/yang-grammar-test/stmtsep-in-statements-sub.yang").toURI());
 
-        List<File> yangs = new ArrayList<File>();
+        List<File> yangs = new ArrayList<>();
         yangs.add(yangModule1);
         yangs.add(yangModule2);
         yangs.add(yangSubModule);
index 21447aa1e7d21db8e087ecfa5b589cba11fdec7f..ec3ed1253d219ed624d8298360f6bdb0c1eb37e9 100644 (file)
@@ -44,14 +44,14 @@ public class SharedSchemaContextFactoryTest {
         repository.registerSchemaSource(new SchemaSourceProvider<YangTextSchemaSource>() {
             @Override
             public CheckedFuture<YangTextSchemaSource, SchemaSourceException> getSource(final SourceIdentifier sourceIdentifier) {
-                return Futures.<YangTextSchemaSource, SchemaSourceException>immediateCheckedFuture(source1);
+                return Futures.immediateCheckedFuture(source1);
             }
         }, PotentialSchemaSource.create(s1, YangTextSchemaSource.class, 1));
 
         repository.registerSchemaSource(new SchemaSourceProvider<YangTextSchemaSource>() {
             @Override
             public CheckedFuture<YangTextSchemaSource, SchemaSourceException> getSource(final SourceIdentifier sourceIdentifier) {
-                return Futures.<YangTextSchemaSource, SchemaSourceException>immediateCheckedFuture(source2);
+                return Futures.immediateCheckedFuture(source2);
             }
         }, PotentialSchemaSource.create(s2, YangTextSchemaSource.class, 1));
     }
index 7e2ca26508b91160dadefd0d3895980feea24821..4e280160f24fa8d2c9ed9a12b2fe4fc2b1027aa4 100644 (file)
@@ -247,7 +247,7 @@ public class SharedSchemaRepositoryTest {
             }
         };
         assertThat(Collections2.transform(listener.registeredSources, potSourceToSID),
-                both(hasItem(new SourceIdentifier("test", Optional.<String>absent())))
+                both(hasItem(new SourceIdentifier("test", Optional.absent())))
                         .and(hasItem(new SourceIdentifier("test", Optional.of("2012-12-12"))))
                         .and(hasItem(new SourceIdentifier("test", Optional.of("2013-12-12"))))
                         .and(hasItem(new SourceIdentifier("module", Optional.of("2010-12-12"))))
@@ -268,7 +268,7 @@ public class SharedSchemaRepositoryTest {
         sharedSchemaRepository.registerSchemaSource(new SchemaSourceProvider<YangTextSchemaSource>() {
             @Override
             public CheckedFuture<YangTextSchemaSource, SchemaSourceException> getSource(final SourceIdentifier sourceIdentifier) {
-                return Futures.<YangTextSchemaSource, SchemaSourceException>immediateCheckedFuture(new YangTextSchemaSource(runningId) {
+                return Futures.immediateCheckedFuture(new YangTextSchemaSource(runningId) {
                     @Override
                     protected MoreObjects.ToStringHelper addToStringAttributes(final MoreObjects.ToStringHelper toStringHelper) {
                         return toStringHelper;
index 96d81e6157d11cda866d48f618b6416bb9285512..62468893ecf3787a51df08d2aa811dfc12f3119c 100644 (file)
@@ -52,7 +52,7 @@ public class ModuleDependencySortTest {
         List<ModuleBuilder> l = ModuleDependencySort.sort(builders);
 
         assertDependencyGraph(ModuleDependencySort.createModuleGraph(ModuleOrModuleBuilder.fromAll(
-                Collections.<Module>emptySet(), Arrays.asList(builders))));
+                Collections.emptySet(), Arrays.asList(builders))));
 
         Matcher<String> cOrD = anyOf(equalTo(c.getName()), equalTo(d.getName()));