Skip to content

Commit

Permalink
Honor Systems generated updates. Closes x-stream#296.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsujenkins authored and joehni committed Jul 3, 2022
1 parent eb21c8d commit cf61d54
Show file tree
Hide file tree
Showing 19 changed files with 51 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2008, 2009, 2011, 2015 XStream Committers.
* Copyright (C) 2008, 2009, 2011, 2015, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -39,6 +39,6 @@ public boolean equals(Object obj) {
}

public int hashCode() {
return super.hashCode() + two + new Boolean(three).hashCode() + five.toString().hashCode();
return super.hashCode() + two + Boolean.valueOf(three).hashCode() + five.toString().hashCode();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2009, 2011, 2015 XStream Committers.
* Copyright (C) 2009, 2011, 2015, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -63,6 +63,6 @@ public boolean equals(Object obj) {
}

public int hashCode() {
return super.hashCode() + two + new Boolean(three).hashCode() + five.toString().hashCode();
return super.hashCode() + two + Boolean.valueOf(three).hashCode() + five.toString().hashCode();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2008, 2009, 2011, 2015 XStream Committers.
* Copyright (C) 2008, 2009, 2011, 2015, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -52,6 +52,6 @@ public boolean equals(Object obj) {
}

public int hashCode() {
return super.hashCode() + two + new Boolean(three).hashCode() + five.toString().hashCode();
return super.hashCode() + two + Boolean.valueOf(three).hashCode() + five.toString().hashCode();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2008, 2009, 2011, 2015 XStream Committers.
* Copyright (C) 2008, 2009, 2011, 2015, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -31,14 +31,14 @@ public class BasicTarget implements Target {

public BasicTarget() {
list = new ArrayList();
list.add(new Integer(1));
list.add(new Byte((byte)2));
list.add(new Short((short)3));
list.add(new Long(4));
list.add(Integer.valueOf(1));
list.add(Byte.valueOf((byte)2));
list.add(Short.valueOf((short)3));
list.add(Long.valueOf(4));
list.add("Profile");
list.add(Boolean.TRUE);
list.add(new Float(1.2f));
list.add(new Double(1.2f));
list.add(Float.valueOf(1.2f));
list.add(Double.valueOf(1.2f));
list.add(new File("profile.txt"));
list.add(Locale.ENGLISH);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2008, 2009, 2011, 2015 XStream Committers.
* Copyright (C) 2008, 2009, 2011, 2015, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -85,9 +85,9 @@ static class RunnableInvocationHandler implements InvocationHandler {

public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (method.equals(EQUALS)) {
return new Boolean(args[0] instanceof Runnable);
return Boolean.valueOf(args[0] instanceof Runnable);
} else if (method.getName().equals("hashCode")) {
return new Integer(System.identityHashCode(proxy));
return Integer.valueOf(System.identityHashCode(proxy));
} else if (method.getName().equals("toString")) {
return "Proxy" + System.identityHashCode(proxy);
} else if (method.getName().equals("getClass")) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015, 2017, 2021 XStream Committers.
* Copyright (C) 2015, 2017, 2021, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -39,7 +39,6 @@
import com.thoughtworks.xstream.io.xml.CompactWriter;
import com.thoughtworks.xstream.io.xml.MXParserDriver;
import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
import com.thoughtworks.xstream.io.xml.Xpp3Driver;
import com.thoughtworks.xstream.security.ArrayTypePermission;
import com.thoughtworks.xstream.security.NoTypePermission;

Expand Down Expand Up @@ -171,7 +170,7 @@ private ConcurrentHashMapStringConverter(final ConcurrentMap<String, String> map
* @since 1.4.9
*/
public ConcurrentHashMapStringConverter(final int lengthLimit) {
this(new ConcurrentHashMap<String, String>(), lengthLimit);
this(new ConcurrentHashMap<>(), lengthLimit);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2004, 2005, 2006 Joe Walnes.
* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2018 XStream Committers.
* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2018, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -191,7 +191,7 @@ public void writeItem(final Object item) {
};

final Map<String, Set<Mapper.ImplicitCollectionMapping>> hiddenMappers =
new HashMap<String, Set<Mapper.ImplicitCollectionMapping>>();
new HashMap<>();
for (final FieldInfo info : fields) {
if (info.value != null) {
final boolean isCollection = info.value instanceof Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007, 2014 XStream Committers.
* Copyright (C) 2007, 2014, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand All @@ -26,7 +26,7 @@ public class NativeFieldKeySorter implements FieldKeySorter {

@Override
public Map<FieldKey, Field> sort(final Class<?> type, final Map<FieldKey, Field> keyedByFieldKey) {
final Map<FieldKey, Field> map = new TreeMap<FieldKey, Field>(new Comparator<FieldKey>() {
final Map<FieldKey, Field> map = new TreeMap<>(new Comparator<FieldKey>() {

@Override
public int compare(final FieldKey fieldKey1, final FieldKey fieldKey2) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007, 2008, 2013, 2014 XStream Committers.
* Copyright (C) 2007, 2008, 2013, 2014, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -27,7 +27,7 @@ public class XStream12FieldKeySorter implements FieldKeySorter {

@Override
public Map<FieldKey, Field> sort(final Class<?> type, final Map<FieldKey, Field> keyedByFieldKey) {
final Map<FieldKey, Field> map = new TreeMap<FieldKey, Field>(new Comparator<FieldKey>() {
final Map<FieldKey, Field> map = new TreeMap<>(new Comparator<FieldKey>() {

@Override
public int compare(final FieldKey fieldKey1, final FieldKey fieldKey2) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2004, 2005, 2006 Joe Walnes.
* Copyright (C) 2006, 2007, 2008, 2009, 2011, 2013, 2014, 2015, 2016, 2017, 2019 XStream Committers.
* Copyright (C) 2006, 2007, 2008, 2009, 2011, 2013, 2014, 2015, 2016, 2017, 2019, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -37,7 +37,7 @@ public class DefaultConverterLookup implements ConverterLookup, ConverterRegistr
private Map<String, Converter> serializationMap = null;

public DefaultConverterLookup() {
this(new HashMap<String, Converter>());
this(new HashMap<>());
}

/**
Expand Down Expand Up @@ -107,7 +107,7 @@ private Object writeReplace() {
}

private Object readResolve() {
typeToConverterMap = serializationMap == null ? new HashMap<String, Converter>() : serializationMap;
typeToConverterMap = serializationMap == null ? new HashMap<>() : serializationMap;
serializationMap = null;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006, 2007, 2010, 2014, 2015 XStream Committers.
* Copyright (C) 2006, 2007, 2010, 2014, 2015, 2022 XStream Committers.
* All rights reserved.
*
* Created on 12.10.2010 by Joerg Schaible, extracted from TreeMapConverter.
Expand Down Expand Up @@ -27,11 +27,11 @@ private static class ArraySet<T> extends ArrayList<T> implements Set<T> {
private final Comparator<K> comparator;

public PresortedMap() {
this(null, new ArraySet<Map.Entry<K, V>>());
this(null, new ArraySet<>());
}

public PresortedMap(final Comparator<K> comparator) {
this(comparator, new ArraySet<Map.Entry<K, V>>());
this(comparator, new ArraySet<>());
}

private PresortedMap(final Comparator<K> comparator, final PresortedMap.ArraySet<Map.Entry<K, V>> set) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2008, 2014, 2016 XStream Committers.
* Copyright (c) 2007, 2008, 2014, 2016, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -42,7 +42,7 @@ public ThreadSafePropertyEditor(
throw new IllegalArgumentException(type.getName() + " is not a " + PropertyEditor.class.getName());
}
editorType = type;
pool = new Pool<PropertyEditor>(initialPoolSize, maxPoolSize, new Pool.Factory<PropertyEditor>() {
pool = new Pool<>(initialPoolSize, maxPoolSize, new Pool.Factory<PropertyEditor>() {
@Override
public PropertyEditor newInstance() {
ErrorWritingException ex = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2004, 2005 Joe Walnes.
* Copyright (C) 2006, 2007, 2009, 2011, 2012, 2014 XStream Committers.
* Copyright (C) 2006, 2007, 2009, 2011, 2012, 2014, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -51,7 +51,7 @@ public ThreadSafeSimpleDateFormat(
final int maxPoolSize, final boolean lenient) {
formatString = format;
this.timeZone = timeZone;
pool = new Pool<DateFormat>(initialPoolSize, maxPoolSize, new Pool.Factory<DateFormat>() {
pool = new Pool<>(initialPoolSize, maxPoolSize, new Pool.Factory<DateFormat>() {
@Override
public SimpleDateFormat newInstance() {
final SimpleDateFormat dateFormat = new SimpleDateFormat(formatString, locale);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2011, 2013, 2014, 2015, 2019 XStream Committers.
* Copyright (C) 2011, 2013, 2014, 2015, 2019, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -42,7 +42,7 @@ public class WeakCache<K, V> extends AbstractMap<K, V> {
* @since 1.4
*/
public WeakCache() {
this(new WeakHashMap<K, Reference<V>>());
this(new WeakHashMap<>());
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2006 Joe Walnes.
* Copyright (C) 2006, 2007, 2014, 2015 XStream Committers.
* Copyright (C) 2006, 2007, 2014, 2015, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -97,7 +97,7 @@ private void startNodeCommon() {
}
state = STATE_NODE_START;
++balance;
attributes.push(new HashSet<String>());
attributes.push(new HashSet<>());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2014, 2018 XStream Committers.
* Copyright (c) 2008, 2009, 2010, 2011, 2014, 2018, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -38,7 +38,7 @@
public class JettisonStaxWriter extends StaxWriter {

private final MappedNamespaceConvention convention;
private final Deque<String> stack = new ArrayDeque<String>();
private final Deque<String> stack = new ArrayDeque<>();

/**
* @since 1.4
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2004 Joe Walnes.
* Copyright (C) 2006, 2007, 2013, 2014, 2015, 2020 XStream Committers.
* Copyright (C) 2006, 2007, 2013, 2014, 2015, 2020, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -286,7 +286,7 @@ public void setSourceAsList(final List<?> list) {
}
@SuppressWarnings("unchecked")
final List<Object> olist = (List<Object>)list;
source = list instanceof Queue ? (Queue<?>)list : new ListWrappingQueue<Object>(olist);
source = list instanceof Queue ? (Queue<?>)list : new ListWrappingQueue<>(olist);

configureXMLReader();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015, 2016 XStream Committers.
* Copyright (C) 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015, 2016, 2022 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
Expand Down Expand Up @@ -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<XStreamConverter> annotations = convertersAnnotation != null
? new ArrayList<XStreamConverter>(Arrays.asList(convertersAnnotation.value()))
: new ArrayList<XStreamConverter>();
? new ArrayList<>(Arrays.asList(convertersAnnotation.value()))
: new ArrayList<>();
if (converterAnnotation != null) {
annotations.add(converterAnnotation);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014, 2015 XStream Committers.
* Copyright (C) 2014, 2015, 2022 XStream Committers.
* All rights reserved.
*
* Created on 08. January 2014 by Joerg Schaible
Expand Down Expand Up @@ -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<TypePermission>()
: new ArrayList<TypePermission>(Arrays.asList(permissions));
? new ArrayList<>()
: new ArrayList<>(Arrays.asList(permissions));
}

/**
Expand Down

0 comments on commit cf61d54

Please sign in to comment.