From 3e0b5a637d8ef7e4ba1ef8e8d9ae91dcee56b5b1 Mon Sep 17 00:00:00 2001 From: alanharder Date: Mon, 14 Mar 2011 21:25:53 -0700 Subject: [PATCH] Remove old fields that have been deprecated since before 1.100 tasks.Mailer from,subject,failureOnly,charset 1.10 model.Project slave 1.60 model.Descriptor properties 1.62 model.Slave command,localFS 1.69 model.AbstractProject enableRemoteTrigger 1.77 model.FingerprintMap core 1.91 If anyone still has very old XML with these, OldDataMonitor will still handle it (as unreadable data instead of old data, and with a bit more noise in the log). --- .../java/hudson/model/AbstractProject.java | 8 ------ .../main/java/hudson/model/Descriptor.java | 21 -------------- .../java/hudson/model/FingerprintMap.java | 17 +---------- core/src/main/java/hudson/model/Project.java | 15 ++-------- core/src/main/java/hudson/model/Slave.java | 28 ++----------------- core/src/main/java/hudson/tasks/Mailer.java | 20 +------------ 6 files changed, 7 insertions(+), 102 deletions(-) diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index 1b6ac2cf5c..3ca25f341e 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -100,7 +100,6 @@ import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; @@ -201,11 +200,6 @@ public abstract class AbstractProject

,R extends A */ private volatile String jdk; - /** - * @deprecated since 2007-01-29. - */ - private transient boolean enableRemoteTrigger; - private volatile BuildAuthorizationToken authToken = null; /** @@ -253,8 +247,6 @@ public abstract class AbstractProject

,R extends A } }); - // boolean! Can't tell if xml file contained false.. - if (enableRemoteTrigger) OldDataMonitor.report(this, "1.77"); if(triggers==null) { // it didn't exist in < 1.28 triggers = new Vector>(); diff --git a/core/src/main/java/hudson/model/Descriptor.java b/core/src/main/java/hudson/model/Descriptor.java index e9d9ab4505..2220498c91 100644 --- a/core/src/main/java/hudson/model/Descriptor.java +++ b/core/src/main/java/hudson/model/Descriptor.java @@ -29,9 +29,6 @@ import hudson.XmlFile; import hudson.BulkChange; import hudson.Util; import static hudson.Functions.jsStringEscape; -import hudson.diagnosis.OldDataMonitor; -import hudson.init.InitMilestone; -import hudson.init.Initializer; import hudson.model.listeners.SaveableListener; import hudson.util.ReflectionUtils; import hudson.util.ReflectionUtils.Parameter; @@ -43,14 +40,12 @@ import org.springframework.util.StringUtils; import org.jvnet.tiger_types.Types; import org.apache.commons.io.IOUtils; -import static hudson.init.InitMilestone.EXTENSIONS_AUGMENTED; import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND; import javax.servlet.ServletException; import javax.servlet.RequestDispatcher; import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashMap; @@ -118,16 +113,6 @@ import java.beans.Introspector; * @see Describable */ public abstract class Descriptor> implements Saveable { - /** - * Up to Hudson 1.61 this was used as the primary persistence mechanism. - * Going forward Hudson simply persists all the non-transient fields - * of {@link Descriptor}, just like others, so this is pointless. - * - * @deprecated since 2006-11-16 - */ - @Deprecated - private transient Map properties; - /** * The class being described by this descriptor. */ @@ -881,10 +866,4 @@ public abstract class Descriptor> implements Saveable { * Used in {@link #checkMethods} to indicate that there's no check method. */ private static final String NONE = "\u0000"; - - private Object readResolve() { - if (properties!=null) - OldDataMonitor.report(this, "1.62"); - return this; - } } diff --git a/core/src/main/java/hudson/model/FingerprintMap.java b/core/src/main/java/hudson/model/FingerprintMap.java index f7fa95930c..eb53207661 100644 --- a/core/src/main/java/hudson/model/FingerprintMap.java +++ b/core/src/main/java/hudson/model/FingerprintMap.java @@ -1,7 +1,7 @@ /* * The MIT License * - * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi + * Copyright (c) 2004-2011, Sun Microsystems, Inc., Kohsuke Kawaguchi * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -24,13 +24,11 @@ package hudson.model; import hudson.Util; -import hudson.diagnosis.OldDataMonitor; import hudson.util.KeyedDataStorage; import java.io.File; import java.io.IOException; import java.util.Locale; -import java.util.concurrent.ConcurrentHashMap; /** * Cache of {@link Fingerprint}s. @@ -45,14 +43,6 @@ import java.util.concurrent.ConcurrentHashMap; */ public final class FingerprintMap extends KeyedDataStorage { - /** - * @deprecated since 2007-03-26. - * Some old version of Hudson incorrectly serialized this information to the disk. - * So we need this field to be here for such configuration to be read correctly. - * This field is otherwise no longer in use. - */ - private transient ConcurrentHashMap core = new ConcurrentHashMap(); - /** * Returns true if there's some data in the fingerprint database. */ @@ -102,11 +92,6 @@ public final class FingerprintMap extends KeyedDataStorage,B extends Build> return r; } - - /** - * @deprecated since 2006-11-05. - * Left for legacy config file compatibility - */ - @Deprecated - private transient String slave; - - private Object readResolve() { - if (slave != null) OldDataMonitor.report(this, "1.60"); - return this; - } } diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 86ad032d34..b854428300 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -1,7 +1,8 @@ /* * The MIT License * - * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, Erik Ramfelt, Martin Eigenbrodt, Stephen Connolly, Tom Huybrechts + * Copyright (c) 2004-2011, Sun Microsystems, Inc., Kohsuke Kawaguchi, + * Erik Ramfelt, Martin Eigenbrodt, Stephen Connolly, Tom Huybrechts * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,7 +28,6 @@ import hudson.FilePath; import hudson.Launcher; import hudson.Util; import hudson.Launcher.RemoteLauncher; -import hudson.diagnosis.OldDataMonitor; import hudson.model.Descriptor.FormException; import hudson.remoting.Callable; import hudson.remoting.VirtualChannel; @@ -337,12 +337,6 @@ public abstract class Slave extends Node implements Serializable { */ private Object readResolve() { // convert the old format to the new one - if(command!=null && agentCommand==null) { - if(command.length()>0) command += ' '; - agentCommand = command+"java -jar ~/bin/slave.jar"; - } - if (command!=null || localFS!=null) - OldDataMonitor.report(Hudson.getInstance(), "1.69"); if (launcher == null) { launcher = (agentCommand == null || agentCommand.trim().length() == 0) ? new JNLPLauncher() @@ -383,26 +377,10 @@ public abstract class Slave extends Node implements Serializable { // // backward compatibility // - /** - * In Hudson < 1.69 this was used to store the local file path - * to the remote workspace. No longer in use. - * - * @deprecated - * ... but still in use during the transition. - */ - private File localFS; - - /** - * In Hudson < 1.69 this was used to store the command - * to connect to the remote machine, like "ssh myslave". - * - * @deprecated - */ - private transient String command; - /** * Command line to launch the agent, like * "ssh myslave java -jar /path/to/hudson-remoting.jar" + * @deprecated in 1.216 */ private transient String agentCommand; diff --git a/core/src/main/java/hudson/tasks/Mailer.java b/core/src/main/java/hudson/tasks/Mailer.java index 6a8d759b65..d72614a36e 100644 --- a/core/src/main/java/hudson/tasks/Mailer.java +++ b/core/src/main/java/hudson/tasks/Mailer.java @@ -1,7 +1,7 @@ /* * The MIT License * - * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi, + * Copyright (c) 2004-2011, Sun Microsystems, Inc., Kohsuke Kawaguchi, * Bruce Chapman, Erik Ramfelt, Jean-Baptiste Quenot, Luca Domenico Milanesio * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -30,7 +30,6 @@ import hudson.Functions; import hudson.Launcher; import hudson.RestrictedSince; import hudson.Util; -import hudson.diagnosis.OldDataMonitor; import static hudson.Util.fixEmptyAndTrim; import hudson.model.AbstractBuild; import hudson.model.AbstractProject; @@ -40,14 +39,12 @@ import hudson.model.UserPropertyDescriptor; import hudson.model.Hudson; import hudson.util.FormValidation; import hudson.util.Secret; -import hudson.util.XStream2; import org.apache.tools.ant.types.selectors.SelectorUtils; import org.kohsuke.accmod.Restricted; import org.kohsuke.accmod.restrictions.NoExternalUse; import org.kohsuke.stapler.QueryParameter; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.export.Exported; -import com.thoughtworks.xstream.converters.UnmarshallingContext; import javax.mail.Authenticator; import javax.mail.Message; @@ -93,13 +90,6 @@ public class Mailer extends Notifier { */ public boolean sendToIndividuals; - // TODO: left so that XStream won't get angry. figure out how to set the error handling behavior - // in XStream. Deprecated since 2005-04-23. - private transient String from; - private transient String subject; - private transient boolean failureOnly; - private transient String charset; - @Override public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException { if(debug) @@ -516,12 +506,4 @@ public class Mailer extends Notifier { * Debug probe point to be activated by the scripting console. */ public static boolean debug = false; - - public static class ConverterImpl extends XStream2.PassthruConverter { - public ConverterImpl(XStream2 xstream) { super(xstream); } - @Override protected void callback(Mailer m, UnmarshallingContext context) { - if (m.from != null || m.subject != null || m.failureOnly || m.charset != null) - OldDataMonitor.report(context, "1.10"); - } - } } -- GitLab