From 50d72892e98753fd012aff00c2d42979dce9653e Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 18 Jun 2020 13:49:01 +0100 Subject: Changes for checkstyle 8.32 Issue-ID: POLICY-2188 Change-Id: I00843c61a6567001fc35c3ebb77b6843a1eb7da2 Signed-off-by: liamfallon --- .../org/onap/policy/common/utils/resources/TextFileUtils.java | 3 +-- .../org/onap/policy/common/utils/services/FeatureApiUtils.java | 2 +- .../org/onap/policy/common/utils/services/OrderedServiceImpl.java | 4 ++-- .../java/org/onap/policy/common/utils/validation/Version.java | 3 +-- .../policy/common/utils/properties/PropertyObjectUtilsTest.java | 6 +++--- .../utils/properties/exception/PropertyAccessExceptionTest.java | 8 ++++---- .../onap/policy/common/utils/services/FeatureApiUtilsTest.java | 2 +- 7 files changed, 13 insertions(+), 15 deletions(-) (limited to 'utils') diff --git a/utils/src/main/java/org/onap/policy/common/utils/resources/TextFileUtils.java b/utils/src/main/java/org/onap/policy/common/utils/resources/TextFileUtils.java index c5b8c981..2810c7be 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/resources/TextFileUtils.java +++ b/utils/src/main/java/org/onap/policy/common/utils/resources/TextFileUtils.java @@ -108,8 +108,7 @@ public abstract class TextFileUtils { if (charsRead > 0) { builder.append(chars, 0, charsRead); } - } - while (charsRead > 0); + } while (charsRead > 0); return builder.toString(); } } diff --git a/utils/src/main/java/org/onap/policy/common/utils/services/FeatureApiUtils.java b/utils/src/main/java/org/onap/policy/common/utils/services/FeatureApiUtils.java index e88361ea..332e0f67 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/services/FeatureApiUtils.java +++ b/utils/src/main/java/org/onap/policy/common/utils/services/FeatureApiUtils.java @@ -44,7 +44,7 @@ public class FeatureApiUtils { * otherwise */ public static boolean apply(List providers, Predicate predicate, - BiConsumer handleEx) { + BiConsumer handleEx) { for (T feature : providers) { try { diff --git a/utils/src/main/java/org/onap/policy/common/utils/services/OrderedServiceImpl.java b/utils/src/main/java/org/onap/policy/common/utils/services/OrderedServiceImpl.java index 7c5c9cbb..998d6742 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/services/OrderedServiceImpl.java +++ b/utils/src/main/java/org/onap/policy/common/utils/services/OrderedServiceImpl.java @@ -44,7 +44,7 @@ public class OrderedServiceImpl { private ServiceLoader serviceLoader = null; // use this to ensure that we only use one unique instance of each class - private static Map,OrderedService> classToSingleton = new HashMap<>(); + private static Map, OrderedService> classToSingleton = new HashMap<>(); /** * Constructor - create the 'ServiceLoader' instance. @@ -86,7 +86,7 @@ public class OrderedServiceImpl { // build a list of all of the current implementors List tmp = new LinkedList<>(); for (T service : serviceLoader) { - tmp.add((T)getSingleton(service)); + tmp.add((T) getSingleton(service)); } // Sort the list according to sequence number, and then alphabetically diff --git a/utils/src/main/java/org/onap/policy/common/utils/validation/Version.java b/utils/src/main/java/org/onap/policy/common/utils/validation/Version.java index efbf9378..527113dd 100644 --- a/utils/src/main/java/org/onap/policy/common/utils/validation/Version.java +++ b/utils/src/main/java/org/onap/policy/common/utils/validation/Version.java @@ -62,8 +62,7 @@ public class Version implements Comparable { this.major = newVersion.major; this.minor = newVersion.minor; this.patch = newVersion.patch; - } - else { + } else { this.major = 0; this.minor = 0; this.patch = 0; diff --git a/utils/src/test/java/org/onap/policy/common/utils/properties/PropertyObjectUtilsTest.java b/utils/src/test/java/org/onap/policy/common/utils/properties/PropertyObjectUtilsTest.java index 83b264f5..93b30643 100644 --- a/utils/src/test/java/org/onap/policy/common/utils/properties/PropertyObjectUtilsTest.java +++ b/utils/src/test/java/org/onap/policy/common/utils/properties/PropertyObjectUtilsTest.java @@ -104,7 +104,7 @@ public class PropertyObjectUtilsTest { Map result = PropertyObjectUtils.toObject(props, ""); // @formatter:off - Map map = + Map map = Map.of("abc", Arrays.asList(null, "expand.ghi", "expand.def")); // @formatter:on @@ -119,7 +119,7 @@ public class PropertyObjectUtilsTest { Map result = PropertyObjectUtils.toObject(props, ""); // @formatter:off - Map map = + Map map = Map.of("object", Map.of("abc", Map.of("ghi", "object.jkl"))); @@ -134,7 +134,7 @@ public class PropertyObjectUtilsTest { Map result = PropertyObjectUtils.toObject(props, ""); // @formatter:off - Map map = + Map map = Map.of("array", Map.of("abc", List.of( diff --git a/utils/src/test/java/org/onap/policy/common/utils/properties/exception/PropertyAccessExceptionTest.java b/utils/src/test/java/org/onap/policy/common/utils/properties/exception/PropertyAccessExceptionTest.java index 27b0e850..ef2051d8 100644 --- a/utils/src/test/java/org/onap/policy/common/utils/properties/exception/PropertyAccessExceptionTest.java +++ b/utils/src/test/java/org/onap/policy/common/utils/properties/exception/PropertyAccessExceptionTest.java @@ -34,10 +34,10 @@ public class PropertyAccessExceptionTest extends SupportBasicPropertyExceptionTe */ @Test public void testPropertyAccessExceptionStringField() { - verifyPropertyExceptionStringField_AllPopulated( new PropertyAccessException(PROPERTY, FIELD)); - verifyPropertyExceptionStringField_NullProperty( new PropertyAccessException(null, FIELD)); - verifyPropertyExceptionStringField_NullField( new PropertyAccessException(PROPERTY, null)); - verifyPropertyExceptionStringField_BothNull( new PropertyAccessException(null, null)); + verifyPropertyExceptionStringField_AllPopulated(new PropertyAccessException(PROPERTY, FIELD)); + verifyPropertyExceptionStringField_NullProperty(new PropertyAccessException(null, FIELD)); + verifyPropertyExceptionStringField_NullField(new PropertyAccessException(PROPERTY, null)); + verifyPropertyExceptionStringField_BothNull(new PropertyAccessException(null, null)); } /** diff --git a/utils/src/test/java/org/onap/policy/common/utils/services/FeatureApiUtilsTest.java b/utils/src/test/java/org/onap/policy/common/utils/services/FeatureApiUtilsTest.java index 232d3409..d111962e 100644 --- a/utils/src/test/java/org/onap/policy/common/utils/services/FeatureApiUtilsTest.java +++ b/utils/src/test/java/org/onap/policy/common/utils/services/FeatureApiUtilsTest.java @@ -61,7 +61,7 @@ public class FeatureApiUtilsTest { public void testApplyFeatureFalse() { List lst = Arrays.asList("falseF1", "exceptF2", "falseF3"); - assertFalse(FeatureApiUtils.apply(lst, pred, (str,ex) -> errors.add(str))); + assertFalse(FeatureApiUtils.apply(lst, pred, (str, ex) -> errors.add(str))); assertEquals(lst.toString(), tried.toString()); assertEquals("[exceptF2]", errors.toString()); } -- cgit 1.2.3-korg