From 5f7b54c3c5d8b67aaec2371f02cbaa174e4db0b2 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Tue, 2 May 2023 19:09:31 +0200 Subject: [PATCH] Enforce modernizer in openflowplugin-impl 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 --- openflowplugin-impl/pom.xml | 5 ----- .../openflowplugin/impl/util/FlowCreatorUtilTest.java | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/openflowplugin-impl/pom.xml b/openflowplugin-impl/pom.xml index c5faa268fc..8fc170bb10 100644 --- a/openflowplugin-impl/pom.xml +++ b/openflowplugin-impl/pom.xml @@ -11,11 +11,6 @@ openflowplugin-impl bundle - - - false - - org.osgi diff --git a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/FlowCreatorUtilTest.java b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/FlowCreatorUtilTest.java index 29d1fcd443..aa8ab494c1 100644 --- a/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/FlowCreatorUtilTest.java +++ b/openflowplugin-impl/src/test/java/org/opendaylight/openflowplugin/impl/util/FlowCreatorUtilTest.java @@ -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)); } -- 2.36.6