more error-prone issue fix

Change-Id: I49f2cc0459cfddddc6a99e2ebb8ad52d547e2909
diff --git a/apps/configsync-netconf/pom.xml b/apps/configsync-netconf/pom.xml
index 4f832bc..7a23711 100644
--- a/apps/configsync-netconf/pom.xml
+++ b/apps/configsync-netconf/pom.xml
@@ -124,18 +124,6 @@
     </dependencies>
 
     <build>
-        <pluginManagement>
-            <plugins>
-
-                <plugin>
-                    <groupId>org.apache.karaf.tooling</groupId>
-                    <artifactId>karaf-maven-plugin</artifactId>
-                    <version>3.0.5</version>
-                    <extensions>true</extensions>
-                </plugin>
-
-            </plugins>
-        </pluginManagement>
 
         <plugins>
             <plugin>
diff --git a/apps/configsync/pom.xml b/apps/configsync/pom.xml
index 270dda3..1376461 100644
--- a/apps/configsync/pom.xml
+++ b/apps/configsync/pom.xml
@@ -124,18 +124,6 @@
     </dependencies>
 
     <build>
-        <pluginManagement>
-            <plugins>
-
-                <plugin>
-                    <groupId>org.apache.karaf.tooling</groupId>
-                    <artifactId>karaf-maven-plugin</artifactId>
-                    <version>3.0.5</version>
-                    <extensions>true</extensions>
-                </plugin>
-
-            </plugins>
-        </pluginManagement>
 
         <plugins>
             <plugin>
diff --git a/apps/evpn-route-service/api/src/main/java/org/onosproject/evpnrouteservice/EvpnInstanceRoute.java b/apps/evpn-route-service/api/src/main/java/org/onosproject/evpnrouteservice/EvpnInstanceRoute.java
index 3e98531..ca0c8bd8 100644
--- a/apps/evpn-route-service/api/src/main/java/org/onosproject/evpnrouteservice/EvpnInstanceRoute.java
+++ b/apps/evpn-route-service/api/src/main/java/org/onosproject/evpnrouteservice/EvpnInstanceRoute.java
@@ -198,7 +198,7 @@
 
         EvpnInstanceRoute that = (EvpnInstanceRoute) other;
 
-        return Objects.equals(prefix, prefix)
+        return Objects.equals(prefix, that.prefix)
                 && Objects.equals(nextHop, that.nextHop)
                 && Objects.equals(evpnName, that.evpnName)
                 && Objects.equals(rd, that.rd)
diff --git a/apps/evpn-route-service/api/src/main/java/org/onosproject/evpnrouteservice/EvpnRoute.java b/apps/evpn-route-service/api/src/main/java/org/onosproject/evpnrouteservice/EvpnRoute.java
index 9449093..0f025d3 100644
--- a/apps/evpn-route-service/api/src/main/java/org/onosproject/evpnrouteservice/EvpnRoute.java
+++ b/apps/evpn-route-service/api/src/main/java/org/onosproject/evpnrouteservice/EvpnRoute.java
@@ -115,7 +115,6 @@
         checkNotNull(prefixMac);
         checkNotNull(prefix);
         //checkNotNull(nextHop); //next hop can be null in case of MP un reach.
-        checkNotNull(labelToInt);
         this.source = checkNotNull(source);
         this.prefix = prefix;
         this.prefixMac = prefixMac;
@@ -258,7 +257,7 @@
 
         EvpnRoute that = (EvpnRoute) other;
 
-        return Objects.equals(prefixMac, prefixMac)
+        return Objects.equals(prefixMac, that.prefixMac)
                 && Objects.equals(prefix, that.prefix)
                 && Objects.equals(nextHop, that.nextHop)
                 && Objects.equals(this.rd, that.rd)
diff --git a/apps/evpn-route-service/app/src/main/java/org/onosproject/evpnrouteservice/impl/EvpnRouteManager.java b/apps/evpn-route-service/app/src/main/java/org/onosproject/evpnrouteservice/impl/EvpnRouteManager.java
index 19e6311..28abb7d 100644
--- a/apps/evpn-route-service/app/src/main/java/org/onosproject/evpnrouteservice/impl/EvpnRouteManager.java
+++ b/apps/evpn-route-service/app/src/main/java/org/onosproject/evpnrouteservice/impl/EvpnRouteManager.java
@@ -81,7 +81,9 @@
     @Deactivate
     protected void deactivate() {
         evpnRouteStore.unsetDelegate(evpnRouteStoreDelegate);
-        listeners.values().forEach(EvpnListenerQueue::stop);
+        synchronized (this) {
+            listeners.values().forEach(EvpnListenerQueue::stop);
+        }
     }
 
     /**
@@ -148,6 +150,7 @@
     }
 
 
+    @Override
     public Collection<EvpnRouteTableId> getRouteTables() {
         return evpnRouteStore.getRouteTables();
     }
diff --git a/apps/graphitemetrics/src/test/java/org/onosproject/graphitemetrics/GraphiteMetricsReporterTest.java b/apps/graphitemetrics/src/test/java/org/onosproject/graphitemetrics/GraphiteMetricsReporterTest.java
index 5ecaf28..5036964 100644
--- a/apps/graphitemetrics/src/test/java/org/onosproject/graphitemetrics/GraphiteMetricsReporterTest.java
+++ b/apps/graphitemetrics/src/test/java/org/onosproject/graphitemetrics/GraphiteMetricsReporterTest.java
@@ -49,13 +49,6 @@
     }
 
     /**
-     * Tears down graphite metrics reporter instance.
-     */
-    public void tearDown() {
-        gmr.deactivate();
-    }
-
-    /**
      * Tests whether the containsName method can always return the correct result
      * with the given metric name and a set of prefixes.
      */
diff --git a/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxMetric.java b/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxMetric.java
index f3ce81a..bcee522 100644
--- a/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxMetric.java
+++ b/apps/influxdbmetrics/src/main/java/org/onosproject/influxdbmetrics/DefaultInfluxMetric.java
@@ -67,7 +67,6 @@
 
         @Override
         public InfluxMetric build() {
-            checkNotNull(oneMinRate, ONE_MIN_RATE_MSG);
             checkNotNull(timestamp, TIMESTAMP_MSG);
 
             return new DefaultInfluxMetric(oneMinRate, parseTime(timestamp));
diff --git a/apps/netconf/client/pom.xml b/apps/netconf/client/pom.xml
index e37a3c5..eba0375 100644
--- a/apps/netconf/client/pom.xml
+++ b/apps/netconf/client/pom.xml
@@ -125,18 +125,6 @@
     </dependencies>
 
     <build>
-        <pluginManagement>
-            <plugins>
-
-                <plugin>
-                    <groupId>org.apache.karaf.tooling</groupId>
-                    <artifactId>karaf-maven-plugin</artifactId>
-                    <version>3.0.5</version>
-                    <extensions>true</extensions>
-                </plugin>
-
-            </plugins>
-        </pluginManagement>
 
         <plugins>
             <plugin>
diff --git a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/EventData.java b/apps/netconf/client/src/main/java/org/onosproject/netconf/client/EventData.java
deleted file mode 100644
index 0dce327..0000000
--- a/apps/netconf/client/src/main/java/org/onosproject/netconf/client/EventData.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2017-present Open Networking Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.netconf.client;
-
-import org.onosproject.config.DynamicConfigEvent;
-import org.onosproject.net.DeviceId;
-import org.onosproject.yang.model.ResourceId;
-
-
-/**
- * Event details.
- */
-public class EventData {
-
-    private DeviceId devId;
-    private ResourceId key;
-    private DynamicConfigEvent.Type type;
-
-    /**
-     * Creates an instance of EventData.
-     *
-     * @param devId device id
-     * @param key device key
-     * @param type event type
-     */
-    public EventData(DeviceId devId, ResourceId key, DynamicConfigEvent.Type type) {
-        devId = devId;
-        key = key;
-        type = type;
-    }
-
-    public DeviceId getDevId() {
-        return devId;
-    }
-
-    public ResourceId getKey() {
-        return key;
-    }
-
-    public DynamicConfigEvent.Type getType() {
-        return type;
-    }
-}
\ No newline at end of file
diff --git a/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java b/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java
index 41d54c2..d1e3d66 100644
--- a/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java
+++ b/apps/pce/app/src/main/java/org/onosproject/pce/pceservice/PceManager.java
@@ -398,7 +398,7 @@
                     //Log.info("computeExplicitPath :: finalComputedPath " + finalComputedPath);
 
                     if (finalComputedPath != null && !finalComputedPath.get(finalComputedPath.size() - 1).links()
-                            .contains((Link) info.value())) {
+                            .contains(info.value())) {
                         finalComputedPath = null;
                     }
                 }
@@ -913,7 +913,6 @@
     private boolean releaseSharedBwForNewTunnel(Path computedPath, double bandwidthConstraint,
                                                 SharedBandwidthConstraint shBwConstraint) {
         checkNotNull(computedPath);
-        checkNotNull(bandwidthConstraint);
         double bwToAllocate;
 
         Double additionalBwValue = null;
@@ -1071,7 +1070,6 @@
     private boolean reserveBandwidth(Path computedPath, double bandwidthConstraint,
                                   SharedBandwidthConstraint shBwConstraint) {
         checkNotNull(computedPath);
-        checkNotNull(bandwidthConstraint);
         Resource resource = null;
         double bwToAllocate = 0;
         Map<Link, Double> linkMap = new HashMap<>();
diff --git a/apps/pce/pceweb/src/main/java/org/onosproject/pceweb/PceWebTopovMessageHandler.java b/apps/pce/pceweb/src/main/java/org/onosproject/pceweb/PceWebTopovMessageHandler.java
index a1a9a25..4306f61 100644
--- a/apps/pce/pceweb/src/main/java/org/onosproject/pceweb/PceWebTopovMessageHandler.java
+++ b/apps/pce/pceweb/src/main/java/org/onosproject/pceweb/PceWebTopovMessageHandler.java
@@ -772,7 +772,7 @@
     private void findTunnelAndHighlights() {
         Collection<Tunnel> tunnelSet = null;
         Highlights highlights = new Highlights();
-        paths.removeAll(paths);
+        paths.clear();
         tunnelSet = tunnelService.queryTunnel(MPLS);
         if (tunnelSet.size() == 0) {
             log.warn("Tunnel does not exist");
@@ -819,7 +819,7 @@
      */
     private void highlightsForTunnel(List<Tunnel> tunnels) {
         Highlights highlights = new Highlights();
-        paths.removeAll(paths);
+        paths.clear();
 
         if (tunnels.isEmpty()) {
             log.error("path does not exist");
diff --git a/apps/route-service/app/src/main/java/org/onosproject/routeservice/impl/RouteManager.java b/apps/route-service/app/src/main/java/org/onosproject/routeservice/impl/RouteManager.java
index 8914a1e..0dc5dbe 100644
--- a/apps/route-service/app/src/main/java/org/onosproject/routeservice/impl/RouteManager.java
+++ b/apps/route-service/app/src/main/java/org/onosproject/routeservice/impl/RouteManager.java
@@ -113,7 +113,9 @@
     @Deactivate
     protected void deactivate() {
         routeMonitor.shutdown();
-        listeners.values().forEach(ListenerQueue::stop);
+        synchronized (this) {
+            listeners.values().forEach(ListenerQueue::stop);
+        }
 
         routeStore.unsetDelegate(delegate);
         hostService.removeListener(hostListener);
@@ -176,6 +178,7 @@
         return routeSets.stream().flatMap(r -> r.routes().stream()).collect(Collectors.toList());
     }
 
+    @Override
     public Collection<RouteTableId> getRouteTables() {
         return routeStore.getRouteTables();
     }
diff --git a/apps/routeradvertisement/src/main/java/org/onosproject/ra/RouterAdvertisementManager.java b/apps/routeradvertisement/src/main/java/org/onosproject/ra/RouterAdvertisementManager.java
index 5f31bdf..9f10728 100644
--- a/apps/routeradvertisement/src/main/java/org/onosproject/ra/RouterAdvertisementManager.java
+++ b/apps/routeradvertisement/src/main/java/org/onosproject/ra/RouterAdvertisementManager.java
@@ -160,14 +160,17 @@
     private final Map<ConnectPoint, Map.Entry<ScheduledFuture<?>, List<InterfaceIpAddress>>> transmitters =
             new LinkedHashMap<>();
 
+    // TODO: should consider using concurrent variants
     @GuardedBy(value = "this")
     private final Map<DeviceId, List<InterfaceIpAddress>> globalPrefixes = new LinkedHashMap<>();
 
     @Override
-    public ImmutableMap<DeviceId, List<InterfaceIpAddress>> getGlobalPrefixes() {
+    public synchronized ImmutableMap<DeviceId, List<InterfaceIpAddress>> getGlobalPrefixes() {
         return ImmutableMap.copyOf(globalPrefixes);
     }
 
+    @SuppressWarnings("GuardedBy")
+    @GuardedBy(value = "this")
     private Function<Interface, Map.Entry<ConnectPoint, List<InterfaceIpAddress>>> prefixGenerator =
             i -> {
                 Map.Entry<ConnectPoint, List<InterfaceIpAddress>> prefixEntry;
@@ -282,6 +285,7 @@
         clearThreadPool();
     }
 
+    @SuppressWarnings("GuardedBy")
     // Loading global prefixes for devices from network configuration
     private synchronized void loadGlobalPrefixConfig() {
         globalPrefixes.clear();
@@ -507,6 +511,7 @@
             solicitHostAddress = ipv6Address;
         }
 
+        @Override
         public void run() {
             // Router Advertisement header filling. Please refer RFC-2461.
             RouterAdvertisement ra = new RouterAdvertisement();
diff --git a/apps/tenbi/topology/pom.xml b/apps/tenbi/topology/pom.xml
index b3ac945..61b1453 100644
--- a/apps/tenbi/topology/pom.xml
+++ b/apps/tenbi/topology/pom.xml
@@ -62,4 +62,33 @@
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgs>
+                      <arg>-XepDisableAllChecks</arg>
+                      <arg>-Xep:BetaApi:OFF</arg>
+                    </compilerArgs>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <compilerArgs>
+                              <arg>-XepDisableAllChecks</arg>
+                              <arg>-Xep:BetaApi:OFF</arg>
+                            </compilerArgs>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
diff --git a/apps/tenbi/tunnel/pom.xml b/apps/tenbi/tunnel/pom.xml
index 2a64af3..2c114a7 100644
--- a/apps/tenbi/tunnel/pom.xml
+++ b/apps/tenbi/tunnel/pom.xml
@@ -90,6 +90,32 @@
                     </instructions>
                 </configuration>
             </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgs>
+                      <arg>-XepDisableAllChecks</arg>
+                      <arg>-Xep:BetaApi:OFF</arg>
+                    </compilerArgs>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <compilerArgs>
+                              <arg>-XepDisableAllChecks</arg>
+                              <arg>-Xep:BetaApi:OFF</arg>
+                            </compilerArgs>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
         </plugins>
     </build>
 
diff --git a/apps/tenbi/utils/pom.xml b/apps/tenbi/utils/pom.xml
index 817a6da..b15a235 100644
--- a/apps/tenbi/utils/pom.xml
+++ b/apps/tenbi/utils/pom.xml
@@ -51,4 +51,34 @@
             <version>${project.version}</version>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgs>
+                      <arg>-XepDisableAllChecks</arg>
+                      <arg>-Xep:BetaApi:OFF</arg>
+                    </compilerArgs>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <compilerArgs>
+                              <arg>-XepDisableAllChecks</arg>
+                              <arg>-Xep:BetaApi:OFF</arg>
+                            </compilerArgs>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
diff --git a/apps/tenbi/yangmodel/pom.xml b/apps/tenbi/yangmodel/pom.xml
index a38a441..2ad8679 100644
--- a/apps/tenbi/yangmodel/pom.xml
+++ b/apps/tenbi/yangmodel/pom.xml
@@ -44,6 +44,33 @@
 
     <build>
         <plugins>
+
+            <!-- FIXME: YANG tool generates problematic code -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgs>
+                      <arg>-XepDisableAllChecks</arg>
+                      <arg>-Xep:BetaApi:OFF</arg>
+                    </compilerArgs>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <compilerArgs>
+                              <arg>-XepDisableAllChecks</arg>
+                              <arg>-Xep:BetaApi:OFF</arg>
+                            </compilerArgs>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
            <plugin>
                 <groupId>org.onosproject</groupId>
                 <artifactId>onos-yang-maven-plugin</artifactId>
diff --git a/apps/tetopology/app/src/main/java/org/onosproject/tetopology/management/impl/DistributedTeTopologyStore.java b/apps/tetopology/app/src/main/java/org/onosproject/tetopology/management/impl/DistributedTeTopologyStore.java
index a5bc555..c9a0b50 100644
--- a/apps/tetopology/app/src/main/java/org/onosproject/tetopology/management/impl/DistributedTeTopologyStore.java
+++ b/apps/tetopology/app/src/main/java/org/onosproject/tetopology/management/impl/DistributedTeTopologyStore.java
@@ -1316,7 +1316,7 @@
         TeNodeKey myTeNodeKey;
         InternalNetworkNode intNode = null;
         if (!parentUpdate) {
-            intNode = networkNodeMap.get(tpKey.nodeId());
+            intNode = networkNodeMap.get(tpKey);
             if (intNode == null) {
                 log.error(" node is not in dataStore for tp update {}", tpKey);
                 return;
@@ -1351,7 +1351,7 @@
     @Override
     public void removeTerminationPoint(TerminationPointKey tpKey) {
         // Update InternalNetworkNode
-        InternalNetworkNode intNode = networkNodeMap.get(tpKey.nodeId());
+        InternalNetworkNode intNode = networkNodeMap.get(tpKey);
         if (intNode != null && CollectionUtils.isNotEmpty(intNode.tpIds())) {
             intNode.setChildUpdate(true);
             intNode.tpIds().remove(tpKey.tpId());
diff --git a/apps/tetopology/app/src/test/java/org/onosproject/tetopology/management/DefaultBuilder.java b/apps/tetopology/app/src/test/java/org/onosproject/tetopology/management/DefaultBuilder.java
index 47cdcd6..1c82fcc 100644
--- a/apps/tetopology/app/src/test/java/org/onosproject/tetopology/management/DefaultBuilder.java
+++ b/apps/tetopology/app/src/test/java/org/onosproject/tetopology/management/DefaultBuilder.java
@@ -143,7 +143,7 @@
         for (long i = 0; i < numTtps; i++) {
             ttps.put(i, ttpBuilder(i));
         }
-        ttp = ttps.get(FIRST_INDEX);
+        ttp = ttps.get((long) FIRST_INDEX);
         //TeNode
         teNode = new DefaultTeNode(teNodeId, underlayTopologyId,
                                    supportTeNodeId, sourceTeNodeId,
diff --git a/apps/tetopology/app/src/test/java/org/onosproject/tetopology/management/SimpleTeTopologyStore.java b/apps/tetopology/app/src/test/java/org/onosproject/tetopology/management/SimpleTeTopologyStore.java
index bc1c818..7f010fa 100644
--- a/apps/tetopology/app/src/test/java/org/onosproject/tetopology/management/SimpleTeTopologyStore.java
+++ b/apps/tetopology/app/src/test/java/org/onosproject/tetopology/management/SimpleTeTopologyStore.java
@@ -697,7 +697,7 @@
         if (intNework != null
                 && CollectionUtils.isNotEmpty(intNework.nodeIds())) {
             intNework.setChildUpdate(true);
-            intNework.nodeIds().remove(nodeKey.nodeId());
+            intNework.nodeIds().remove(nodeKey);
         }
         InternalNetworkNode intNode = networkNodeMap.remove(nodeKey);
         if (intNode != null && CollectionUtils.isNotEmpty(intNode.tpIds())) {
@@ -905,7 +905,7 @@
         if (intNework != null
                 && CollectionUtils.isNotEmpty(intNework.linkIds())) {
             intNework.setChildUpdate(true);
-            intNework.linkIds().remove(linkKey.linkId());
+            intNework.linkIds().remove(linkKey);
         }
         // Remove it from networkLinkMap
         InternalNetworkLink intLink = networkLinkMap.remove(linkKey);
@@ -937,7 +937,7 @@
         TeNodeKey myTeNodeKey;
         InternalNetworkNode intNode = null;
         if (!parentUpdate) {
-            intNode = networkNodeMap.get(tpKey.nodeId());
+            intNode = networkNodeMap.get(tpKey);
             if (intNode == null) {
                 log.error(" node is not in dataStore for tp update {}", tpKey);
                 return;
@@ -974,7 +974,7 @@
     @Override
     public void removeTerminationPoint(TerminationPointKey tpKey) {
         // Update InternalNetworkNode
-        InternalNetworkNode intNode = networkNodeMap.get(tpKey.nodeId());
+        InternalNetworkNode intNode = networkNodeMap.get(tpKey);
         if (intNode != null && CollectionUtils.isNotEmpty(intNode.tpIds())) {
             intNode.setChildUpdate(true);
             intNode.tpIds().remove(tpKey.tpId());
diff --git a/apps/vpls/src/test/java/org/onosproject/vpls/VplsTest.java b/apps/vpls/src/test/java/org/onosproject/vpls/VplsTest.java
index 2e42254..10bd51c 100644
--- a/apps/vpls/src/test/java/org/onosproject/vpls/VplsTest.java
+++ b/apps/vpls/src/test/java/org/onosproject/vpls/VplsTest.java
@@ -52,6 +52,7 @@
 import org.onosproject.net.host.HostEvent;
 import org.onosproject.net.host.HostListener;
 import org.onosproject.net.host.HostServiceAdapter;
+import org.onosproject.net.host.InterfaceIpAddress;
 import org.onosproject.net.intent.Intent;
 import org.onosproject.net.intent.IntentData;
 import org.onosproject.net.intent.IntentEvent;
@@ -396,7 +397,11 @@
         @Override
         public Set<Interface> getInterfacesByIp(IpAddress ip) {
             return AVAILABLE_INTERFACES.stream()
-                    .filter(intf -> intf.ipAddressesList().contains(ip))
+                    .filter(intf -> intf.ipAddressesList().stream()
+                                .map(InterfaceIpAddress::ipAddress)
+                                .filter(ip::equals)
+                                .findAny()
+                                .isPresent())
                     .collect(Collectors.toSet());
         }
 
@@ -410,7 +415,11 @@
         @Override
         public Interface getMatchingInterface(IpAddress ip) {
             return AVAILABLE_INTERFACES.stream()
-                    .filter(intf -> intf.ipAddressesList().contains(ip))
+                    .filter(intf -> intf.ipAddressesList().stream()
+                            .map(InterfaceIpAddress::ipAddress)
+                            .filter(ip::equals)
+                            .findAny()
+                            .isPresent())
                     .findFirst()
                     .orElse(null);
         }
@@ -418,7 +427,11 @@
         @Override
         public Set<Interface> getMatchingInterfaces(IpAddress ip) {
             return AVAILABLE_INTERFACES.stream()
-                    .filter(intf -> intf.ipAddressesList().contains(ip))
+                    .filter(intf -> intf.ipAddressesList().stream()
+                            .map(InterfaceIpAddress::ipAddress)
+                            .filter(ip::equals)
+                            .findAny()
+                            .isPresent())
                     .collect(Collectors.toSet());
         }
     }
diff --git a/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapTest.java b/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapTest.java
index b95b0be..38ceb0b 100644
--- a/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapTest.java
+++ b/apps/vtn/vtnrsc/src/test/java/org/onosproject/vtnrsc/util/VtnEventuallyConsistentMapTest.java
@@ -89,6 +89,7 @@
         return map.get(key);
     }
 
+    @SuppressWarnings("ReturnValueIgnored")
     @Override
     public void put(K key, V value) {
         map.put(key, value);
diff --git a/apps/yms/app/pom.xml b/apps/yms/app/pom.xml
index 08a3713..e65758d 100644
--- a/apps/yms/app/pom.xml
+++ b/apps/yms/app/pom.xml
@@ -66,7 +66,6 @@
             <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
-                <version>3.2.0</version>
                 <extensions>true</extensions>
                 <configuration>
                     <instructions>
@@ -79,6 +78,32 @@
                     </instructions>
                 </configuration>
             </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgs>
+                      <arg>-XepDisableAllChecks</arg>
+                      <arg>-Xep:BetaApi:OFF</arg>
+                    </compilerArgs>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <compilerArgs>
+                              <arg>-XepDisableAllChecks</arg>
+                              <arg>-Xep:BetaApi:OFF</arg>
+                            </compilerArgs>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
         </plugins>
     </build>
 </project>
diff --git a/apps/yms/ut/pom.xml b/apps/yms/ut/pom.xml
index a89438b..ca2f681 100644
--- a/apps/yms/ut/pom.xml
+++ b/apps/yms/ut/pom.xml
@@ -115,6 +115,31 @@
                 </executions>
             </plugin>
 
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgs>
+                      <arg>-XepDisableAllChecks</arg>
+                      <arg>-Xep:BetaApi:OFF</arg>
+                    </compilerArgs>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>compile</goal>
+                        </goals>
+                        <configuration>
+                            <compilerArgs>
+                              <arg>-XepDisableAllChecks</arg>
+                              <arg>-Xep:BetaApi:OFF</arg>
+                            </compilerArgs>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
         </plugins>
     </build>
 </project>
diff --git a/drivers/microsemi/pom.xml b/drivers/microsemi/pom.xml
index ac299d4..92894d0 100644
--- a/drivers/microsemi/pom.xml
+++ b/drivers/microsemi/pom.xml
@@ -147,18 +147,6 @@
     </dependencies>
 
     <build>
-        <pluginManagement>
-            <plugins>
-
-                <plugin>
-                    <groupId>org.apache.karaf.tooling</groupId>
-                    <artifactId>karaf-maven-plugin</artifactId>
-                    <version>3.0.5</version>
-                    <extensions>true</extensions>
-                </plugin>
-
-            </plugins>
-        </pluginManagement>
 
         <plugins>
             <plugin>
diff --git a/lib/pom.xml b/lib/pom.xml
index 7b8f528..c2969eb 100644
--- a/lib/pom.xml
+++ b/lib/pom.xml
@@ -857,6 +857,14 @@
                         </execution>
                     </executions>
                 </plugin>
+
+                <plugin>
+                    <groupId>org.apache.karaf.tooling</groupId>
+                    <artifactId>karaf-maven-plugin</artifactId>
+                    <version>${karaf.version}</version>
+                    <extensions>true</extensions>
+                </plugin>
+
             </plugins>
         </pluginManagement>
 
diff --git a/models/common/pom.xml b/models/common/pom.xml
index 18e4a22..030faf0 100644
--- a/models/common/pom.xml
+++ b/models/common/pom.xml
@@ -116,6 +116,17 @@
                 </executions>
             </plugin>
 
+            <!-- FIXME: YANG tool generates problematic code -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgs>
+                      <arg>-XepDisableAllChecks</arg>
+                      <arg>-Xep:BetaApi:OFF</arg>
+                    </compilerArgs>
+                </configuration>
+            </plugin>
 
         </plugins>
 
diff --git a/models/microsemi/pom.xml b/models/microsemi/pom.xml
index 858828d..7712145 100644
--- a/models/microsemi/pom.xml
+++ b/models/microsemi/pom.xml
@@ -123,6 +123,17 @@
                 </executions>
             </plugin>
 
+            <!-- FIXME: YANG tool generates problematic code -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgs>
+                      <arg>-XepDisableAllChecks</arg>
+                      <arg>-Xep:BetaApi:OFF</arg>
+                    </compilerArgs>
+                </configuration>
+            </plugin>
 
         </plugins>
 
diff --git a/models/openconfig/compile-yangs.sh b/models/openconfig/compile-yangs.sh
new file mode 100755
index 0000000..1d65364
--- /dev/null
+++ b/models/openconfig/compile-yangs.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+YANG_ROOT=$1
+
+CONFDC_ARGS=' -c'
+
+# YANGPATHS
+for path in $(find $YANG_ROOT -type d); do
+  CONFDC_ARGS+=" --yangpath $path"
+done
+
+# create output dir
+mkdir -p fxs
+
+# compile .yang s
+for yang in $(find $YANG_ROOT -type f -name '*.yang'); do
+  BASE=$(basename $yang)
+  OUT="${BASE%.yang}.fxs"
+  echo "Compiling..$yang"
+  confdc $CONFDC_ARGS -o fxs/$OUT -- $yang
+done
diff --git a/models/openconfig/pom.xml b/models/openconfig/pom.xml
index 008311a..8737789 100644
--- a/models/openconfig/pom.xml
+++ b/models/openconfig/pom.xml
@@ -117,6 +117,17 @@
                 </executions>
             </plugin>
 
+            <!-- FIXME: YANG tool generates problematic code -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgs>
+                      <arg>-XepDisableAllChecks</arg>
+                      <arg>-Xep:BetaApi:OFF</arg>
+                    </compilerArgs>
+                </configuration>
+            </plugin>
 
         </plugins>
 
diff --git a/pom.xml b/pom.xml
index 6523be9..9b68af7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -240,4 +240,67 @@
         </dependencies>
     </dependencyManagement>
 
+    <properties>
+        <errorprone.version>2.2.0</errorprone.version>
+        <betachecker.version>1.0</betachecker.version>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.7.0</version>
+                <configuration>
+                    <source>1.8</source>
+                    <target>1.8</target>
+                    <compilerId>javac-with-errorprone</compilerId>
+                    <forceJavacCompilerUse>true</forceJavacCompilerUse>
+                    <annotationProcessorPaths>
+                      <path>
+                        <groupId>com.google.guava</groupId>
+                        <artifactId>guava-beta-checker</artifactId>
+                        <version>${betachecker.version}</version>
+                      </path>
+                    </annotationProcessorPaths>
+                    <compilerArgs>
+                      <arg>-Xep:BetaApi:WARN</arg>
+                      <!-- <arg>-Xep:BetaApi:ERROR</arg>  -->
+                      <!-- Add following to disable error-prone -->
+                      <!-- <arg>-XepDisableAllChecks</arg> -->
+                    </compilerArgs>
+                </configuration>
+                <executions>
+                    <execution>
+                      <id>default-testCompile</id>
+                      <phase>test-compile</phase>
+                      <goals>
+                        <goal>testCompile</goal>
+                      </goals>
+                      <configuration>
+                        <!-- Disable Beta Checker for tests -->
+                        <compilerArgs>
+                          <arg>-Xep:BetaApi:OFF</arg>
+                        </compilerArgs>
+                      </configuration>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                      <groupId>org.codehaus.plexus</groupId>
+                      <artifactId>plexus-compiler-javac-errorprone</artifactId>
+                      <version>2.8.2</version>
+                    </dependency>
+                    <dependency>
+                      <groupId>com.google.errorprone</groupId>
+                      <artifactId>error_prone_core</artifactId>
+                      <!-- override plexus-compiler-javac-errorprone's dependency with the
+                           latest Error Prone version -->
+                      <version>${errorprone.version}</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
diff --git a/protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/OspfNbrImpl.java b/protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/OspfNbrImpl.java
index 68ff4fc..ff3f75b 100644
--- a/protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/OspfNbrImpl.java
+++ b/protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/OspfNbrImpl.java
@@ -218,6 +218,7 @@
      *
      * @return the IP address of this neighbor
      */
+    @Override
     public Ip4Address neighborIpAddr() {
         return neighborIpAddr;
     }
@@ -227,6 +228,7 @@
      *
      * @return true if the neighbor is opaque enabled else false.
      */
+    @Override
     public boolean isOpaqueCapable() {
         return isOpaqueCapable;
     }
@@ -236,6 +238,7 @@
      *
      * @param isOpaqueCapable true if the neighbor is opaque enabledelse false
      */
+    @Override
     public void setIsOpaqueCapable(boolean isOpaqueCapable) {
         this.isOpaqueCapable = isOpaqueCapable;
     }
@@ -245,6 +248,7 @@
      *
      * @param routerDeadInterval router dead interval
      */
+    @Override
     public void setRouterDeadInterval(int routerDeadInterval) {
         this.routerDeadInterval = routerDeadInterval;
     }
@@ -386,7 +390,7 @@
             state = OspfNeighborState.EXCHANGE;
             boolean excludeMaxAgeLsa = true;
             //list of contents of area wise LSA
-            ddSummaryList = (CopyOnWriteArrayList) ospfArea.getLsaHeaders(excludeMaxAgeLsa, isOpaqueCapable);
+            ddSummaryList = ospfArea.getLsaHeaders(excludeMaxAgeLsa, isOpaqueCapable);
 
             if (neighborIsMaster) {
                 processLsas(payload);
@@ -558,6 +562,7 @@
      * @param ch netty channel instance
      * @throws Exception on error
      */
+    @Override
     public void badLSReq(Channel ch) throws Exception {
         log.debug("OSPFNbr::badLSReq...!!!");
 
@@ -837,6 +842,7 @@
      *
      * @param ch netty channel instance
      */
+    @Override
     public void adjOk(Channel ch) {
         log.debug("OSPFNbr::adjOk...!!!");
         if (ospfInterface.interfaceType() != OspfInterfaceType.POINT_TO_POINT.value()) {
@@ -1176,7 +1182,7 @@
             }
         }
         // RFC 2328 Section 13  (6)
-        if (lsReqList.contains(key)) {
+        if (lsReqList.containsValue(key)) {
             badLSReq(ch);
         }
         if (status.equals("same")) { //13 (7)
@@ -1397,6 +1403,7 @@
     /**
      * Starts the inactivity timer.
      */
+    @Override
     public void startInactivityTimeCheck() {
         if (!inActivityTimerScheduled) {
             log.debug("OSPFNbr::startInactivityTimeCheck");
@@ -1411,6 +1418,7 @@
     /**
      * Stops the inactivity timer.
      */
+    @Override
     public void stopInactivityTimeCheck() {
         if (inActivityTimerScheduled) {
             log.debug("OSPFNbr::stopInactivityTimeCheck ");
@@ -1440,6 +1448,7 @@
     /**
      * Stops the flooding timer.
      */
+    @Override
     public void stopFloodingTimer() {
         if (floodingTimerScheduled) {
             log.debug("OSPFNbr::stopFloodingTimer ");
@@ -1467,6 +1476,7 @@
     /**
      * Stops the Dd Retransmission executor task.
      */
+    @Override
     public void stopRxMtDdTimer() {
         if (rxmtDdPacketTimerScheduled) {
             exServiceRxmtDDPacket.shutdown();
@@ -1494,6 +1504,7 @@
     /**
      * Stops Ls request retransmission executor task.
      */
+    @Override
     public void stopRxMtLsrTimer() {
         if (rxmtLsrTimerScheduled) {
             exServiceRxmtLsr.shutdown();
@@ -1524,6 +1535,7 @@
      *
      * @return neighbor id
      */
+    @Override
     public Ip4Address neighborId() {
         return neighborId;
     }
@@ -1533,6 +1545,7 @@
      *
      * @param neighborId neighbor id
      */
+    @Override
     public void setNeighborId(Ip4Address neighborId) {
         this.neighborId = neighborId;
     }
@@ -1542,6 +1555,7 @@
      *
      * @return neighbor DR address
      */
+    @Override
     public Ip4Address neighborDr() {
         return neighborDr;
     }
@@ -1551,6 +1565,7 @@
      *
      * @param neighborDr neighbor DR address
      */
+    @Override
     public void setNeighborDr(Ip4Address neighborDr) {
         this.neighborDr = neighborDr;
     }
@@ -1560,6 +1575,7 @@
      *
      * @return neighbor BDR address
      */
+    @Override
     public Ip4Address neighborBdr() {
         return neighborBdr;
     }
@@ -1569,6 +1585,7 @@
      *
      * @param neighborBdr neighbor BDR address
      */
+    @Override
     public void setNeighborBdr(Ip4Address neighborBdr) {
         this.neighborBdr = neighborBdr;
     }
@@ -1578,6 +1595,7 @@
      *
      * @return router priority
      */
+    @Override
     public int routerPriority() {
         return routerPriority;
     }
@@ -1587,6 +1605,7 @@
      *
      * @param routerPriority router priority
      */
+    @Override
     public void setRouterPriority(int routerPriority) {
         this.routerPriority = routerPriority;
     }
@@ -1596,6 +1615,7 @@
      *
      * @return options value
      */
+    @Override
     public int options() {
         return options;
     }
@@ -1605,6 +1625,7 @@
      *
      * @param options options value
      */
+    @Override
     public void setOptions(int options) {
         this.options = options;
     }
@@ -1614,6 +1635,7 @@
      *
      * @return DD sequence number
      */
+    @Override
     public long ddSeqNum() {
         return ddSeqNum;
     }
@@ -1623,6 +1645,7 @@
      *
      * @param ddSeqNum DD sequence number
      */
+    @Override
     public void setDdSeqNum(long ddSeqNum) {
         this.ddSeqNum = ddSeqNum;
     }
@@ -1632,6 +1655,7 @@
      *
      * @return true if neighbor is master else false
      */
+    @Override
     public int isMaster() {
         return isMaster;
     }
@@ -1677,6 +1701,7 @@
      *
      * @return neighbors state
      */
+    @Override
     public OspfNeighborState getState() {
         return state;
     }
@@ -1695,6 +1720,7 @@
      *
      * @param isMaster neighbor is master or not
      */
+    @Override
     public void setIsMaster(int isMaster) {
         this.isMaster = isMaster;
     }
@@ -1704,6 +1730,7 @@
      *
      * @return ls request list
      */
+    @Override
     public Hashtable getLsReqList() {
         return lsReqList;
     }
@@ -1713,6 +1740,7 @@
      *
      * @return reTxList instance
      */
+    @Override
     public Map getReTxList() {
         return reTxList;
     }
@@ -1722,6 +1750,7 @@
      *
      * @return pendingReTxList instance
      */
+    @Override
     public Map<String, OspfLsa> getPendingReTxList() {
         return pendingReTxList;
     }
diff --git a/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java b/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
index 664aaa4..d1afdc6 100644
--- a/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
+++ b/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
@@ -217,7 +217,7 @@
 
     TunnelProviderService service;
 
-    HashMap<String, TunnelId> tunnelMap = new HashMap<String, TunnelId>();
+    HashMap<String, TunnelId> tunnelMap = new HashMap<>();
     HashMap<TunnelId, TunnelStatistics> tunnelStatisticsMap = new HashMap<>();
     private HashMap<String, TunnelStatsCollector> collectors = Maps.newHashMap();
 
@@ -885,7 +885,7 @@
      * @return list of ERO subobjects
      */
     private LinkedList<PcepValueType> createPcepPath(Path path) {
-        LinkedList<PcepValueType> llSubObjects = new LinkedList<PcepValueType>();
+        LinkedList<PcepValueType> llSubObjects = new LinkedList<>();
         List<Link> listLink = path.links();
         ConnectPoint source = null;
         ConnectPoint destination = null;
@@ -952,7 +952,7 @@
             return null;
         }
 
-        LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
+        LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>();
 
         // set PathSetupTypeTlv of SRP object
         tlv = new PathSetupTypeTlv(lspType.type());
@@ -962,8 +962,8 @@
         PcepSrpObject srpobj = pc.factory().buildSrpObject().setSrpID(srpId).setRFlag(false)
                 .setOptionalTlv(llOptionalTlv).build();
 
-        llOptionalTlv = new LinkedList<PcepValueType>();
-        LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = new LinkedList<PcInitiatedLspRequest>();
+        llOptionalTlv = new LinkedList<>();
+        LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = new LinkedList<>();
 
         // set LSP identifiers TLV
         short localLspId = 0;
@@ -1089,7 +1089,7 @@
             int srpId = SrpIdGenerators.create();
 
             PcepValueType tlv;
-            LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
+            LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>();
 
             // set PathSetupTypeTlv of SRP object
             tlv = new PathSetupTypeTlv(LspType.valueOf(tunnel.annotations().value(LSP_SIG_TYPE))
@@ -1100,8 +1100,8 @@
             PcepSrpObject srpobj = pc.factory().buildSrpObject().setSrpID(srpId).setRFlag(true)
                     .setOptionalTlv(llOptionalTlv).build();
 
-            llOptionalTlv = new LinkedList<PcepValueType>();
-            LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = new LinkedList<PcInitiatedLspRequest>();
+            llOptionalTlv = new LinkedList<>();
+            LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = new LinkedList<>();
 
             tlv = new SymbolicPathNameTlv(tunnel.tunnelName().value().getBytes());
             llOptionalTlv.add(tlv);
@@ -1183,8 +1183,8 @@
                 llSubObjects = createPcepPath(path);
             }
 
-            LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
-            LinkedList<PcepUpdateRequest> llUpdateRequestList = new LinkedList<PcepUpdateRequest>();
+            LinkedList<PcepValueType> llOptionalTlv = new LinkedList<>();
+            LinkedList<PcepUpdateRequest> llUpdateRequestList = new LinkedList<>();
 
             // set PathSetupTypeTlv of SRP object
             tlv = new PathSetupTypeTlv(lspSigType.type());
@@ -1194,7 +1194,7 @@
             PcepSrpObject srpobj = pc.factory().buildSrpObject().setSrpID(srpId).setRFlag(false)
                     .setOptionalTlv(llOptionalTlv).build();
 
-            llOptionalTlv = new LinkedList<PcepValueType>();
+            llOptionalTlv = new LinkedList<>();
 
             // Lsp Identifier tlv is required for all modes of lsp
             String localLspIdString = tunnel.annotations().value(LOCAL_LSP_ID);
@@ -1661,7 +1661,7 @@
                 if (mastershipService.isLocalMaster(deviceId)) {
                     TunnelId tId = tunnelAdded(td, tunnelState);
                     Tunnel tunnelInserted = new DefaultTunnel(providerId, tunnelEndPointSrc, tunnelEndPointDst, MPLS,
-                            tunnelState, new GroupId(0), tId, TunnelName.tunnelName(String.valueOf(pathNameTlv
+                            tunnelState, new GroupId(0), tId, TunnelName.tunnelName(Arrays.toString(pathNameTlv
                                     .getValue())), path, labelStack, annotations);
 
                     PcepTunnelData pcepTunnelData = new PcepTunnelData(tunnelInserted, path, LSP_STATE_RPT);
diff --git a/utils/junit/pom.xml b/utils/junit/pom.xml
index e0846ed..c30eaf2 100644
--- a/utils/junit/pom.xml
+++ b/utils/junit/pom.xml
@@ -53,4 +53,20 @@
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <compilerArgs>
+                      <arg>-Xep:BetaApi:OFF</arg>
+                    </compilerArgs>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
 </project>
diff --git a/utils/misc/pom.xml b/utils/misc/pom.xml
index 653ed4a..1bfc038 100644
--- a/utils/misc/pom.xml
+++ b/utils/misc/pom.xml
@@ -31,7 +31,6 @@
     <description>Miscellaneous ON.Lab utilities</description>
 
     <properties>
-        <metrics.version>3.1.2</metrics.version>
     </properties>
 
     <dependencies>
@@ -77,12 +76,10 @@
         <dependency>
             <groupId>io.dropwizard.metrics</groupId>
             <artifactId>metrics-core</artifactId>
-            <version>${metrics.version}</version>
         </dependency>
         <dependency>
             <groupId>io.dropwizard.metrics</groupId>
             <artifactId>metrics-json</artifactId>
-            <version>${metrics.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.felix</groupId>
diff --git a/utils/misc/src/main/java/org/onlab/util/Tools.java b/utils/misc/src/main/java/org/onlab/util/Tools.java
index 0989010..bf9bea0 100644
--- a/utils/misc/src/main/java/org/onlab/util/Tools.java
+++ b/utils/misc/src/main/java/org/onlab/util/Tools.java
@@ -162,7 +162,7 @@
      * @param collection collection to test
      * @return true if null or empty; false otherwise
      */
-    public static boolean isNullOrEmpty(Collection collection) {
+    public static boolean isNullOrEmpty(Collection<?> collection) {
         return collection == null || collection.isEmpty();
     }