From c3e60a4a491e7a37924351f668181b4cc7257492 Mon Sep 17 00:00:00 2001 From: Honor Systems Updater Jenkins Date: Fri, 29 Apr 2022 01:29:44 +0000 Subject: [PATCH] Honor Systems generated updates https://github.com/x-stream/xstream/issues/211 Automatic updates https://jenkins.updater.j2eeguys.com/ xstream/src/java/com/thoughtworks/xstream/mapper/SecurityMapper.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] xstream/src/java/com/thoughtworks/xstream/io/StatefulWriter.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] xstream/src/java/com/thoughtworks/xstream/io/json/JettisonStaxWriter.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] xstream-jmh/src/java/com/thoughtworks/xstream/benchmark/jmh/StringConverterBenchmark.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] xstream/src/java/com/thoughtworks/xstream/core/util/PresortedMap.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] xstream/src/java/com/thoughtworks/xstream/core/util/WeakCache.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] xstream/src/java/com/thoughtworks/xstream/io/xml/TraxSource.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] xstream/src/java/com/thoughtworks/xstream/converters/reflection/NativeFieldKeySorter.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] xstream/src/java/com/thoughtworks/xstream/core/util/ThreadSafeSimpleDateFormat.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] xstream/src/java/com/thoughtworks/xstream/core/DefaultConverterLookup.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] xstream/src/java/com/thoughtworks/xstream/mapper/AnnotationMapper.java Replace the type specification in this constructor call with the diamond operator ("<>"). [squid:S2293] Signed-off-by: Honor Systems Updater Jenkins --- .../xstream/benchmark/jmh/StringConverterBenchmark.java | 2 +- .../xstream/converters/reflection/NativeFieldKeySorter.java | 2 +- .../com/thoughtworks/xstream/core/DefaultConverterLookup.java | 4 ++-- .../java/com/thoughtworks/xstream/core/util/PresortedMap.java | 4 ++-- .../xstream/core/util/ThreadSafeSimpleDateFormat.java | 2 +- .../java/com/thoughtworks/xstream/core/util/WeakCache.java | 2 +- .../src/java/com/thoughtworks/xstream/io/StatefulWriter.java | 2 +- .../com/thoughtworks/xstream/io/json/JettisonStaxWriter.java | 2 +- .../src/java/com/thoughtworks/xstream/io/xml/TraxSource.java | 2 +- .../com/thoughtworks/xstream/mapper/AnnotationMapper.java | 4 ++-- .../java/com/thoughtworks/xstream/mapper/SecurityMapper.java | 4 ++-- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/xstream-jmh/src/java/com/thoughtworks/xstream/benchmark/jmh/StringConverterBenchmark.java b/xstream-jmh/src/java/com/thoughtworks/xstream/benchmark/jmh/StringConverterBenchmark.java index 91f835914..d319d85cd 100644 --- a/xstream-jmh/src/java/com/thoughtworks/xstream/benchmark/jmh/StringConverterBenchmark.java +++ b/xstream-jmh/src/java/com/thoughtworks/xstream/benchmark/jmh/StringConverterBenchmark.java @@ -171,7 +171,7 @@ private ConcurrentHashMapStringConverter(final ConcurrentMap map * @since 1.4.9 */ public ConcurrentHashMapStringConverter(final int lengthLimit) { - this(new ConcurrentHashMap(), lengthLimit); + this(new ConcurrentHashMap<>(), lengthLimit); } @Override diff --git a/xstream/src/java/com/thoughtworks/xstream/converters/reflection/NativeFieldKeySorter.java b/xstream/src/java/com/thoughtworks/xstream/converters/reflection/NativeFieldKeySorter.java index 544af247a..c0f96e769 100644 --- a/xstream/src/java/com/thoughtworks/xstream/converters/reflection/NativeFieldKeySorter.java +++ b/xstream/src/java/com/thoughtworks/xstream/converters/reflection/NativeFieldKeySorter.java @@ -26,7 +26,7 @@ public class NativeFieldKeySorter implements FieldKeySorter { @Override public Map sort(final Class type, final Map keyedByFieldKey) { - final Map map = new TreeMap(new Comparator() { + final Map map = new TreeMap<>(new Comparator() { @Override public int compare(final FieldKey fieldKey1, final FieldKey fieldKey2) { diff --git a/xstream/src/java/com/thoughtworks/xstream/core/DefaultConverterLookup.java b/xstream/src/java/com/thoughtworks/xstream/core/DefaultConverterLookup.java index 0e34bd576..270655289 100644 --- a/xstream/src/java/com/thoughtworks/xstream/core/DefaultConverterLookup.java +++ b/xstream/src/java/com/thoughtworks/xstream/core/DefaultConverterLookup.java @@ -37,7 +37,7 @@ public class DefaultConverterLookup implements ConverterLookup, ConverterRegistr private Map serializationMap = null; public DefaultConverterLookup() { - this(new HashMap()); + this(new HashMap<>()); } /** @@ -107,7 +107,7 @@ private Object writeReplace() { } private Object readResolve() { - typeToConverterMap = serializationMap == null ? new HashMap() : serializationMap; + typeToConverterMap = serializationMap == null ? new HashMap<>() : serializationMap; serializationMap = null; return this; } diff --git a/xstream/src/java/com/thoughtworks/xstream/core/util/PresortedMap.java b/xstream/src/java/com/thoughtworks/xstream/core/util/PresortedMap.java index f22678a13..678790bda 100644 --- a/xstream/src/java/com/thoughtworks/xstream/core/util/PresortedMap.java +++ b/xstream/src/java/com/thoughtworks/xstream/core/util/PresortedMap.java @@ -27,11 +27,11 @@ private static class ArraySet extends ArrayList implements Set { private final Comparator comparator; public PresortedMap() { - this(null, new ArraySet>()); + this(null, new ArraySet<>()); } public PresortedMap(final Comparator comparator) { - this(comparator, new ArraySet>()); + this(comparator, new ArraySet<>()); } private PresortedMap(final Comparator comparator, final PresortedMap.ArraySet> set) { diff --git a/xstream/src/java/com/thoughtworks/xstream/core/util/ThreadSafeSimpleDateFormat.java b/xstream/src/java/com/thoughtworks/xstream/core/util/ThreadSafeSimpleDateFormat.java index 0ae5d10a1..bc007cb3d 100644 --- a/xstream/src/java/com/thoughtworks/xstream/core/util/ThreadSafeSimpleDateFormat.java +++ b/xstream/src/java/com/thoughtworks/xstream/core/util/ThreadSafeSimpleDateFormat.java @@ -51,7 +51,7 @@ public ThreadSafeSimpleDateFormat( final int maxPoolSize, final boolean lenient) { formatString = format; this.timeZone = timeZone; - pool = new Pool(initialPoolSize, maxPoolSize, new Pool.Factory() { + pool = new Pool<>(initialPoolSize, maxPoolSize, new Pool.Factory() { @Override public SimpleDateFormat newInstance() { final SimpleDateFormat dateFormat = new SimpleDateFormat(formatString, locale); diff --git a/xstream/src/java/com/thoughtworks/xstream/core/util/WeakCache.java b/xstream/src/java/com/thoughtworks/xstream/core/util/WeakCache.java index 780cbcf75..a05a6d6a4 100644 --- a/xstream/src/java/com/thoughtworks/xstream/core/util/WeakCache.java +++ b/xstream/src/java/com/thoughtworks/xstream/core/util/WeakCache.java @@ -42,7 +42,7 @@ public class WeakCache extends AbstractMap { * @since 1.4 */ public WeakCache() { - this(new WeakHashMap>()); + this(new WeakHashMap<>()); } /** diff --git a/xstream/src/java/com/thoughtworks/xstream/io/StatefulWriter.java b/xstream/src/java/com/thoughtworks/xstream/io/StatefulWriter.java index 9ec1d4f0d..509627821 100644 --- a/xstream/src/java/com/thoughtworks/xstream/io/StatefulWriter.java +++ b/xstream/src/java/com/thoughtworks/xstream/io/StatefulWriter.java @@ -97,7 +97,7 @@ private void startNodeCommon() { } state = STATE_NODE_START; ++balance; - attributes.push(new HashSet()); + attributes.push(new HashSet<>()); } @Override diff --git a/xstream/src/java/com/thoughtworks/xstream/io/json/JettisonStaxWriter.java b/xstream/src/java/com/thoughtworks/xstream/io/json/JettisonStaxWriter.java index 3149b343e..8af665665 100644 --- a/xstream/src/java/com/thoughtworks/xstream/io/json/JettisonStaxWriter.java +++ b/xstream/src/java/com/thoughtworks/xstream/io/json/JettisonStaxWriter.java @@ -38,7 +38,7 @@ public class JettisonStaxWriter extends StaxWriter { private final MappedNamespaceConvention convention; - private final Deque stack = new ArrayDeque(); + private final Deque stack = new ArrayDeque<>(); /** * @since 1.4 diff --git a/xstream/src/java/com/thoughtworks/xstream/io/xml/TraxSource.java b/xstream/src/java/com/thoughtworks/xstream/io/xml/TraxSource.java index 13c1ab560..1eba55d76 100644 --- a/xstream/src/java/com/thoughtworks/xstream/io/xml/TraxSource.java +++ b/xstream/src/java/com/thoughtworks/xstream/io/xml/TraxSource.java @@ -286,7 +286,7 @@ public void setSourceAsList(final List list) { } @SuppressWarnings("unchecked") final List olist = (List)list; - source = list instanceof Queue ? (Queue)list : new ListWrappingQueue(olist); + source = list instanceof Queue ? (Queue)list : new ListWrappingQueue<>(olist); configureXMLReader(); } diff --git a/xstream/src/java/com/thoughtworks/xstream/mapper/AnnotationMapper.java b/xstream/src/java/com/thoughtworks/xstream/mapper/AnnotationMapper.java index 1eff98895..613e58387 100644 --- a/xstream/src/java/com/thoughtworks/xstream/mapper/AnnotationMapper.java +++ b/xstream/src/java/com/thoughtworks/xstream/mapper/AnnotationMapper.java @@ -289,8 +289,8 @@ private void processConverterAnnotations(final Class type) { final XStreamConverters convertersAnnotation = type.getAnnotation(XStreamConverters.class); final XStreamConverter converterAnnotation = type.getAnnotation(XStreamConverter.class); final List annotations = convertersAnnotation != null - ? new ArrayList(Arrays.asList(convertersAnnotation.value())) - : new ArrayList(); + ? new ArrayList<>(Arrays.asList(convertersAnnotation.value())) + : new ArrayList<>(); if (converterAnnotation != null) { annotations.add(converterAnnotation); } diff --git a/xstream/src/java/com/thoughtworks/xstream/mapper/SecurityMapper.java b/xstream/src/java/com/thoughtworks/xstream/mapper/SecurityMapper.java index f0e92937d..2f5191ad5 100644 --- a/xstream/src/java/com/thoughtworks/xstream/mapper/SecurityMapper.java +++ b/xstream/src/java/com/thoughtworks/xstream/mapper/SecurityMapper.java @@ -47,8 +47,8 @@ public SecurityMapper(final Mapper wrapped) { public SecurityMapper(final Mapper wrapped, final TypePermission... permissions) { super(wrapped); this.permissions = permissions == null // - ? new ArrayList() - : new ArrayList(Arrays.asList(permissions)); + ? new ArrayList<>() + : new ArrayList<>(Arrays.asList(permissions)); } /**