Enforce modernizer in openflowplugin 93/94393/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Jan 2021 09:57:21 +0000 (10:57 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Jan 2021 09:57:52 +0000 (10:57 +0100)
Fix the two remaining issue and flip enforcement on.

Change-Id: I0b542fdb08bc61214d72fc5b87da295d1e2f9eb2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
openflowplugin/pom.xml
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/ConvertorCase.java
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/convertor/common/ConvertorKey.java

index 54c51a130e9d91f25964de9a3713d6cbe0d0ff26..17ab71b413a6f61a6f492113d3006f144f2cd5ba 100644 (file)
     <artifactId>openflowplugin</artifactId>
     <packaging>bundle</packaging>
 
-    <properties>
-        <!-- FIXME: Remove this -->
-        <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
-    </properties>
-
     <build>
         <plugins>
             <plugin>
index 7e2f9eba4b86affa1fa158229600746a6718901b..c50242b65641b9e2ae59bef56c6da5a91623c458 100644 (file)
@@ -5,10 +5,10 @@
  * 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.openflowplugin.openflow.md.core.sal.convertor.common;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.Arrays;
 import java.util.List;
 import java.util.Optional;
@@ -35,10 +35,10 @@ public abstract class ConvertorCase<F, T, D extends ConvertorData> {
      * @param errorOnEmpty      the error on empty
      * @param supportedVersions the supported versions
      */
-    protected ConvertorCase(Class<F> type, boolean errorOnEmpty, Short... supportedVersions) {
+    protected ConvertorCase(final Class<F> type, final boolean errorOnEmpty, final Short... supportedVersions) {
         this.type = type;
         this.errorOnEmpty = errorOnEmpty;
-        this.supportedVersions = Arrays.asList(Preconditions.checkNotNull(supportedVersions));
+        this.supportedVersions = Arrays.asList(requireNonNull(supportedVersions));
     }
 
     /**
index 736b889175b0b0ae0dce42d8754acaf636e8f06c..3a1b0da346341a71077c17ff86ae2d10956f9c0c 100644 (file)
@@ -7,9 +7,10 @@
  */
 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common;
 
+import static java.util.Objects.requireNonNull;
+
 import com.google.common.base.MoreObjects;
 import com.google.common.base.MoreObjects.ToStringHelper;
-import com.google.common.base.Preconditions;
 
 /**
  * Injection lookup key based on version and target object.
@@ -27,7 +28,7 @@ public class ConvertorKey {
      */
     public ConvertorKey(final int version, final Class<?> targetClazz) {
         this.version = version;
-        this.targetClazz = Preconditions.checkNotNull(targetClazz);
+        this.targetClazz = requireNonNull(targetClazz);
     }
 
     @Override