BUG-509: internal cleanup 12/5912/2
authorRobert Varga <rovarga@cisco.com>
Fri, 4 Apr 2014 17:14:57 +0000 (19:14 +0200)
committerRobert Varga <rovarga@cisco.com>
Sun, 6 Apr 2014 16:24:21 +0000 (18:24 +0200)
Spell-check internal class and make it static
Make sure we don't have null name in contructor
Make sure we don't have null executor in constructor
getIdentifier() should be final

Change-Id: Ib8ebe82106d953581738bccbe1d4b878f9520b5b
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/DataChangeEventResolver.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java

index a032c79..0948f6d 100644 (file)
@@ -184,6 +184,9 @@ public class DataChangeEventResolver {
                 subtree.merge(resolveSubtreeChangeEvent(childPath, childListen, childMod, childBefore.get(),
                         childAfter.get()));
                 break;
+            case UNMODIFIED:
+                // no-op
+                break;
             }
         }
         DOMImmutableDataChangeEvent oneChangeEvent = one.build();
index 0cd00ca..30c6ac4 100644 (file)
@@ -37,6 +37,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedLong;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -61,15 +62,15 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
     private SchemaContext schemaContext;
 
     public InMemoryDOMDataStore(final String name, final ListeningExecutorService executor) {
-        this.executor = executor;
-        this.name = name;
-        this.operationTree = new AllwaysFailOperation();
+        this.name = Preconditions.checkNotNull(name);
+        this.executor = Preconditions.checkNotNull(executor);
+        this.operationTree = new AlwaysFailOperation();
         this.snapshot = DataAndMetadataSnapshot.createEmpty();
         this.listenerTree = ListenerRegistrationNode.createRoot();
     }
 
     @Override
-    public String getIdentifier() {
+    public final String getIdentifier() {
         return name;
     }
 
@@ -360,7 +361,7 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable<String>, Sch
 
     }
 
-    private class AllwaysFailOperation implements ModificationApplyOperation {
+    private static final class AlwaysFailOperation implements ModificationApplyOperation {
 
         @Override
         public Optional<StoreMetadataNode> apply(final NodeModification modification,