diff options
author | Instrumental <jonathan.gathman@att.com> | 2018-07-03 07:51:17 -0500 |
---|---|---|
committer | Instrumental <jonathan.gathman@att.com> | 2018-07-03 12:06:59 -0500 |
commit | f85f0889b3b0e5e9694afab4dd01a4a97a155188 (patch) | |
tree | 4a7119cfa0a112e514f50bbc2961981c3670ea03 /misc/rosetta | |
parent | 8efa968683ef2c4ab0ae7f4c0d2ccb0fcaa8af7b (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/rosetta')
5 files changed, 12 insertions, 12 deletions
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); |