aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/resources/TextFileUtils.java3
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/services/FeatureApiUtils.java2
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/services/OrderedServiceImpl.java4
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/validation/Version.java3
-rw-r--r--utils/src/test/java/org/onap/policy/common/utils/properties/PropertyObjectUtilsTest.java6
-rw-r--r--utils/src/test/java/org/onap/policy/common/utils/properties/exception/PropertyAccessExceptionTest.java8
-rw-r--r--utils/src/test/java/org/onap/policy/common/utils/services/FeatureApiUtilsTest.java2
7 files changed, 13 insertions, 15 deletions
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 <T> boolean apply(List<T> providers, Predicate<T> predicate,
- BiConsumer<T,Exception> handleEx) {
+ BiConsumer<T, Exception> 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<T extends OrderedService> {
private ServiceLoader<T> serviceLoader = null;
// use this to ensure that we only use one unique instance of each class
- private static Map<Class<?>,OrderedService> classToSingleton = new HashMap<>();
+ private static Map<Class<?>, OrderedService> classToSingleton = new HashMap<>();
/**
* Constructor - create the 'ServiceLoader' instance.
@@ -86,7 +86,7 @@ public class OrderedServiceImpl<T extends OrderedService> {
// build a list of all of the current implementors
List<T> 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<Version> {
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<String, Object> result = PropertyObjectUtils.toObject(props, "");
// @formatter:off
- Map<String,Object> map =
+ Map<String, Object> map =
Map.of("abc",
Arrays.asList(null, "expand.ghi", "expand.def"));
// @formatter:on
@@ -119,7 +119,7 @@ public class PropertyObjectUtilsTest {
Map<String, Object> result = PropertyObjectUtils.toObject(props, "");
// @formatter:off
- Map<String,Object> map =
+ Map<String, Object> map =
Map.of("object",
Map.of("abc",
Map.of("ghi", "object.jkl")));
@@ -134,7 +134,7 @@ public class PropertyObjectUtilsTest {
Map<String, Object> result = PropertyObjectUtils.toObject(props, "");
// @formatter:off
- Map<String,Object> map =
+ Map<String, Object> 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<String> 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());
}