提交 319372b8 编写于 作者: K Kohsuke Kawaguchi

[FIXED JENKINS-12542] upgraded to XStream 1.4.4

There are several incompatibilities in XStream 1.4 that resulted in our
changing the core, but according to the text search on all the public
plugins, none of these changes affect the 600+ plugins we have today.

However, it is still possible that there are some parts of XStream 1.3
that plugins depend on but the core doesn't depend on --- we won't be
able to tell those problems at this point.
上级 bea901f6
...@@ -70,6 +70,9 @@ Upcoming changes</a> ...@@ -70,6 +70,9 @@ Upcoming changes</a>
<li class=bug> <li class=bug>
Maven2 builds with non-standard test plugins failed. Maven2 builds with non-standard test plugins failed.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16928">issue 16928</a>) (<a href="https://issues.jenkins-ci.org/browse/JENKINS-16928">issue 16928</a>)
<li class=rfe>
Started bundling XStream 1.4.4
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-12542">issue 12542</a>)
<li class=rfe> <li class=rfe>
Significant improvement in Traditional Chinese localizations. Significant improvement in Traditional Chinese localizations.
(<a href="https://github.com/jenkinsci/jenkins/pull/716">pull 716</a>) (<a href="https://github.com/jenkinsci/jenkins/pull/716">pull 716</a>)
......
...@@ -233,7 +233,7 @@ THE SOFTWARE. ...@@ -233,7 +233,7 @@ THE SOFTWARE.
<dependency> <dependency>
<groupId>org.jvnet.hudson</groupId> <groupId>org.jvnet.hudson</groupId>
<artifactId>xstream</artifactId> <artifactId>xstream</artifactId>
<version>1.3.1-jenkins-11</version> <version>1.4.4-jenkins-1</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>jfree</groupId> <groupId>jfree</groupId>
......
...@@ -28,7 +28,7 @@ import com.thoughtworks.xstream.converters.Converter; ...@@ -28,7 +28,7 @@ import com.thoughtworks.xstream.converters.Converter;
import com.thoughtworks.xstream.converters.MarshallingContext; import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.SingleValueConverter; import com.thoughtworks.xstream.converters.SingleValueConverter;
import com.thoughtworks.xstream.converters.UnmarshallingContext; import com.thoughtworks.xstream.converters.UnmarshallingContext;
import com.thoughtworks.xstream.converters.reflection.NonExistentFieldException; import com.thoughtworks.xstream.converters.reflection.MissingFieldException;
import com.thoughtworks.xstream.converters.reflection.ObjectAccessException; import com.thoughtworks.xstream.converters.reflection.ObjectAccessException;
import com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider; import com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider;
import com.thoughtworks.xstream.converters.reflection.ReflectionConverter; import com.thoughtworks.xstream.converters.reflection.ReflectionConverter;
...@@ -293,7 +293,7 @@ public class RobustReflectionConverter implements Converter { ...@@ -293,7 +293,7 @@ public class RobustReflectionConverter implements Converter {
implicitCollectionsForCurrentObject = writeValueToImplicitCollection(context, value, implicitCollectionsForCurrentObject, result, fieldName); implicitCollectionsForCurrentObject = writeValueToImplicitCollection(context, value, implicitCollectionsForCurrentObject, result, fieldName);
} }
} }
} catch (NonExistentFieldException e) { } catch (MissingFieldException e) {
LOGGER.log(WARNING,"Skipping a non-existent field "+e.getFieldName(),e); LOGGER.log(WARNING,"Skipping a non-existent field "+e.getFieldName(),e);
addErrorInContext(context, e); addErrorInContext(context, e);
} catch (CannotResolveClassException e) { } catch (CannotResolveClassException e) {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
*/ */
package hudson.util; package hudson.util;
import com.thoughtworks.xstream.converters.basic.AbstractBasicConverter; import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
import com.thoughtworks.xstream.converters.basic.StringConverter; import com.thoughtworks.xstream.converters.basic.StringConverter;
/** /**
...@@ -40,13 +40,13 @@ import com.thoughtworks.xstream.converters.basic.StringConverter; ...@@ -40,13 +40,13 @@ import com.thoughtworks.xstream.converters.basic.StringConverter;
* Use {@link HeapSpaceStringConverter} instead. * Use {@link HeapSpaceStringConverter} instead.
*/ */
@Deprecated @Deprecated
public class StringConverter2 extends AbstractBasicConverter { public class StringConverter2 extends AbstractSingleValueConverter {
public boolean canConvert(Class type) { public boolean canConvert(Class type) {
return type.equals(String.class); return type.equals(String.class);
} }
protected Object fromString(String str) { public Object fromString(String str) {
return str; return str;
} }
} }
...@@ -158,7 +158,7 @@ public class XStream2 extends XStream { ...@@ -158,7 +158,7 @@ public class XStream2 extends XStream {
return super.serializedClass(type); return super.serializedClass(type);
} }
}); });
AnnotationMapper a = new AnnotationMapper(m, getConverterRegistry(), getClassLoader(), getReflectionProvider(), getJvm()); AnnotationMapper a = new AnnotationMapper(m, getConverterRegistry(), getConverterLookup(), getClassLoader(), getReflectionProvider(), getJvm());
a.autodetectAnnotations(true); a.autodetectAnnotations(true);
mapperInjectionPoint = new MapperInjectionPoint(a); mapperInjectionPoint = new MapperInjectionPoint(a);
......
...@@ -59,34 +59,6 @@ public class MapperDelegate extends MapperWrapper { ...@@ -59,34 +59,6 @@ public class MapperDelegate extends MapperWrapper {
return delegate.defaultImplementationOf(type); return delegate.defaultImplementationOf(type);
} }
/**
* @deprecated since 1.2, use aliasForAttribute instead.
*/
public String attributeForClassDefiningField() {
return delegate.attributeForClassDefiningField();
}
/**
* @deprecated since 1.2, use aliasForAttribute instead.
*/
public String attributeForImplementationClass() {
return delegate.attributeForImplementationClass();
}
/**
* @deprecated since 1.2, use aliasForAttribute instead.
*/
public String attributeForReadResolveField() {
return delegate.attributeForReadResolveField();
}
/**
* @deprecated since 1.2, use aliasForAttribute instead.
*/
public String attributeForEnumType() {
return delegate.attributeForEnumType();
}
public String aliasForAttribute(String attribute) { public String aliasForAttribute(String attribute) {
return delegate.aliasForAttribute(attribute); return delegate.aliasForAttribute(attribute);
} }
......
...@@ -88,7 +88,7 @@ public class CopyOnWriteMapTest extends TestCase { ...@@ -88,7 +88,7 @@ public class CopyOnWriteMapTest extends TestCase {
String out = xs.toXML(td); String out = xs.toXML(td);
assertEquals("empty maps", "<hudson.util.CopyOnWriteMapTest_-TreeData>" assertEquals("empty maps", "<hudson.util.CopyOnWriteMapTest_-TreeData>"
+ "<map1><no-comparator/></map1><map2><no-comparator/></map2>" + "<map1/><map2/>"
+ "</hudson.util.CopyOnWriteMapTest_-TreeData>", + "</hudson.util.CopyOnWriteMapTest_-TreeData>",
out.replaceAll("\\s+", "")); out.replaceAll("\\s+", ""));
TreeData td2 = (TreeData)xs.fromXML(out); TreeData td2 = (TreeData)xs.fromXML(out);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册