Log Message
Handle possible null value.
Modified Paths
- trunk/xstream/src/java/com/thoughtworks/xstream/converters/reflection/FieldDictionary.java
- trunk/xstream/src/java/com/thoughtworks/xstream/converters/reflection/SerializableConverter.java
- trunk/xstream/src/java/com/thoughtworks/xstream/mapper/FieldAliasingMapper.java
- trunk/xstream/src/java/com/thoughtworks/xstream/mapper/ImplicitCollectionMapper.java
Diff
Modified: trunk/xstream/src/java/com/thoughtworks/xstream/converters/reflection/FieldDictionary.java (2216 => 2217)
--- trunk/xstream/src/java/com/thoughtworks/xstream/converters/reflection/FieldDictionary.java 2014-01-19 12:07:15 UTC (rev 2216)
+++ trunk/xstream/src/java/com/thoughtworks/xstream/converters/reflection/FieldDictionary.java 2014-01-21 18:35:29 UTC (rev 2217)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2004, 2005, 2006 Joe Walnes.
- * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 XStream Committers.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
@@ -111,7 +111,7 @@
synchronized (this) {
if (!keyedByFieldNameCache.containsKey(type)) {
final List superClasses = new ArrayList();
- while (!Object.class.equals(cls)) {
+ while (!Object.class.equals(cls) && cls != null) {
superClasses.add(0, cls);
cls = cls.getSuperclass();
}
Modified: trunk/xstream/src/java/com/thoughtworks/xstream/converters/reflection/SerializableConverter.java (2216 => 2217)
--- trunk/xstream/src/java/com/thoughtworks/xstream/converters/reflection/SerializableConverter.java 2014-01-19 12:07:15 UTC (rev 2216)
+++ trunk/xstream/src/java/com/thoughtworks/xstream/converters/reflection/SerializableConverter.java 2014-01-21 18:35:29 UTC (rev 2217)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2004, 2005, 2006 Joe Walnes.
- * Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012, 2013 XStream Committers.
+ * Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012, 2013, 2014 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
@@ -311,7 +311,7 @@
protected List hierarchyFor(Class type) {
List result = new ArrayList();
- while(type != Object.class) {
+ while(type != Object.class && type != null) {
result.add(type);
type = type.getSuperclass();
}
Modified: trunk/xstream/src/java/com/thoughtworks/xstream/mapper/FieldAliasingMapper.java (2216 => 2217)
--- trunk/xstream/src/java/com/thoughtworks/xstream/mapper/FieldAliasingMapper.java 2014-01-19 12:07:15 UTC (rev 2216)
+++ trunk/xstream/src/java/com/thoughtworks/xstream/mapper/FieldAliasingMapper.java 2014-01-21 18:35:29 UTC (rev 2217)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2005 Joe Walnes.
- * Copyright (C) 2006, 2007, 2008, 2009, 2013 XStream Committers.
+ * Copyright (C) 2006, 2007, 2008, 2009, 2013, 2014 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
@@ -71,7 +71,9 @@
private String getMember(Class type, String name, Map map) {
String member = null;
- for (Class declaringType = type; member == null && declaringType != Object.class; declaringType = declaringType.getSuperclass()) {
+ for (Class declaringType = type;
+ member == null && declaringType != Object.class && declaringType != null;
+ declaringType = declaringType.getSuperclass()) {
member = (String) map.get(key(declaringType, name));
}
return member;
Modified: trunk/xstream/src/java/com/thoughtworks/xstream/mapper/ImplicitCollectionMapper.java (2216 => 2217)
--- trunk/xstream/src/java/com/thoughtworks/xstream/mapper/ImplicitCollectionMapper.java 2014-01-19 12:07:15 UTC (rev 2216)
+++ trunk/xstream/src/java/com/thoughtworks/xstream/mapper/ImplicitCollectionMapper.java 2014-01-21 18:35:29 UTC (rev 2217)
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2005 Joe Walnes.
- * Copyright (C) 2006, 2007, 2009, 2011, 2012, 2013 XStream Committers.
+ * Copyright (C) 2006, 2007, 2009, 2011, 2012, 2013, 2014 XStream Committers.
* All rights reserved.
*
* The software in this package is published under the terms of the BSD
@@ -92,7 +92,7 @@
public void add(Class definedIn, String fieldName, String itemFieldName, Class itemType, String keyFieldName) {
Field field = null;
Class declaredIn = definedIn;
- while (declaredIn != Object.class) {
+ while (declaredIn != Object.class && definedIn != null) {
try {
field = declaredIn.getDeclaredField(fieldName);
break;
To unsubscribe from this list please visit:
