mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-08 01:26:03 +00:00
fixed an error during start up due to the Converter type inconsistency with the current version of XStream.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@23341 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
fb2bf8e05f
commit
71820041a4
1 file changed
+10
-7
@@ -23,7 +23,11 @@
|
||||
*/
|
||||
package hudson.model;
|
||||
|
||||
import com.thoughtworks.xstream.converters.basic.AbstractSingleValueConverter;
|
||||
import com.thoughtworks.xstream.converters.Converter;
|
||||
import com.thoughtworks.xstream.converters.MarshallingContext;
|
||||
import com.thoughtworks.xstream.converters.UnmarshallingContext;
|
||||
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
|
||||
import com.thoughtworks.xstream.io.HierarchicalStreamReader;
|
||||
import hudson.Util;
|
||||
import hudson.security.ACL;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
@@ -75,18 +79,17 @@ public final class BuildAuthorizationToken {
|
||||
return token;
|
||||
}
|
||||
|
||||
public static final class ConverterImpl extends AbstractSingleValueConverter {
|
||||
public static final class ConverterImpl implements Converter {
|
||||
public boolean canConvert(Class type) {
|
||||
return type== BuildAuthorizationToken.class;
|
||||
}
|
||||
|
||||
public Object fromString(String str) {
|
||||
return new BuildAuthorizationToken(str);
|
||||
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
|
||||
writer.setValue(((BuildAuthorizationToken) source).token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(Object obj) {
|
||||
return ((BuildAuthorizationToken)obj).token;
|
||||
public Object unmarshal(HierarchicalStreamReader reader, final UnmarshallingContext context) {
|
||||
return new BuildAuthorizationToken(reader.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user