Skip to content

Commit

Permalink
[FIXED JENKINS-12542] upgraded to XStream 1.4.4
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kohsuke committed Feb 26, 2013
1 parent bea901f commit 319372b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 36 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -70,6 +70,9 @@
<li class=bug>
Maven2 builds with non-standard test plugins failed.
(<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>
Significant improvement in Traditional Chinese localizations.
(<a href="https://github.com/jenkinsci/jenkins/pull/716">pull 716</a>)
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Expand Up @@ -233,7 +233,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jvnet.hudson</groupId>
<artifactId>xstream</artifactId>
<version>1.3.1-jenkins-11</version>
<version>1.4.4-jenkins-1</version>
</dependency>
<dependency>
<groupId>jfree</groupId>
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/util/RobustReflectionConverter.java
Expand Up @@ -28,7 +28,7 @@
import com.thoughtworks.xstream.converters.MarshallingContext;
import com.thoughtworks.xstream.converters.SingleValueConverter;
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.PureJavaReflectionProvider;
import com.thoughtworks.xstream.converters.reflection.ReflectionConverter;
Expand Down Expand Up @@ -293,7 +293,7 @@ public Object doUnmarshal(final Object result, final HierarchicalStreamReader re
implicitCollectionsForCurrentObject = writeValueToImplicitCollection(context, value, implicitCollectionsForCurrentObject, result, fieldName);
}
}
} catch (NonExistentFieldException e) {
} catch (MissingFieldException e) {
LOGGER.log(WARNING,"Skipping a non-existent field "+e.getFieldName(),e);
addErrorInContext(context, e);
} catch (CannotResolveClassException e) {
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/util/StringConverter2.java
Expand Up @@ -23,7 +23,7 @@
*/
package hudson.util;

import com.thoughtworks.xstream.converters.basic.AbstractBasicConverter;
import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
import com.thoughtworks.xstream.converters.basic.StringConverter;

/**
Expand All @@ -40,13 +40,13 @@
* Use {@link HeapSpaceStringConverter} instead.
*/
@Deprecated
public class StringConverter2 extends AbstractBasicConverter {
public class StringConverter2 extends AbstractSingleValueConverter {

public boolean canConvert(Class type) {
return type.equals(String.class);
}

protected Object fromString(String str) {
public Object fromString(String str) {
return str;
}
}
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/util/XStream2.java
Expand Up @@ -158,7 +158,7 @@ else if (type != null && ImmutableList.class.isAssignableFrom(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);

mapperInjectionPoint = new MapperInjectionPoint(a);
Expand Down
28 changes: 0 additions & 28 deletions core/src/main/java/hudson/util/xstream/MapperDelegate.java
Expand Up @@ -59,34 +59,6 @@ public Class defaultImplementationOf(Class 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) {
return delegate.aliasForAttribute(attribute);
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/test/java/hudson/util/CopyOnWriteMapTest.java
Expand Up @@ -88,7 +88,7 @@ public void testTreeSerialization() throws Exception {

String out = xs.toXML(td);
assertEquals("empty maps", "<hudson.util.CopyOnWriteMapTest_-TreeData>"
+ "<map1><no-comparator/></map1><map2><no-comparator/></map2>"
+ "<map1/><map2/>"
+ "</hudson.util.CopyOnWriteMapTest_-TreeData>",
out.replaceAll("\\s+", ""));
TreeData td2 = (TreeData)xs.fromXML(out);
Expand Down

1 comment on commit 319372b

@jglick
Copy link
Member

@jglick jglick commented on 319372b Feb 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently still suffers from the same silly bug that necessitated b14a7a3.

Please sign in to comment.