Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-48463] update hard coded references of XPP3Driver to KXml2Dr…
…iver in order to support XMLv1.1
  • Loading branch information
mikecirioli committed Jan 24, 2018
1 parent 9a4a913 commit 37365ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/model/View.java
Expand Up @@ -26,7 +26,7 @@

import com.thoughtworks.xstream.converters.ConversionException;
import com.thoughtworks.xstream.io.StreamException;
import com.thoughtworks.xstream.io.xml.Xpp3Driver;
import com.thoughtworks.xstream.io.xml.KXml2Driver;
import hudson.DescriptorExtensionList;
import hudson.Extension;
import hudson.ExtensionPoint;
Expand Down Expand Up @@ -1213,7 +1213,7 @@ public void updateByXml(Source source) throws IOException {
// Do not allow overwriting view name as it might collide with another
// view in same ViewGroup and might not satisfy Jenkins.checkGoodName.
String oldname = name;
Object o = Jenkins.XSTREAM.unmarshal(new Xpp3Driver().createReader(in), this);
Object o = Jenkins.XSTREAM.unmarshal(new KXml2Driver().createReader(in), this);
if (!o.getClass().equals(getClass())) {
// ensure that we've got the same view type. extending this code to support updating
// to different view type requires destroying & creating a new view type
Expand Down
10 changes: 5 additions & 5 deletions core/src/main/java/jenkins/util/xstream/XStreamDOM.java
Expand Up @@ -34,8 +34,8 @@
import com.thoughtworks.xstream.io.xml.AbstractXmlReader;
import com.thoughtworks.xstream.io.xml.AbstractXmlWriter;
import com.thoughtworks.xstream.io.xml.DocumentReader;
import com.thoughtworks.xstream.io.xml.KXml2Driver;
import com.thoughtworks.xstream.io.xml.XmlFriendlyReplacer;
import com.thoughtworks.xstream.io.xml.Xpp3Driver;
import hudson.Util;
import hudson.util.VariableResolver;

Expand Down Expand Up @@ -241,11 +241,11 @@ public static WriterImpl newWriter() {
* Writes this {@link XStreamDOM} into {@link OutputStream}.
*/
public void writeTo(OutputStream os) {
writeTo(new Xpp3Driver().createWriter(os));
writeTo(new KXml2Driver().createWriter(os));
}

public void writeTo(Writer w) {
writeTo(new Xpp3Driver().createWriter(w));
writeTo(new KXml2Driver().createWriter(w));
}

public void writeTo(HierarchicalStreamWriter w) {
Expand All @@ -262,11 +262,11 @@ public static XStreamDOM from(XStream xs, Object obj) {
}

public static XStreamDOM from(InputStream in) {
return from(new Xpp3Driver().createReader(in));
return from(new KXml2Driver().createReader(in));
}

public static XStreamDOM from(Reader in) {
return from(new Xpp3Driver().createReader(in));
return from(new KXml2Driver().createReader(in));
}

public static XStreamDOM from(HierarchicalStreamReader in) {
Expand Down

0 comments on commit 37365ee

Please sign in to comment.