summaryrefslogtreecommitdiffstats
path: root/policy-utils
diff options
context:
space:
mode:
Diffstat (limited to 'policy-utils')
-rw-r--r--policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java4
-rw-r--r--policy-utils/src/test/java/org/openecomp/policy/drools/utils/PropertyUtilTest.java13
2 files changed, 8 insertions, 9 deletions
diff --git a/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java b/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java
index 809d3679..c5f9a343 100644
--- a/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java
+++ b/policy-utils/src/main/java/org/openecomp/policy/drools/utils/OrderedServiceImpl.java
@@ -45,7 +45,7 @@ public class OrderedServiceImpl<T extends OrderedService>
* @param clazz the class object associated with 'T' (I supposed it could
* be a subclass, but I'm not sure this is useful)
*/
- public OrderedServiceImpl(Class clazz)
+ public OrderedServiceImpl(Class<T> clazz)
{
// This constructor wouldn't be needed if 'T.class' was legal
serviceLoader = ServiceLoader.load(clazz);
@@ -75,6 +75,7 @@ public class OrderedServiceImpl<T extends OrderedService>
* @return the sorted list of services implementing interface 'T' discovered
* by 'ServiceLoader'.
*/
+ @SuppressWarnings("unchecked")
public synchronized List<T> rebuildList()
{
// build a list of all of the current implementors
@@ -117,6 +118,7 @@ public class OrderedServiceImpl<T extends OrderedService>
}
// use this to ensure that we only use one unique instance of each class
+ @SuppressWarnings("rawtypes")
static private HashMap<Class,OrderedService> classToSingleton =
new HashMap<>();
diff --git a/policy-utils/src/test/java/org/openecomp/policy/drools/utils/PropertyUtilTest.java b/policy-utils/src/test/java/org/openecomp/policy/drools/utils/PropertyUtilTest.java
index 55091718..32386725 100644
--- a/policy-utils/src/test/java/org/openecomp/policy/drools/utils/PropertyUtilTest.java
+++ b/policy-utils/src/test/java/org/openecomp/policy/drools/utils/PropertyUtilTest.java
@@ -20,11 +20,7 @@
package org.openecomp.policy.drools.utils;
-import static org.junit.Assert.*;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.FileOutputStream;
@@ -35,8 +31,9 @@ import java.util.Set;
import java.util.TreeSet;
import java.util.UUID;
-import org.apache.log4j.Logger;
-
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
import org.openecomp.policy.common.logging.eelf.PolicyLogger;
public class PropertyUtilTest
@@ -198,7 +195,7 @@ public class PropertyUtilTest
assertEquals(prop2, returns[0]);
// verify that we have the expected set of keys
- assertEquals(new TreeSet(Arrays.asList(new String[]{"p1", "p2", "p4"})),
+ assertEquals(new TreeSet<String>(Arrays.asList(new String[]{"p1", "p2", "p4"})),
returns[1]);
}
}