Fix checkstyle if-statements must use braces sal-common-impl
[controller.git] / opendaylight / md-sal / sal-common-impl / src / main / java / org / opendaylight / controller / md / sal / common / impl / routing / RoutingUtils.java
index 60d0cdf76676e72fbe8f2f0ec0ab88cc17a0fdd2..0672ba2b6da5162abb2d6b3039308323c3245759 100644 (file)
@@ -1,3 +1,10 @@
+/*
+ * Copyright (c) 2014 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,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.controller.md.sal.common.impl.routing;
 
 import java.util.Map;
@@ -9,33 +16,33 @@ import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 
 public class RoutingUtils {
-    
+
     public static <C,P> RouteChange<C,P> removalChange(C context,P path) {
         final ImmutableMap<C, Set<P>> announcements = ImmutableMap.<C,Set<P>>of();
         final ImmutableMap<C, Set<P>> removals = ImmutableMap.<C,Set<P>>of(context, ImmutableSet.of(path));
         return new RouteChangeImpl<C,P>(announcements, removals);
     }
-    
+
     public static <C,P> RouteChange<C,P> announcementChange(C context,P path) {
         final ImmutableMap<C, Set<P>> announcements = ImmutableMap.<C,Set<P>>of(context, ImmutableSet.of(path));
         final ImmutableMap<C, Set<P>> removals = ImmutableMap.<C,Set<P>>of();
         return new RouteChangeImpl<C,P>(announcements, removals);
     }
-    
-    
+
+
     public static <C,P> RouteChange<C,P> change(Map<C, Set<P>> announcements,
             Map<C, Set<P>> removals) {
         final ImmutableMap<C, Set<P>> immutableAnnouncements = ImmutableMap.<C,Set<P>>copyOf(announcements);
         final ImmutableMap<C, Set<P>> immutableRemovals = ImmutableMap.<C,Set<P>>copyOf(removals);
         return new RouteChangeImpl<C,P>(immutableAnnouncements, immutableRemovals);
     }
-    
-    
+
+
     private static class RouteChangeImpl<C,P> implements RouteChange<C, P> {
         private final Map<C, Set<P>> removal;
         private final Map<C, Set<P>> announcement;
 
-        public RouteChangeImpl(ImmutableMap<C, Set<P>> removal, ImmutableMap<C, Set<P>> announcement) {
+        public RouteChangeImpl(ImmutableMap<C, Set<P>> announcement, ImmutableMap<C, Set<P>> removal) {
             super();
             this.removal = removal;
             this.announcement = announcement;
@@ -45,7 +52,7 @@ public class RoutingUtils {
         public Map<C, Set<P>> getAnnouncements() {
             return announcement;
         }
-        
+
         @Override
         public Map<C, Set<P>> getRemovals() {
             return removal;
@@ -71,22 +78,25 @@ public class RoutingUtils {
             if (getClass() != obj.getClass()) {
                 return false;
             }
-            RouteChangeImpl other = (RouteChangeImpl) obj;
+            RouteChangeImpl<?, ?> other = (RouteChangeImpl<?, ?>) obj;
             if (announcement == null) {
-                if (other.announcement != null)
+                if (other.announcement != null) {
                     return false;
-            } else if (!announcement.equals(other.announcement))
+                }
+            } else if (!announcement.equals(other.announcement)) {
                 return false;
+            }
             if (removal == null) {
                 if (other.removal != null) {
                     return false;
                 }
-            } else if (!removal.equals(other.removal))
+            } else if (!removal.equals(other.removal)) {
                 return false;
+            }
             return true;
         }
     }
 
 
-    
+
 }