From: Tony Tkacik Date: Sat, 8 Nov 2014 16:08:44 +0000 (+0000) Subject: Merge changes I9865d0cd,Ic71d525f,Ib8faba91,Ia10e5ec9,I35591747,If456a131,I9f8709cc X-Git-Tag: release/lithium~910 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=c181b0ab3202b1d5d87d6048d85c787fde090b8a;hp=00dba4141e5132372e68190638e083cd54e327ba Merge changes I9865d0cd,Ic71d525f,Ib8faba91,Ia10e5ec9,I35591747,If456a131,I9f8709cc * changes: Fix non-generic references to List Hide XSQLBluePrintRelation.addToResult() Fix non-generic references to Set Fix HashMap references Fix raw references to java.lang.Class Fix raw references to NotificationListener Fix non-generic references to HashSet --- diff --git a/opendaylight/config/config-persister-api/src/test/java/org/opendaylight/controller/config/persist/test/PropertiesProviderTest.java b/opendaylight/config/config-persister-api/src/test/java/org/opendaylight/controller/config/persist/test/PropertiesProviderTest.java index 3d4757b926..2c60310e8a 100644 --- a/opendaylight/config/config-persister-api/src/test/java/org/opendaylight/controller/config/persist/test/PropertiesProviderTest.java +++ b/opendaylight/config/config-persister-api/src/test/java/org/opendaylight/controller/config/persist/test/PropertiesProviderTest.java @@ -12,7 +12,7 @@ import java.util.Map; import org.opendaylight.controller.config.persist.api.PropertiesProvider; public class PropertiesProviderTest implements PropertiesProvider { - private final Map properties = new HashMap(); + private final Map properties = new HashMap<>(); public void addProperty(String key,String value){ properties.put(key,value); diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java index 2437bb4b7d..cb375c2490 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/example/ExampleActor.java @@ -118,12 +118,12 @@ public class ExampleActor extends RaftActor { @Override protected void applySnapshot(final ByteString snapshot) { state.clear(); try { - state.putAll((HashMap) toObject(snapshot)); + state.putAll((Map) toObject(snapshot)); } catch (Exception e) { LOG.error(e, "Exception in applying snapshot"); } if(LOG.isDebugEnabled()) { - LOG.debug("Snapshot applied to state : {}", ((HashMap) state).size()); + LOG.debug("Snapshot applied to state : {}", ((Map) state).size()); } } diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java index ef104e7f58..d83362b580 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/behaviors/Leader.java @@ -70,7 +70,7 @@ import java.util.concurrent.atomic.AtomicLong; public class Leader extends AbstractRaftActorBehavior { - protected final Map followerToLog = new HashMap(); + protected final Map followerToLog = new HashMap<>(); protected final Map mapFollowerToSnapshot = new HashMap<>(); private final Set followers; diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntries.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntries.java index 5149cf9f34..14eb8a4b77 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntries.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/AppendEntries.java @@ -25,7 +25,7 @@ import java.util.Map; */ public class AppendEntries extends AbstractRaftRPC { - public static final Class SERIALIZABLE_CLASS = AppendEntriesMessages.AppendEntries.class; + public static final Class SERIALIZABLE_CLASS = AppendEntriesMessages.AppendEntries.class; private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(AppendEntries.class); diff --git a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java index c084cba822..5a0cc95c21 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java +++ b/opendaylight/md-sal/sal-akka-raft/src/main/java/org/opendaylight/controller/cluster/raft/messages/InstallSnapshot.java @@ -13,7 +13,7 @@ import org.opendaylight.controller.protobuff.messages.cluster.raft.InstallSnapsh public class InstallSnapshot extends AbstractRaftRPC { - public static final Class SERIALIZABLE_CLASS = InstallSnapshotMessages.InstallSnapshot.class; + public static final Class SERIALIZABLE_CLASS = InstallSnapshotMessages.InstallSnapshot.class; private final String leaderId; private final long lastIncludedIndex; diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java index 0d5f644b3d..a1088aa7f2 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/MockRaftActorContext.java @@ -33,7 +33,7 @@ public class MockRaftActorContext implements RaftActorContext { private long lastApplied = 0; private final ElectionTerm electionTerm; private ReplicatedLog replicatedLog; - private Map peerAddresses = new HashMap(); + private Map peerAddresses = new HashMap<>(); private ConfigParams configParams; public MockRaftActorContext(){ diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java index 87e40f236c..8244604552 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/RaftActorTest.java @@ -176,7 +176,7 @@ public class RaftActorTest extends AbstractActorTest { Object data = toObject(snapshot); System.out.println("!!!!!applyRecoverySnapshot: "+data); if (data instanceof List) { - state.addAll((List) data); + state.addAll((List) data); } } catch (Exception e) { e.printStackTrace(); @@ -246,7 +246,7 @@ public class RaftActorTest extends AbstractActorTest { return raftActor; } - public boolean waitForLogMessage(final Class logEventClass, String message){ + public boolean waitForLogMessage(final Class logEventClass, String message){ // Wait for a specific log message to show up return new JavaTestKit.EventFilter(logEventClass diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java index 705c69607c..168eb3e5f2 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/behaviors/LeaderTest.java @@ -76,7 +76,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { MockRaftActorContext actorContext = (MockRaftActorContext) createActorContext(); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put(followerActor.path().toString(), followerActor.path().toString()); @@ -121,7 +121,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { MockRaftActorContext actorContext = (MockRaftActorContext) createActorContext(); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put(followerActor.path().toString(), followerActor.path().toString()); @@ -216,7 +216,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { new JavaTestKit(getSystem()) {{ ActorRef followerActor = getSystem().actorOf(Props.create(MessageCollectorActor.class)); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put(followerActor.path().toString(), followerActor.path().toString()); @@ -300,7 +300,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { ActorRef followerActor = getTestActor(); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put(followerActor.path().toString(), followerActor.path().toString()); @@ -371,7 +371,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { ActorRef followerActor = getTestActor(); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put(followerActor.path().toString(), followerActor.path().toString()); @@ -434,7 +434,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { ActorRef followerActor = getTestActor(); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put(followerActor.path().toString(), followerActor.path().toString()); @@ -514,7 +514,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { ActorRef followerActor = getTestActor(); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put(followerActor.path().toString(), followerActor.path().toString()); @@ -690,7 +690,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { ForwardMessageToBehaviorActor.setBehavior(follower); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put(followerActor.path().toString(), followerActor.path().toString()); @@ -760,7 +760,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { ForwardMessageToBehaviorActor.setBehavior(follower); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put(followerActor.path().toString(), followerActor.path().toString()); @@ -823,7 +823,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { MockRaftActorContext leaderActorContext = new MockRaftActorContext("leader", getSystem(), leaderActor); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put("follower-1", followerActor.path().toString()); @@ -858,7 +858,7 @@ public class LeaderTest extends AbstractRaftActorBehaviorTest { leaderActorContext.setReplicatedLog( new MockRaftActorContext.MockReplicatedLogBuilder().createEntries(0, 3, 1).build()); - Map peerAddresses = new HashMap(); + Map peerAddresses = new HashMap<>(); peerAddresses.put("follower-1", followerActor.path().toString()); diff --git a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/MessageCollectorActor.java b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/MessageCollectorActor.java index 3e2e4a05ea..2a79c8f4bc 100644 --- a/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/MessageCollectorActor.java +++ b/opendaylight/md-sal/sal-akka-raft/src/test/java/org/opendaylight/controller/cluster/raft/utils/MessageCollectorActor.java @@ -54,7 +54,7 @@ public class MessageCollectorActor extends UntypedActor { * @param clazz * @return */ - public static Object getFirstMatching(ActorRef actor, Class clazz) throws Exception { + public static Object getFirstMatching(ActorRef actor, Class clazz) throws Exception { List allMessages = getAllMessages(actor); for(Object message : allMessages){ @@ -66,7 +66,7 @@ public class MessageCollectorActor extends UntypedActor { return null; } - public static List getAllMatching(ActorRef actor, Class clazz) throws Exception { + public static List getAllMatching(ActorRef actor, Class clazz) throws Exception { List allMessages = getAllMessages(actor); List output = Lists.newArrayList(); diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueSerializer.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueSerializer.java index aac45e18b5..bb7f9c35ee 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueSerializer.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueSerializer.java @@ -28,7 +28,7 @@ public class ValueSerializer { builder.setInstanceIdentifierValue( InstanceIdentifierUtils.toSerializable((YangInstanceIdentifier) value, context)); } else if(value instanceof Set) { - Set set = (Set) value; + Set set = (Set) value; if (!set.isEmpty()) { for (Object o : set) { if (o instanceof String) { @@ -59,7 +59,7 @@ public class ValueSerializer { return InstanceIdentifierUtils.fromSerializable( node.getInstanceIdentifierValue(), context); } else if(node.getIntValueType() == ValueType.BITS_TYPE.ordinal()){ - return new HashSet(node.getBitsValueList()); + return new HashSet<>(node.getBitsValueList()); } else if(node.getIntValueType() == ValueType.BINARY_TYPE.ordinal()){ return node.getBytesValue().toByteArray(); } diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueType.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueType.java index 6c884734e2..2007544b7e 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueType.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueType.java @@ -32,7 +32,7 @@ public enum ValueType { BIG_DECIMAL_TYPE, BINARY_TYPE; - private static Map types = new HashMap<>(); + private static Map, ValueType> types = new HashMap<>(); static { types.put(String.class, STRING_TYPE); diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeOutputStreamWriter.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeOutputStreamWriter.java index cbd7bf8853..08567fd79e 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeOutputStreamWriter.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/NormalizedNodeOutputStreamWriter.java @@ -204,7 +204,7 @@ public class NormalizedNodeOutputStreamWriter implements NormalizedNodeStreamWri } } - private void writeObjSet(Set set) throws IOException { + private void writeObjSet(Set set) throws IOException { if(!set.isEmpty()){ writer.writeInt(set.size()); for(Object o : set){ @@ -329,7 +329,7 @@ public class NormalizedNodeOutputStreamWriter implements NormalizedNodeStreamWri writer.writeShort((Short) value); break; case ValueTypes.BITS_TYPE: - writeObjSet((Set) value); + writeObjSet((Set) value); break; case ValueTypes.YANG_IDENTIFIER_TYPE: writeYangInstanceIdentifier((YangInstanceIdentifier) value); diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ValueTypes.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ValueTypes.java index 6035e3c644..80fa527b46 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ValueTypes.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/stream/ValueTypes.java @@ -31,7 +31,7 @@ public class ValueTypes { public static final byte BIG_INTEGER_TYPE = 10; public static final byte BIG_DECIMAL_TYPE = 11; - private static Map types = new HashMap<>(); + private static Map, Byte> types = new HashMap<>(); static { types.put(String.class, Byte.valueOf(STRING_TYPE)); diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/PathUtilsTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/PathUtilsTest.java index d1e3eb202f..75e8e2aa4a 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/PathUtilsTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/PathUtilsTest.java @@ -1,15 +1,13 @@ package org.opendaylight.controller.cluster.datastore.node.utils; +import com.google.common.collect.ImmutableSet; import org.junit.Test; import org.opendaylight.controller.cluster.datastore.util.TestModel; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; - import java.util.HashMap; -import java.util.HashSet; import java.util.Map; import java.util.Set; - import static junit.framework.TestCase.assertEquals; public class PathUtilsTest { @@ -92,8 +90,7 @@ public class PathUtilsTest { } private YangInstanceIdentifier.AugmentationIdentifier augmentationIdentifier(){ - Set childNames = new HashSet(); - childNames.add(QNameFactory.create("(urn:opendaylight:flow:table:statistics?revision=2013-12-15)flow-table-statistics")); + Set childNames = ImmutableSet.of(QNameFactory.create("(urn:opendaylight:flow:table:statistics?revision=2013-12-15)flow-table-statistics")); return new YangInstanceIdentifier.AugmentationIdentifier(childNames); } diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueSerializerTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueSerializerTest.java index 88c2695075..d0be36beeb 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueSerializerTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/node/utils/serialization/ValueSerializerTest.java @@ -355,8 +355,8 @@ public class ValueSerializerTest{ nodeBuilder.build()); assertTrue(o instanceof Set); - assertTrue(((Set)o).contains("foo")); - assertTrue(((Set) o).contains("bar")); + assertTrue(((Set)o).contains("foo")); + assertTrue(((Set) o).contains("bar")); } diff --git a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/util/InstanceIdentifierUtilsTest.java b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/util/InstanceIdentifierUtilsTest.java index 6cd06e9c1c..d15f534f80 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/util/InstanceIdentifierUtilsTest.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/test/java/org/opendaylight/controller/cluster/datastore/util/InstanceIdentifierUtilsTest.java @@ -10,6 +10,7 @@ package org.opendaylight.controller.cluster.datastore.util; +import com.google.common.collect.ImmutableSet; import org.junit.Assert; import org.junit.Test; import org.opendaylight.controller.cluster.datastore.node.utils.serialization.QNameDeSerializationContext; @@ -20,7 +21,6 @@ import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashSet; import java.util.List; public class InstanceIdentifierUtilsTest { @@ -116,8 +116,8 @@ public class InstanceIdentifierUtilsTest { @Test public void testAugmentationIdentifier() { - YangInstanceIdentifier.PathArgument p1 = new YangInstanceIdentifier.AugmentationIdentifier(new HashSet( - Arrays.asList(TEST_QNAME))); + YangInstanceIdentifier.PathArgument p1 = new YangInstanceIdentifier.AugmentationIdentifier( + ImmutableSet.of(TEST_QNAME)); List arguments = new ArrayList<>(); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTestKit.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTestKit.java index 79d5c5116d..fa15db6949 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTestKit.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTestKit.java @@ -30,7 +30,7 @@ class ShardTestKit extends JavaTestKit { super(actorSystem); } - protected void waitForLogMessage(final Class logLevel, ActorRef subject, String logMessage){ + protected void waitForLogMessage(final Class logLevel, ActorRef subject, String logMessage){ // Wait for a specific log message to show up final boolean result = new JavaTestKit.EventFilter(logLevel diff --git a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrint.java b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrint.java index 7b51d03a97..867c7a47b5 100644 --- a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrint.java +++ b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrint.java @@ -163,23 +163,23 @@ public class XSQLBluePrint implements DatabaseMetaData, Serializable { return cacheLoadedSuccessfuly; } - private static Map> superClassMap = new HashMap>(); + private static Map, Set>> superClassMap = new HashMap<>(); - public static Set getInheritance(Class myObjectClass, - Class returnType) { + public static Set> getInheritance(Class myObjectClass, + Class returnType) { if (returnType != null && myObjectClass.equals(returnType)) { - return new HashSet(); + return new HashSet<>(); } - Set result = superClassMap.get(myObjectClass); + Set> result = superClassMap.get(myObjectClass); if (result != null) { return result; } - result = new HashSet(); + result = new HashSet<>(); superClassMap.put(myObjectClass, result); if (returnType != null) { if (!returnType.equals(myObjectClass)) { - Class mySuperClass = myObjectClass.getSuperclass(); + Class mySuperClass = myObjectClass.getSuperclass(); while (mySuperClass != null) { result.add(mySuperClass); mySuperClass = mySuperClass.getSuperclass(); @@ -190,11 +190,11 @@ public class XSQLBluePrint implements DatabaseMetaData, Serializable { return result; } - public static Set collectInterfaces(Class cls) { - Set result = new HashSet(); - Class myInterfaces[] = cls.getInterfaces(); + public static Set> collectInterfaces(Class cls) { + Set> result = new HashSet<>(); + Class myInterfaces[] = cls.getInterfaces(); if (myInterfaces != null) { - for (Class in : myInterfaces) { + for (Class in : myInterfaces) { result.add(in); result.addAll(collectInterfaces(in)); } @@ -213,20 +213,20 @@ public class XSQLBluePrint implements DatabaseMetaData, Serializable { map.put(blNode.getBluePrintNodeName(), blNode); } - public Class getGenericType(ParameterizedType type) { + public Class getGenericType(ParameterizedType type) { Type[] typeArguments = type.getActualTypeArguments(); for (Type typeArgument : typeArguments) { if (typeArgument instanceof ParameterizedType) { ParameterizedType pType = (ParameterizedType) typeArgument; - return (Class) pType.getRawType(); + return (Class) pType.getRawType(); } else if (typeArgument instanceof Class) { - return (Class) typeArgument; + return (Class) typeArgument; } } return null; } - public Class getMethodReturnTypeFromGeneric(Method m) { + public Class getMethodReturnTypeFromGeneric(Method m) { Type rType = m.getGenericReturnType(); if (rType instanceof ParameterizedType) { return getGenericType((ParameterizedType) rType); diff --git a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintNode.java b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintNode.java index 8d905f2081..8e9ed3a26b 100644 --- a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintNode.java +++ b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintNode.java @@ -85,7 +85,7 @@ public class XSQLBluePrintNode implements Serializable { this.children.add(ch); } - public boolean isModelChild(Class p) { + public boolean isModelChild(Class p) { if (this.relations.size() == 0) { return false; } @@ -227,7 +227,7 @@ public class XSQLBluePrintNode implements Serializable { return "Unknown"; } - public Class getInterface() { + public Class getInterface() { return this.myInterface; } diff --git a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintRelation.java b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintRelation.java index 1cb3aa5559..38a96dc457 100644 --- a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintRelation.java +++ b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintRelation.java @@ -80,20 +80,20 @@ public class XSQLBluePrintRelation implements Serializable { } } - public List execute(Object o) { - List result = new LinkedList(); + public List execute(Object o) { + List result = new LinkedList<>(); if (o == null) { return null; } if (Set.class.isAssignableFrom(o.getClass())) { - Set lst = (Set) o; + Set lst = (Set) o; for (Object oo : lst) { addToResult(result, execute(oo)); } return result; } else if (List.class.isAssignableFrom(o.getClass())) { - List lst = (List) o; + List lst = (List) o; for (Object oo : lst) { addToResult(result, execute(oo)); } @@ -111,17 +111,17 @@ public class XSQLBluePrintRelation implements Serializable { return result; } - public static void addToResult(List result, Object o) { + private static void addToResult(List result, Object o) { if (o == null) { return; } if (Set.class.isAssignableFrom(o.getClass())) { - Set lst = (Set) o; + Set lst = (Set) o; for (Object oo : lst) { result.add(oo); } } else if (List.class.isAssignableFrom(o.getClass())) { - List lst = (List) o; + List lst = (List) o; for (Object oo : lst) { result.add(oo); } diff --git a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLColumn.java b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLColumn.java index 4c6cca7fa6..d3d57bd814 100644 --- a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLColumn.java +++ b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLColumn.java @@ -6,7 +6,7 @@ public class XSQLColumn implements Serializable, Comparable { private String name = null; private String tableName = null; private int charWidth = -1; - private Class type = null; + private Class type = null; private transient Object bluePrintNode = null; private String origName = null; private String origTableName = null; diff --git a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLODLUtils.java b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLODLUtils.java index 6a27230664..17b8ae5f29 100644 --- a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLODLUtils.java +++ b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLODLUtils.java @@ -32,7 +32,7 @@ public class XSQLODLUtils { types.put(Status.class, Status.class); } - public static boolean isColumnType(Class cls) { + public static boolean isColumnType(Class cls) { return types.containsKey(cls); } @@ -229,7 +229,7 @@ public class XSQLODLUtils { return "NULL"; } - public static Class getTypeForODLColumn(Object odlNode){ + public static Class getTypeForODLColumn(Object odlNode){ Object type = get(odlNode,"type"); if(type instanceof Uint32 || type instanceof Uint64){ return long.class; diff --git a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCResultSet.java b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCResultSet.java index 021f6ee19b..e47bf870cc 100644 --- a/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCResultSet.java +++ b/opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCResultSet.java @@ -127,7 +127,7 @@ public class JDBCResultSet implements Serializable, ResultSet, return 1; } - public int isObjectFitCriteria(Object element, Class cls) { + public int isObjectFitCriteria(Object element, Class cls) { Map> tblCriteria = criteria.get(cls .getName()); if (tblCriteria == null) { diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java index f6f720eed0..d6c11319d0 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistryTest.java @@ -200,7 +200,7 @@ public class RpcRegistryTest { Messages.BucketStoreMessages.UpdateRemoteBuckets.class); } - private JavaTestKit createProbeForMessage(ActorSystem node, ActorPath subjectPath, final Class clazz) { + private JavaTestKit createProbeForMessage(ActorSystem node, ActorPath subjectPath, final Class clazz) { final JavaTestKit probe = new JavaTestKit(node); ConditionalProbe conditionalProbe = diff --git a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/impl/NotificationServiceImpl.java b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/impl/NotificationServiceImpl.java index c08f329f0d..192836e9fa 100644 --- a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/impl/NotificationServiceImpl.java +++ b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/impl/NotificationServiceImpl.java @@ -39,7 +39,7 @@ public class NotificationServiceImpl implements NotificationService { notifications.add(new QName(notificationType.toString())); String notificationStreamName = RemoteStreamTools.createNotificationStream(salRemoteService, notifications); final Map desiredEventStream = RemoteStreamTools.createEventStream(restconfClientContext, notificationStreamName); - RemoteNotificationListener remoteNotificationListener = new RemoteNotificationListener(listener); + RemoteNotificationListener remoteNotificationListener = new RemoteNotificationListener(listener); final ListenerRegistration listenerRegistration = restconfClientContext.getEventStreamContext(desiredEventStream.get(desiredEventStream.get(notificationStreamName))) .registerNotificationListener(remoteNotificationListener); diff --git a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/listeners/RemoteNotificationListener.java b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/listeners/RemoteNotificationListener.java index 895a5030e9..82fa2ae2e9 100644 --- a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/listeners/RemoteNotificationListener.java +++ b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/listeners/RemoteNotificationListener.java @@ -8,15 +8,16 @@ package org.opendaylight.controller.sal.restconf.broker.listeners; import org.opendaylight.controller.sal.binding.api.NotificationListener; +import org.opendaylight.yangtools.yang.binding.Notification; -public class RemoteNotificationListener implements org.opendaylight.yangtools.yang.binding.NotificationListener { +public class RemoteNotificationListener implements org.opendaylight.yangtools.yang.binding.NotificationListener { - org.opendaylight.controller.sal.binding.api.NotificationListener listener; + NotificationListener listener; - public RemoteNotificationListener(NotificationListener listener){ + public RemoteNotificationListener(NotificationListener listener){ this.listener = listener; } - public NotificationListener getListener(){ + public NotificationListener getListener() { return this.listener; } diff --git a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/listeners/SalNotificationListener.java b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/listeners/SalNotificationListener.java index 16ca0aee93..3c4bbba4a4 100644 --- a/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/listeners/SalNotificationListener.java +++ b/opendaylight/md-sal/sal-restconf-broker/src/main/java/org/opendaylight/controller/sal/restconf/broker/listeners/SalNotificationListener.java @@ -11,14 +11,14 @@ import org.opendaylight.controller.sal.binding.api.NotificationListener; import org.opendaylight.yangtools.yang.binding.Notification; -public class SalNotificationListener implements NotificationListener { - private NotificationListener notificationListener; +public class SalNotificationListener implements NotificationListener { + private NotificationListener notificationListener; - public SalNotificationListener( NotificationListener notificationListener){ + public SalNotificationListener( NotificationListener notificationListener){ this.notificationListener = notificationListener; } @Override public void onNotification(Notification notification) { - this.notificationListener.onNotification(notification); + this.notificationListener.onNotification((T)notification); } } diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleUnionAttributeWritingStrategy.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleUnionAttributeWritingStrategy.java index d75feb273e..36010aef48 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleUnionAttributeWritingStrategy.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/toxml/SimpleUnionAttributeWritingStrategy.java @@ -32,7 +32,7 @@ public class SimpleUnionAttributeWritingStrategy extends SimpleAttributeWritingS Util.checkType(listOfStrings, List.class); StringBuilder b = new StringBuilder(); - for (Object character: (List)listOfStrings) { + for (Object character: (List)listOfStrings) { Util.checkType(character, String.class); b.append(character); } diff --git a/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java b/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java index 9993f48a4d..1b07f3c280 100644 --- a/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java +++ b/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/NetconfClientSessionNegotiatorTest.java @@ -122,7 +122,7 @@ public class NetconfClientSessionNegotiatorTest { NetconfClientSessionNegotiator negotiator = createNetconfClientSessionNegotiator(promise, null); negotiator.channelActive(null); - Set caps = Sets.newSet("a", "b"); + Set caps = Sets.newSet("a", "b"); NetconfHelloMessage helloServerMessage = NetconfHelloMessage.createServerHello(caps, 10); negotiator.handleMessage(helloServerMessage); verify(promise).setSuccess(anyObject()); @@ -137,7 +137,7 @@ public class NetconfClientSessionNegotiatorTest { NetconfClientSessionNegotiator negotiator = createNetconfClientSessionNegotiator(promise, exiMessage); negotiator.channelActive(null); - Set caps = Sets.newSet("exi:1.0"); + Set caps = Sets.newSet("exi:1.0"); NetconfHelloMessage helloMessage = NetconfHelloMessage.createServerHello(caps, 10); doAnswer(new Answer() { diff --git a/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListenerTest.java b/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListenerTest.java index 29b903f235..9065ca45a2 100644 --- a/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListenerTest.java +++ b/opendaylight/netconf/netconf-client/src/test/java/org/opendaylight/controller/netconf/client/SimpleNetconfClientSessionListenerTest.java @@ -25,7 +25,7 @@ public class SimpleNetconfClientSessionListenerTest { private Channel channel; private ChannelFuture channelFuture; - Set caps; + Set caps; private NetconfHelloMessage helloMessage; private NetconfMessage message; private NetconfClientSessionListener sessionListener; diff --git a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfMonitoringServiceImplTest.java b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfMonitoringServiceImplTest.java index a188550d40..2125035799 100644 --- a/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfMonitoringServiceImplTest.java +++ b/opendaylight/netconf/netconf-impl/src/test/java/org/opendaylight/controller/netconf/impl/NetconfMonitoringServiceImplTest.java @@ -73,8 +73,8 @@ public class NetconfMonitoringServiceImplTest { public void testGetSchemas3() throws Exception { doReturn("").when(managementSession).toString(); Capability cap = mock(Capability.class); - Set caps = Sets.newHashSet(cap); - Set services = Sets.newHashSet(operationService); + Set caps = Sets.newHashSet(cap); + Set services = Sets.newHashSet(operationService); doReturn(snapshot).when(operationProvider).openSnapshot(anyString()); doReturn(services).when(snapshot).getServices(); doReturn(caps).when(operationService).getCapabilities(); diff --git a/opendaylight/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleScanner.java b/opendaylight/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleScanner.java index c590da4dbc..2fee2720c2 100644 --- a/opendaylight/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleScanner.java +++ b/opendaylight/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleScanner.java @@ -294,8 +294,8 @@ import org.slf4j.LoggerFactory; if (classes == null || classes.size() == 0) return; Map names = new HashMap(); StringBuilder conflictsMsg = new StringBuilder(); - for (Class c : classes) { - XmlRootElement root = (XmlRootElement) c.getAnnotation(XmlRootElement.class); + for (Class c : classes) { + XmlRootElement root = c.getAnnotation(XmlRootElement.class); if (root == null) continue; String rootName = root.name(); if ("##default".equals(rootName)) { diff --git a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyNorthbound.java b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyNorthbound.java index bfe2c922bd..cc45d6de5d 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyNorthbound.java +++ b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronFirewallPolicyNorthbound.java @@ -79,7 +79,7 @@ public class NeutronFirewallPolicyNorthbound { @QueryParam("name") String queryFirewallPolicyName, @QueryParam("description") String querySecurityPolicyDescription, @QueryParam("shared") String querySecurityPolicyIsShared, - @QueryParam("firewall_rules") List querySecurityPolicyFirewallRules, + @QueryParam("firewall_rules") List querySecurityPolicyFirewallRules, @QueryParam("audited") Boolean querySecurityPolicyIsAudited, // pagination @QueryParam("limit") String limit,