diff --git a/xstream/src/java/com/thoughtworks/xstream/converters/basic/CharConverter.java b/xstream/src/java/com/thoughtworks/xstream/converters/basic/CharConverter.java index 1e1583acd..3868e73ab 100644 --- a/xstream/src/java/com/thoughtworks/xstream/converters/basic/CharConverter.java +++ b/xstream/src/java/com/thoughtworks/xstream/converters/basic/CharConverter.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2003, 2004 Joe Walnes. - * Copyright (C) 2006, 2007, 2014, 2018 XStream Committers. + * Copyright (C) 2006, 2007, 2014, 2018, 2020 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD @@ -42,7 +42,7 @@ public void marshal(final Object source, final HierarchicalStreamWriter writer, public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context) { final String nullAttribute = reader.getAttribute("null"); if (nullAttribute != null && nullAttribute.equals("true")) { - return new Character('\0'); + return Character.valueOf('\0'); } else { return fromString(reader.getValue()); } diff --git a/xstream/src/java/com/thoughtworks/xstream/converters/reflection/CGLIBEnhancedConverter.java b/xstream/src/java/com/thoughtworks/xstream/converters/reflection/CGLIBEnhancedConverter.java index 75701d2b8..40d93a615 100644 --- a/xstream/src/java/com/thoughtworks/xstream/converters/reflection/CGLIBEnhancedConverter.java +++ b/xstream/src/java/com/thoughtworks/xstream/converters/reflection/CGLIBEnhancedConverter.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013, 2014, 2015, 2016, 2018 XStream Committers. + * Copyright (C) 2006, 2007, 2008, 2010, 2011, 2013, 2014, 2015, 2016, 2018, 2020 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD @@ -301,19 +301,19 @@ private Object[] createNullArguments(final Class[] parameterTypes) { final Class type = parameterTypes[i]; if (type.isPrimitive()) { if (type == byte.class) { - arguments[i] = new Byte((byte)0); + arguments[i] = Byte.valueOf((byte)0); } else if (type == short.class) { - arguments[i] = new Short((short)0); + arguments[i] = Short.valueOf((short)0); } else if (type == int.class) { - arguments[i] = new Integer(0); + arguments[i] = Integer.valueOf(0); } else if (type == long.class) { - arguments[i] = new Long(0); + arguments[i] = Long.valueOf(0); } else if (type == float.class) { - arguments[i] = new Float(0); + arguments[i] = Float.valueOf(0); } else if (type == double.class) { - arguments[i] = new Double(0); + arguments[i] = Double.valueOf(0); } else if (type == char.class) { - arguments[i] = new Character('\0'); + arguments[i] = Character.valueOf('\0'); } else { arguments[i] = Boolean.FALSE; } diff --git a/xstream/src/java/com/thoughtworks/xstream/core/JVM.java b/xstream/src/java/com/thoughtworks/xstream/core/JVM.java index 265e3469e..c424ff23b 100644 --- a/xstream/src/java/com/thoughtworks/xstream/core/JVM.java +++ b/xstream/src/java/com/thoughtworks/xstream/core/JVM.java @@ -119,13 +119,13 @@ static class Test { final Test t = (Test)provider.newInstance(Test.class); try { provider.writeField(t, "o", "object", Test.class); - provider.writeField(t, "c", new Character('c'), Test.class); - provider.writeField(t, "b", new Byte((byte)1), Test.class); - provider.writeField(t, "s", new Short((short)1), Test.class); - provider.writeField(t, "i", new Integer(1), Test.class); - provider.writeField(t, "l", new Long(1), Test.class); - provider.writeField(t, "f", new Float(1), Test.class); - provider.writeField(t, "d", new Double(1), Test.class); + provider.writeField(t, "c", Character.valueOf('c'), Test.class); + provider.writeField(t, "b", Byte.valueOf((byte)1), Test.class); + provider.writeField(t, "s", Short.valueOf((short)1), Test.class); + provider.writeField(t, "i", Integer.valueOf(1), Test.class); + provider.writeField(t, "l", Long.valueOf(1), Test.class); + provider.writeField(t, "f", Float.valueOf(1), Test.class); + provider.writeField(t, "d", Double.valueOf(1), Test.class); provider.writeField(t, "bool", Boolean.TRUE, Test.class); test = true; } catch (final IncompatibleClassChangeError e) { diff --git a/xstream/src/java/com/thoughtworks/xstream/core/util/Primitives.java b/xstream/src/java/com/thoughtworks/xstream/core/util/Primitives.java index 951a54f65..5bb94223a 100644 --- a/xstream/src/java/com/thoughtworks/xstream/core/util/Primitives.java +++ b/xstream/src/java/com/thoughtworks/xstream/core/util/Primitives.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, 2011, 2014, 2015 XStream Committers. + * Copyright (c) 2006, 2007, 2011, 2014, 2015, 2020 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD @@ -28,12 +28,12 @@ public final class Primitives { static { final Class[][] boxing = new Class[][]{ - {Byte.TYPE, Byte.class}, {Character.TYPE, Character.class}, {Short.TYPE, Short.class}, - {Integer.TYPE, Integer.class}, {Long.TYPE, Long.class}, {Float.TYPE, Float.class}, - {Double.TYPE, Double.class}, {Boolean.TYPE, Boolean.class}, {Void.TYPE, Void.class},}; + {Byte.TYPE, Byte.class}, {Character.TYPE, Character.class}, {Short.TYPE, Short.class}, // + {Integer.TYPE, Integer.class}, {Long.TYPE, Long.class}, {Float.TYPE, Float.class}, // + {Double.TYPE, Double.class}, {Boolean.TYPE, Boolean.class}, {Void.TYPE, Void.class}}; final Character[] representingChars = { - new Character('B'), new Character('C'), new Character('S'), new Character('I'), new Character('J'), - new Character('F'), new Character('D'), new Character('Z'), null}; + Character.valueOf('B'), Character.valueOf('C'), Character.valueOf('S'), Character.valueOf('I'), // + Character.valueOf('J'), Character.valueOf('F'), Character.valueOf('D'), Character.valueOf('Z'), null}; for (int i = 0; i < boxing.length; i++) { final Class primitiveType = boxing[i][0]; final Class boxedType = boxing[i][1]; diff --git a/xstream/src/java/com/thoughtworks/xstream/io/path/PathTracker.java b/xstream/src/java/com/thoughtworks/xstream/io/path/PathTracker.java index 93a1f619a..5e7223d1e 100644 --- a/xstream/src/java/com/thoughtworks/xstream/io/path/PathTracker.java +++ b/xstream/src/java/com/thoughtworks/xstream/io/path/PathTracker.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2004, 2005, 2006 Joe Walnes. - * Copyright (C) 2006, 2007, 2009, 2011, 2014, 2015 XStream Committers. + * Copyright (C) 2006, 2007, 2009, 2011, 2014, 2015, 2020 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD @@ -85,9 +85,9 @@ public void pushElement(final String name) { indexMapStack[pointer] = indexMap; } if (indexMap.containsKey(name)) { - indexMap.put(name, new Integer(indexMap.get(name).intValue() + 1)); + indexMap.put(name, Integer.valueOf(indexMap.get(name).intValue() + 1)); } else { - indexMap.put(name, new Integer(1)); + indexMap.put(name, Integer.valueOf(1)); } pointer++; currentPath = null; diff --git a/xstream/src/java/com/thoughtworks/xstream/persistence/XmlArrayList.java b/xstream/src/java/com/thoughtworks/xstream/persistence/XmlArrayList.java index d29846733..96b793f19 100644 --- a/xstream/src/java/com/thoughtworks/xstream/persistence/XmlArrayList.java +++ b/xstream/src/java/com/thoughtworks/xstream/persistence/XmlArrayList.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2006 Joe Walnes. - * Copyright (C) 2007, 2008, 2014, 2015 XStream Committers. + * Copyright (C) 2007, 2008, 2014, 2015, 2020 XStream Committers. * All rights reserved. * * The software in this package is published under the terms of the BSD @@ -50,7 +50,7 @@ public void add(final int index, final V element) { for (int i = size; i > to; i--) { map.put(Integer.valueOf(i + 1), map.get(Integer.valueOf(i))); } - map.put(new Integer(index), element); + map.put(Integer.valueOf(index), element); } private void rangeCheck(final int index) {