Enforce modernizer in openflowplugin-impl 87/105787/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 2 May 2023 17:09:31 +0000 (19:09 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 2 May 2023 17:09:31 +0000 (19:09 +0200)
We are using different objects here, which unfortunately is bound to
break at some point in the future. For now change the values to lie
outside of the cached range, use Integer.valueOf() and flip modernizer
to enforcing mode.

Change-Id: I8b2a1f4c24846d4d95fc610f25de1fa978b8e649
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
openflowplugin-impl/pom.xml
openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/FlowCreatorUtilTest.java

index c5faa268fc04acccc32afd618d1da678b2984236..8fc170bb1036781ced7494f3e7bf819294594f36 100644 (file)
     <artifactId>openflowplugin-impl</artifactId>
     <packaging>bundle</packaging>
 
-    <properties>
-        <!-- FIXME: Remove this -->
-        <odlparent.modernizer.enforce>false</odlparent.modernizer.enforce>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.osgi</groupId>
index 29d1fcd443be313cbf9ec9f17b2f7dff389728e3..aa8ab494c17c412802e2734e82048d64c3972303 100644 (file)
@@ -264,14 +264,14 @@ public class FlowCreatorUtilTest {
         }
 
         // Integer
-        final Integer[] integers = {-100, 0, 100,};
+        final Integer[] integers = {-1000, 0, 1000,};
         for (final Integer def : integers) {
-            final Integer same = new Integer(def);
+            final Integer same = Integer.valueOf(def);
             assertTrue(FlowCreatorUtil.equalsWithDefault(null, null, def));
             assertTrue(FlowCreatorUtil.equalsWithDefault(same, null, def));
             assertTrue(FlowCreatorUtil.equalsWithDefault(null, same, def));
 
-            final Integer diff = new Integer(def.intValue() + 1);
+            final Integer diff = Integer.valueOf(def.intValue() + 1);
             assertFalse(FlowCreatorUtil.equalsWithDefault(null, diff, def));
             assertFalse(FlowCreatorUtil.equalsWithDefault(diff, null, def));
         }