summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-07-03 07:51:17 -0500
committerInstrumental <jonathan.gathman@att.com>2018-07-03 12:06:59 -0500
commitf85f0889b3b0e5e9694afab4dd01a4a97a155188 (patch)
tree4a7119cfa0a112e514f50bbc2961981c3670ea03 /misc
parent8efa968683ef2c4ab0ae7f4c0d2ccb0fcaa8af7b (diff)
Collection syntax change because of Sonar
Issue-ID: AAF-386 Change-Id: I8ba8d8561d03e680ddc90a81b8db0339814c65fa Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'misc')
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java20
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java2
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java2
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java2
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java2
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java2
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java2
-rw-r--r--misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java6
-rw-r--r--misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java4
-rw-r--r--misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java6
-rw-r--r--misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java4
-rw-r--r--misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java4
-rw-r--r--misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java2
-rw-r--r--misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java20
-rw-r--r--misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java12
-rw-r--r--misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java2
16 files changed, 46 insertions, 46 deletions
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java b/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java
index 54b0ce83..685bfb6e 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java
@@ -65,21 +65,21 @@ public class StoreImpl implements Store {
public StoreImpl() {
staticState = new Object[growSize];
- staticMap = new HashMap<String,StaticSlot>();
- localMap = new HashMap<String,Slot>();
+ staticMap = new HashMap<>();
+ localMap = new HashMap<>();
}
public StoreImpl(String tag) {
staticState = new Object[growSize];
- staticMap = new HashMap<String,StaticSlot>();
- localMap = new HashMap<String,Slot>();
+ staticMap = new HashMap<>();
+ localMap = new HashMap<>();
}
public StoreImpl(String tag, String[] args) {
staticState = new Object[growSize];
- staticMap = new HashMap<String,StaticSlot>();
- localMap = new HashMap<String,Slot>();
+ staticMap = new HashMap<>();
+ localMap = new HashMap<>();
if(tag!=null) {
String tequals = tag + '=';
@@ -102,8 +102,8 @@ public class StoreImpl implements Store {
public StoreImpl(String tag, Properties props) {
staticState = new Object[growSize];
- staticMap = new HashMap<String,StaticSlot>();
- localMap = new HashMap<String,Slot>();
+ staticMap = new HashMap<>();
+ localMap = new HashMap<>();
if(tag!=null) {
String fname = props.getProperty(tag);
@@ -191,7 +191,7 @@ public class StoreImpl implements Store {
* @see com.att.env.Store#existingSlotNames()
*/
public List<String> existingSlotNames() {
- return new ArrayList<String>(localMap.keySet());
+ return new ArrayList<>(localMap.keySet());
}
/* (non-Javadoc)
@@ -234,7 +234,7 @@ public class StoreImpl implements Store {
}
public List<String> existingStaticSlotNames() {
- return new ArrayList<String>(staticMap.keySet());
+ return new ArrayList<>(staticMap.keySet());
}
}
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java
index f10de386..e378e2c3 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java
@@ -37,7 +37,7 @@ public abstract class AbsTrans<ENV extends Env> implements TransStore {
private static final Object[] EMPTYO = new Object[0];
protected ENV delegate;
- protected List<TimeTaken> trail = new ArrayList<TimeTaken>(30);
+ protected List<TimeTaken> trail = new ArrayList<>(30);
private Object[] state;
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java
index 2a3628d3..cd62a7e5 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java
@@ -84,7 +84,7 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate<TransJAX
*/
public BasicEnv(Applet applet, String ... tags) {
super(null, tags);
-// props = new HashMap<String, String>();
+// props = new HashMap<>();
// String value;
// for(int i=0;i<tags.length;++i) {
// value = applet.getParameter(tags[i]);
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java
index 127eb154..4a01d8b1 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java
@@ -64,7 +64,7 @@ import org.onap.aaf.misc.env.util.Pool.Pooled;
*/
public class JAXBmar {
// Need to store off possible JAXBContexts based on Class, which will be stored in Creator
- private static Map<Class<?>[],Pool<PMarshaller>> pools = new HashMap<Class<?>[], Pool<PMarshaller>>();
+ private static Map<Class<?>[],Pool<PMarshaller>> pools = new HashMap<>();
// Handle Marshaller class setting of properties only when needed
private class PMarshaller {
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java
index 74072aaf..0c078a98 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java
@@ -68,7 +68,7 @@ import org.w3c.dom.Node;
*/
public class JAXBumar {
// Need to store off possible JAXBContexts based on Class, which will be stored in Creator
- private static Map<Class<?>[],Pool<SUnmarshaller>> pools = new HashMap<Class<?>[], Pool<SUnmarshaller>>();
+ private static Map<Class<?>[],Pool<SUnmarshaller>> pools = new HashMap<>();
private Class<?> cls;
private Schema schema;
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java
index 1694a011..82f05b4a 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java
@@ -104,7 +104,7 @@ public class Pool<T> {
public Pool(Creator<T> creator) {
count = spares = 0;
this.creator = creator;
- list = new LinkedList<Pooled<T>>();
+ list = new LinkedList<>();
}
/**
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java b/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java
index 56cd54e5..6892a4b5 100644
--- a/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java
+++ b/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java
@@ -69,7 +69,7 @@ public class RefreshableThreadObject<T extends Creatable<T>> {
* @throws APIException
*/
public RefreshableThreadObject(Class<T> clss) throws APIException {
- objs = new ConcurrentHashMap<Thread,T>();
+ objs = new ConcurrentHashMap<>();
try {
cnst = clss.getConstructor(new Class[]{Env.class} );
} catch (Exception e) {
diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java
index 48275926..da66394c 100644
--- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java
+++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java
@@ -205,7 +205,7 @@ public class InXML implements Parse<Reader, State> {
String value = sb.toString();
sb.setLength(0);
if(tag !=null && value != null) {
- if(props==null)props = new ArrayList<Prop>();
+ if(props==null)props = new ArrayList<>();
props.add(new Prop(tag,value));
}
}
@@ -251,7 +251,7 @@ public class InXML implements Parse<Reader, State> {
public void push(Prop prop) {
if(attribs==null) {
- attribs = new ArrayList<Prop>();
+ attribs = new ArrayList<>();
idx = 0;
}
attribs.add(prop);
@@ -291,7 +291,7 @@ public class InXML implements Parse<Reader, State> {
private void addNS(Prop prop) {
Map<String,String> existingNS = getNS();
- if(ns==null)ns = new HashMap<String,String>();
+ if(ns==null)ns = new HashMap<>();
// First make a copy of previous NSs so that we have everything we need, but can overwrite, if necessary
if(existingNS!=null && ns!=existingNS) {
ns.putAll(ns);
diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java
index 5f38c8c7..6c20ba25 100644
--- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java
+++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java
@@ -74,7 +74,7 @@ public class JaxInfo {
JaxInfo derived;
// Lazy Instantiation
if(extensions == null) {
- extensions = new HashMap<String,JaxInfo>();
+ extensions = new HashMap<>();
derived = null;
} else {
derived = extensions.get(derivedName);
@@ -163,7 +163,7 @@ public class JaxInfo {
// Build up Method names from JAXB Annotations
XmlType xt;
while((xt = cls.getAnnotation(XmlType.class))!=null) {
- if(fields==null)fields = new ArrayList<JaxInfo>();
+ if(fields==null)fields = new ArrayList<>();
for(String field : xt.propOrder()) {
if("".equals(field)) break; // odd bug. "" returned when no fields exist, rather than empty array
Field rf = cls.getDeclaredField(field);
diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java
index bb6784c8..04d61581 100644
--- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java
+++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java
@@ -38,11 +38,11 @@ import javax.xml.bind.annotation.XmlType;
* @param <T>
*/
public class JaxSet<T> {
- private static Map<Class<?>,JaxSet<?>> jsets = new HashMap<Class<?>,JaxSet<?>>();
+ private static Map<Class<?>,JaxSet<?>> jsets = new HashMap<>();
private Map<String,Setter<T>> members;
private JaxSet(Class<?> cls) {
- members = new TreeMap<String, Setter<T>>();
+ members = new TreeMap<>();
XmlType xmltype = cls.getAnnotation(XmlType.class);
Class<?> paramType[] = new Class[] {String.class};
for(String str : xmltype.propOrder()) {
@@ -79,7 +79,7 @@ public class JaxSet<T> {
@SuppressWarnings("unchecked")
JaxSet<X> js = (JaxSet<X>)jsets.get(cls);
if(js == null) {
- jsets.put(cls, js = new JaxSet<X>(cls));
+ jsets.put(cls, js = new JaxSet<>(cls));
}
return js;
}
diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java
index f3ce1c22..8557c584 100644
--- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java
+++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java
@@ -42,7 +42,7 @@ public class OutXML extends Out{
public OutXML(String root, String ... params) {
this.root = root;
- props = new ArrayList<Prop>();
+ props = new ArrayList<>();
for(String p : params) {
String[] tv=p.split("=");
if(tv.length==2)
@@ -164,7 +164,7 @@ public class OutXML extends Out{
}
if(create && !rv) {
- if(nses == null) nses = new HashMap<String,String>();
+ if(nses == null) nses = new HashMap<>();
nses.put(ns, value);
}
return rv;
diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java
index f1cde6e5..aac1e30f 100644
--- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java
+++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java
@@ -106,8 +106,8 @@ public class XmlEscape {
}
static {
- charMap = new TreeMap<String, Integer>();
- intMap = new TreeMap<Integer,String>();
+ charMap = new TreeMap<>();
+ intMap = new TreeMap<>();
charMap.put("quot", 34);
charMap.put("amp",38);
charMap.put("apos",39);
diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java
index 74b590da..417f80b7 100644
--- a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java
+++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java
@@ -42,7 +42,7 @@ public abstract class CacheGen<G extends XGen<G>> {
public final static int HTML5 = 0x8;
- private ArrayList<Section<G>> sections = new ArrayList<Section<G>>();
+ private ArrayList<Section<G>> sections = new ArrayList<>();
private int flags;
private final Thematic thematic;
diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java
index 18b33938..9160095d 100644
--- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java
+++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java
@@ -60,7 +60,7 @@ public class JU_HTML4GenTest {
gen.html("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : DOCTYPE.toCharArray()) {
Integer times = map.get(ch);
map.put(ch, (times == null ? 0 : times) + 1);
@@ -84,7 +84,7 @@ public class JU_HTML4GenTest {
gen.head();
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "head".toCharArray()) {
Integer times = map.get(ch);
@@ -103,7 +103,7 @@ public class JU_HTML4GenTest {
gen.body("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "body".toCharArray()) {
Integer times = map.get(ch);
@@ -126,7 +126,7 @@ public class JU_HTML4GenTest {
gen.charset(charset);
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : CHARSET_LINE.toCharArray()) {
Integer times = map.get(ch);
@@ -145,7 +145,7 @@ public class JU_HTML4GenTest {
gen.header("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "header".toCharArray()) {
Integer times = map.get(ch);
@@ -174,7 +174,7 @@ public class JU_HTML4GenTest {
gen.footer("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "footer".toCharArray()) {
Integer times = map.get(ch);
@@ -203,7 +203,7 @@ public class JU_HTML4GenTest {
gen.section("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "section".toCharArray()) {
Integer times = map.get(ch);
@@ -232,7 +232,7 @@ public class JU_HTML4GenTest {
gen.article("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "attrib".toCharArray()) {
Integer times = map.get(ch);
@@ -261,7 +261,7 @@ public class JU_HTML4GenTest {
gen.aside("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "aside".toCharArray()) {
Integer times = map.get(ch);
@@ -290,7 +290,7 @@ public class JU_HTML4GenTest {
gen.nav("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "nav".toCharArray()) {
Integer times = map.get(ch);
diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java
index 953a4a3b..69ebf89b 100644
--- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java
+++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java
@@ -36,8 +36,8 @@ import org.mockito.Mock;
public class JU_HTML5GenTest {
- private final static String DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
- + " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
+// private final static String DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
+// + " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
private String charset = "utf-8";
@@ -59,7 +59,7 @@ public class JU_HTML5GenTest {
gen.html("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "html".toCharArray()) {
Integer times = map.get(ch);
@@ -79,7 +79,7 @@ public class JU_HTML5GenTest {
gen.head();
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "head".toCharArray()) {
Integer times = map.get(ch);
@@ -98,7 +98,7 @@ public class JU_HTML5GenTest {
gen.body("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "body".toCharArray()) {
Integer times = map.get(ch);
@@ -121,7 +121,7 @@ public class JU_HTML5GenTest {
gen.charset(charset);
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : CHARSET_LINE.toCharArray()) {
Integer times = map.get(ch);
diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java
index 2dbc422a..1c00b452 100644
--- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java
+++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java
@@ -41,7 +41,7 @@ public class JU_XMLGenTest {
String XML_TAG = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
@Before
public void setUp() throws Exception {