提交 9fed9823 编写于 作者: M mindless

Add @Override annotations, remove unused imports,

add some copyright headers, some tab->ws


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21654 71c3de6d-444a-0410-be80-ed276b4c234a
上级 7c2d1e94
......@@ -389,6 +389,7 @@ public class ClassicPluginStrategy implements PluginStrategy {
this.dependencies = dependencies;
}
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
for (Dependency dep : dependencies) {
PluginWrapper p = pluginManager.getPlugin(dep.shortName);
......
......@@ -36,6 +36,7 @@ public class CloseProofOutputStream extends DelegatingOutputStream {
super(out);
}
@Override
public void close() {
}
}
......@@ -29,7 +29,6 @@ import hudson.model.Hudson;
import hudson.model.ViewDescriptor;
import hudson.model.Descriptor.FormException;
import hudson.util.Memoizer;
import hudson.util.Iterators;
import hudson.util.Iterators.FlattenIterator;
import hudson.slaves.NodeDescriptor;
import hudson.tasks.Publisher;
......
......@@ -54,6 +54,7 @@ final class ExpressionFactory2 implements ExpressionFactory {
this.expression = expression;
}
@Override
public String toString() {
return super.toString() + "[" + expression.getExpression() + "]";
}
......
......@@ -103,6 +103,7 @@ public class ExtensionList<T> extends AbstractList<T> {
return null;
}
@Override
public Iterator<T> iterator() {
// we need to intercept mutation, so for now don't allow Iterator.remove
return Iterators.readOnly(ensureLoaded().iterator());
......
......@@ -61,6 +61,7 @@ public class ExtensionListView {
return Hudson.getInstance().getExtensionList(type);
}
@Override
public Iterator<T> iterator() {
return storage().iterator();
}
......@@ -73,10 +74,12 @@ public class ExtensionListView {
return storage().size();
}
@Override
public boolean add(T t) {
return storage().add(t);
}
@Override
public void add(int index, T t) {
// index ignored
storage().add(t);
......
......@@ -31,7 +31,6 @@ import hudson.model.Describable;
import hudson.model.Job;
import hudson.model.TaskListener;
import hudson.model.Hudson;
import hudson.model.Executor;
import hudson.model.listeners.RunListener;
import hudson.scm.SCM;
......@@ -40,7 +39,6 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.Closeable;
/**
* Prepares and provisions workspaces for {@link AbstractProject}s.
......
......@@ -25,7 +25,6 @@ package hudson;
import hudson.model.Descriptor;
import hudson.model.TaskListener;
import hudson.model.AbstractBuild;
import java.io.IOException;
......
......@@ -2,9 +2,6 @@ package hudson;
import hudson.model.Hudson;
import hudson.model.Node;
import hudson.model.TaskListener;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
import hudson.model.Executor;
import hudson.tasks.BuildWrapper;
......
......@@ -228,6 +228,7 @@ public class MarkupText extends AbstractMarkupText {
/**
* Returns the fully marked-up text.
*/
@Override
public String toString() {
if(tags.isEmpty())
return text; // the most common case
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson;
import java.io.File;
......
......@@ -102,14 +102,14 @@ public final class PluginWrapper {
*/
private final String shortName;
/**
/**
* True if this plugin is activated for this session.
* The snapshot of <tt>disableFile.exists()</tt> as of the start up.
*/
private final boolean active;
private final List<Dependency> dependencies;
private final List<Dependency> optionalDependencies;
private final List<Dependency> optionalDependencies;
static final class Dependency {
public final String shortName;
......@@ -202,12 +202,12 @@ public final class PluginWrapper {
}
public List<Dependency> getDependencies() {
return dependencies;
}
return dependencies;
}
public List<Dependency> getOptionalDependencies() {
return optionalDependencies;
}
public List<Dependency> getOptionalDependencies() {
return optionalDependencies;
}
/**
......@@ -326,17 +326,17 @@ public final class PluginWrapper {
}
public Manifest getManifest() {
return manifest;
}
return manifest;
}
public void setPlugin(Plugin plugin) {
this.plugin = plugin;
plugin.wrapper = this;
}
public String getPluginClass() {
return manifest.getMainAttributes().getValue("Plugin-Class");
}
public void setPlugin(Plugin plugin) {
this.plugin = plugin;
plugin.wrapper = this;
}
public String getPluginClass() {
return manifest.getMainAttributes().getValue("Plugin-Class");
}
/**
* If the plugin has {@link #getUpdateInfo() an update},
......
......@@ -238,6 +238,7 @@ public abstract class Proc {
this.out = out;
}
@Override
public void run() {
try {
try {
......
......@@ -112,6 +112,7 @@ public final class ProxyConfiguration implements Saveable {
if(p.getUserName()!=null) {
// Add an authenticator which provides the credentials for proxy authentication
Authenticator.setDefault(new Authenticator() {
@Override
public PasswordAuthentication getPasswordAuthentication() {
ProxyConfiguration p = Hudson.getInstance().proxy;
return new PasswordAuthentication(p.getUserName(),
......
......@@ -28,15 +28,11 @@ import java.util.*;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
/**
* This filter allows you to modify headers set by the container or other servlets
......
......@@ -33,7 +33,6 @@ import hudson.remoting.Channel.Listener;
import hudson.remoting.Channel.Mode;
import hudson.cli.CliManagerImpl;
import hudson.cli.CliEntryPoint;
import hudson.util.IOException2;
import java.io.DataInputStream;
import java.io.IOException;
......@@ -110,6 +109,7 @@ public final class TcpSlaveAgentListener extends Thread {
return Hudson.getInstance().getSecretKey();
}
@Override
public void run() {
try {
// the loop eventually terminates when the socket is closed.
......@@ -150,6 +150,7 @@ public final class TcpSlaveAgentListener extends Thread {
}
}
@Override
public void run() {
try {
LOGGER.info("Accepted connection #"+id+" from "+s.getRemoteSocketAddress());
......@@ -229,6 +230,7 @@ public final class TcpSlaveAgentListener extends Thread {
computer.setChannel(new BufferedInputStream(this.s.getInputStream()), new BufferedOutputStream(this.s.getOutputStream()), log,
new Listener() {
@Override
public void onClosed(Channel channel, IOException cause) {
try {
log.close();
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson;
import hudson.model.Hudson;
......
......@@ -185,6 +185,7 @@ public final class WebAppMain implements ServletContextListener {
context.setAttribute(APP,new HudsonIsLoading());
new Thread("hudson initialization thread") {
@Override
public void run() {
try {
context.setAttribute(APP,new Hudson(home,context));
......
......@@ -179,6 +179,7 @@ public final class XmlFile {
file.getParentFile().mkdirs();
}
@Override
public String toString() {
return file.toString();
}
......@@ -232,14 +233,17 @@ public final class XmlFile {
try {
JAXP.newSAXParser().parse(file,new DefaultHandler() {
private Locator loc;
@Override
public void setDocumentLocator(Locator locator) {
this.loc = locator;
}
@Override
public void startDocument() throws SAXException {
attempt();
}
@Override
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
attempt();
// if we still haven't found it at the first start element,
......
......@@ -113,6 +113,7 @@ public final class Axis implements Comparable<Axis>, Iterable<String> {
return this.name.compareTo(that.name);
}
@Override
public String toString() {
return new StringBuilder().append(name).append("={").append(Util.join(values,",")).append('}').toString();
}
......
......@@ -57,6 +57,7 @@ public class AxisList extends ArrayList<Axis> {
return null;
}
@Override
public boolean add(Axis axis) {
return axis!=null && super.add(axis);
}
......@@ -111,6 +112,7 @@ public class AxisList extends ArrayList<Axis> {
super(xs);
}
@Override
public boolean canConvert(Class type) {
return type==AxisList.class;
}
......
......@@ -175,6 +175,7 @@ public final class Combination extends TreeMap<String,String> implements Compara
return buf.toString();
}
@Override
public String toString() {
return toString(',','=');
}
......@@ -239,18 +240,22 @@ public final class Combination extends TreeMap<String,String> implements Compara
}
// read-only
@Override
public void clear() {
throw new UnsupportedOperationException();
}
@Override
public void putAll(Map<? extends String, ? extends String> map) {
throw new UnsupportedOperationException();
}
@Override
public String put(String key, String value) {
throw new UnsupportedOperationException();
}
@Override
public String remove(Object key) {
throw new UnsupportedOperationException();
}
......
......@@ -25,8 +25,6 @@ package hudson.matrix;
import hudson.ExtensionPoint;
import hudson.Launcher;
import hudson.model.Action;
import hudson.model.Build;
import hudson.model.BuildListener;
import hudson.tasks.BuildStep;
import hudson.tasks.Publisher;
......
......@@ -132,6 +132,7 @@ public class MatrixBuild extends AbstractBuild<MatrixProject,MatrixBuild> {
return r;
}
@Override
public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) {
try {
MatrixRun item = getRun(Combination.fromString(token));
......
......@@ -57,6 +57,7 @@ public class MatrixRun extends Build<MatrixConfiguration,MatrixRun> {
super(project, buildDir);
}
@Override
public String getUpUrl() {
StaplerRequest req = Stapler.getCurrentRequest();
if(req!=null) {
......@@ -84,6 +85,7 @@ public class MatrixRun extends Build<MatrixConfiguration,MatrixRun> {
return getParent().getParent().getBuildByNumber(getNumber());
}
@Override
public String getDisplayName() {
StaplerRequest req = Stapler.getCurrentRequest();
if(req!=null) {
......
......@@ -92,6 +92,7 @@ public enum BallColor {
/**
* Also used as a final name.
*/
@Override
public String toString() {
return name().toLowerCase(Locale.ENGLISH);
}
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
import org.kohsuke.stapler.StaplerRequest;
......
......@@ -147,6 +147,7 @@ public abstract class Build <P extends Project<P,B>,B extends Build<P,B>>
performAllBuildStep(listener, project.getProperties(),true);
}
@Override
public void cleanUp(BuildListener listener) throws Exception {
performAllBuildStep(listener, project.getPublishers(),false);
performAllBuildStep(listener, project.getProperties(),false);
......
......@@ -84,6 +84,7 @@ public final class BuildAuthorizationToken {
return new BuildAuthorizationToken(str);
}
@Override
protected String toString(Object obj) {
return ((BuildAuthorizationToken)obj).token;
}
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
/**
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
import hudson.Extension;
......
......@@ -77,6 +77,7 @@ public class Executor extends Thread implements ModelObject {
start();
}
@Override
public void run() {
// run as the system user. see ACL.SYSTEM for more discussion about why this is somewhat broken
SecurityContextHolder.getContext().setAuthentication(ACL.SYSTEM);
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
import org.kohsuke.stapler.HttpResponse;
......
......@@ -64,6 +64,7 @@ public class FileParameterValue extends ParameterValue {
this.location = location;
}
@Override
public BuildWrapper createBuildWrapper(AbstractBuild<?,?> build) {
return new BuildWrapper() {
public Environment setUp(AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
......@@ -106,7 +107,7 @@ public class FileParameterValue extends ParameterValue {
return true;
}
@Override
@Override
public String getShortDescription() {
return "(FileParameterValue) " + getName() + "='" + file.getName() + "'";
}
......
......@@ -213,6 +213,7 @@ public class Fingerprint implements ModelObject, Saveable {
return this.end==that.start;
}
@Override
public String toString() {
return "["+start+","+end+")";
}
......@@ -400,6 +401,7 @@ public class Fingerprint implements ModelObject, Saveable {
this.ranges.addAll(that.ranges.subList(rhs,that.ranges.size()));
}
@Override
public synchronized String toString() {
StringBuffer buf = new StringBuffer();
for (Range r : ranges) {
......@@ -759,6 +761,7 @@ public class Fingerprint implements ModelObject, Saveable {
XSTREAM.registerConverter(new HexBinaryConverter(),10);
XSTREAM.registerConverter(new RangeSet.ConverterImpl(
new CollectionConverter(XSTREAM.getClassMapper()) {
@Override
protected Object createCollection(Class type) {
return new ArrayList();
}
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
import hudson.model.Queue.Task;
......@@ -11,5 +34,5 @@ import java.util.List;
* be a duplicate of a build already in the build queue.
*/
public interface FoldableAction extends Action {
public void foldIntoExisting(Task t, List<Action> actions);
public void foldIntoExisting(Task t, List<Action> actions);
}
......@@ -23,7 +23,6 @@
*/
package hudson.model;
import hudson.FilePath;
import hudson.Extension;
import java.io.File;
......@@ -84,6 +83,7 @@ public class FreeStyleProject extends Project<FreeStyleProject,FreeStyleBuild> i
save();
}
@Override
protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, Descriptor.FormException {
if(req.hasParameter("customWorkspace"))
customWorkspace = req.getParameter("customWorkspace.directory");
......
......@@ -61,6 +61,7 @@ public abstract class JobPropertyDescriptor extends Descriptor<JobProperty<?>> {
* @return
* null to avoid setting an instance of {@link JobProperty} to the target project.
*/
@Override
public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException {
// JobPropertyDescriptors are bit different in that we allow them even without any user-visible configuration parameter,
// so replace the lack of form data by an empty one.
......
......@@ -297,6 +297,7 @@ public class Label implements Comparable<Label>, ModelObject {
return new Api(this);
}
@Override
public boolean equals(Object that) {
if (this == that) return true;
if (that == null || getClass() != that.getClass()) return false;
......@@ -305,6 +306,7 @@ public class Label implements Comparable<Label>, ModelObject {
}
@Override
public int hashCode() {
return name.hashCode();
}
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
import hudson.model.Node.Mode;
......
......@@ -216,6 +216,7 @@ public class MyViewsProperty extends UserProperty implements ViewGroup, Action {
}
}
@Override
public UserProperty reconfigure(StaplerRequest req, JSONObject form) throws FormException {
req.bindJSON(this, form);
return this;
......
......@@ -65,7 +65,7 @@ public class ParametersDefinitionProperty extends JobProperty<AbstractProject<?,
return owner;
}
@Exported
@Exported
public List<ParameterDefinition> getParameterDefinitions() {
return parameterDefinitions;
}
......
......@@ -27,14 +27,8 @@ import hudson.triggers.SafeTimerTask;
import hudson.triggers.Trigger;
import hudson.ExtensionPoint;
import hudson.Extension;
import hudson.DescriptorExtensionList;
import hudson.ExtensionList;
import hudson.scm.SCMDescriptor;
import hudson.scm.SCM;
import hudson.util.StreamTaskListener;
import hudson.util.NullStream;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.Random;
import java.util.Timer;
......@@ -90,7 +84,7 @@ public abstract class PeriodicWork extends SafeTimerTask implements ExtensionPoi
return Hudson.getInstance().getExtensionList(PeriodicWork.class);
}
// time constants
// time constants
protected static final long MIN = 1000*60;
protected static final long HOUR =60*MIN;
protected static final long DAY = 24*HOUR;
......
......@@ -34,7 +34,6 @@ import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerFallback;
import org.kohsuke.stapler.StaplerProxy;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
......
......@@ -97,6 +97,7 @@ public final class Resource {
return false;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
......@@ -111,6 +112,7 @@ public final class Resource {
return lhs.equals(rhs);
}
@Override
public int hashCode() {
return displayName.hashCode();
}
......
......@@ -23,19 +23,14 @@
*/
package hudson.model;
import hudson.model.Queue.Task;
import hudson.util.AdaptedIterator;
import java.util.Set;
import java.util.HashSet;
import java.util.Map;
import java.util.HashMap;
import java.util.Collection;
import java.util.AbstractCollection;
import java.util.Iterator;
import org.apache.commons.collections.iterators.FilterIterator;
/**
* Controls mutual exclusion of {@link ResourceList}.
* @author Kohsuke Kawaguchi
......
......@@ -135,6 +135,7 @@ public final class ResourceList {
return null;
}
@Override
public String toString() {
Map<Resource,String> m = new HashMap<Resource,String>();
for (Resource r : all)
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
import hudson.ExtensionPoint;
......
......@@ -66,6 +66,7 @@ public final class RunMap<R extends Run<?,R>> extends AbstractMap<Integer,R> imp
return put(value.getNumber(),value);
}
@Override
public synchronized R put(Integer key, R value) {
// copy-on-write update
TreeMap<Integer,R> m = new TreeMap<Integer,R>(builds);
......@@ -76,6 +77,7 @@ public final class RunMap<R extends Run<?,R>> extends AbstractMap<Integer,R> imp
return r;
}
@Override
public synchronized void putAll(Map<? extends Integer,? extends R> rhs) {
// copy-on-write update
TreeMap<Integer,R> m = new TreeMap<Integer,R>(builds);
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
import hudson.model.Run.Runner;
......
......@@ -54,6 +54,7 @@ public class StringParameterDefinition extends ParameterDefinition {
this.defaultValue = defaultValue;
}
@Override
public StringParameterValue getDefaultParameterValue() {
StringParameterValue v = new StringParameterValue(getName(), defaultValue, getDescription());
return v;
......
......@@ -90,7 +90,7 @@ public class StringParameterValue extends ParameterValue {
return true;
}
@Override
@Override
public String toString() {
return "(StringParameterValue) " + getName() + "='" + value + "'";
}
......
......@@ -92,6 +92,7 @@ public abstract class TaskThread extends Thread {
/**
* Starts the task execution asynchronously.
*/
@Override
public void start() {
associateWith(owner);
super.start();
......@@ -110,6 +111,7 @@ public abstract class TaskThread extends Thread {
return ListenerAndText.forMemory();
}
@Override
public final void run() {
isRunning = true;
try {
......
......@@ -97,6 +97,7 @@ public final class TimeSeries {
return history[0];
}
@Override
public String toString() {
return Float.toString(history[0]);
}
......
......@@ -52,7 +52,6 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.InputStream;
import java.io.ByteArrayOutputStream;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;
......
......@@ -25,7 +25,6 @@ package hudson.model;
import com.thoughtworks.xstream.XStream;
import hudson.CopyOnWrite;
import hudson.Extension;
import hudson.FeedAdapter;
import hudson.Util;
import hudson.XmlFile;
......@@ -39,12 +38,8 @@ import hudson.util.RunList;
import hudson.util.XStream2;
import net.sf.json.JSONObject;
import org.acegisecurity.AccessDeniedException;
import org.acegisecurity.Authentication;
import org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken;
import org.kohsuke.stapler.HttpRedirect;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.StaplerProxy;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;
......@@ -65,10 +60,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.kohsuke.stapler.StaplerFallback;
/**
* Represents a user.
......
......@@ -27,7 +27,6 @@ import hudson.ExtensionPoint;
import hudson.Plugin;
import hudson.DescriptorExtensionList;
import hudson.model.Descriptor.FormException;
import hudson.tasks.Mailer;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
......
......@@ -84,7 +84,7 @@ public abstract class ViewJob<JobT extends ViewJob<JobT,RunT>, RunT extends Run<
return false;
}
@Override
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException {
super.onLoad(parent, name);
notLoaded = true;
......@@ -169,6 +169,7 @@ public abstract class ViewJob<JobT extends ViewJob<JobT,RunT>, RunT extends Run<
return Hudson.getInstance().isTerminating();
}
@Override
public void run() {
while (!terminating()) {
try {
......
......@@ -25,7 +25,6 @@ package hudson.node_monitors;
import hudson.model.Computer;
import hudson.model.Node;
import hudson.model.Descriptor;
import hudson.util.ClockDifference;
import hudson.Extension;
import org.kohsuke.stapler.StaplerRequest;
......
......@@ -76,6 +76,7 @@ public class ResponseTimeMonitor extends NodeMonitor {
return Messages.ResponseTimeMonitor_DisplayName();
}
@Override
public NodeMonitor newInstance(StaplerRequest req, JSONObject formData) throws FormException {
return new ResponseTimeMonitor();
}
......@@ -133,6 +134,7 @@ public class ResponseTimeMonitor extends NodeMonitor {
/**
* HTML rendering of the data
*/
@Override
public String toString() {
// StringBuilder buf = new StringBuilder();
// for (long l : past5) {
......
......@@ -201,15 +201,15 @@ public abstract class ChangeLogSet<T extends ChangeLogSet.Entry> implements Iter
*
* @return never null.
*/
public String getPath();
public String getPath();
/**
* Return whether the file is new/modified/deleted
*
* @return EditType
* @see EditType
*/
public EditType getEditType();
/**
* Return whether the file is new/modified/deleted
*
* @return EditType
* @see EditType
*/
public EditType getEditType();
}
}
......@@ -65,6 +65,7 @@ public class NullSCM extends SCM {
return Messages.NullSCM_DisplayName();
}
@Override
public SCM newInstance(StaplerRequest req, JSONObject formData) throws FormException {
return new NullSCM();
}
......
......@@ -43,6 +43,7 @@ public final class QueryBuilder {
return this;
}
@Override
public String toString() {
return buf.toString();
}
......
......@@ -30,7 +30,6 @@ import hudson.scm.CVSChangeLogSet.Revision;
import hudson.scm.CVSRepositoryBrowser;
import hudson.scm.RepositoryBrowser;
import hudson.Extension;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.DataBoundConstructor;
import java.io.IOException;
......
......@@ -73,6 +73,7 @@ public abstract class AbstractPasswordBasedSecurityRealm extends SecurityRealm i
* This is an optional method that improves the user experience. If your backend doesn't support
* a query like this, just always throw {@link UsernameNotFoundException}.
*/
@Override
public abstract UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException;
/**
......@@ -80,6 +81,7 @@ public abstract class AbstractPasswordBasedSecurityRealm extends SecurityRealm i
*
* This method is the group version of the {@link #loadUserByUsername(String)}.
*/
@Override
public abstract GroupDetails loadGroupByGroupname(String groupname) throws UsernameNotFoundException, DataAccessException;
class Authenticator extends AbstractUserDetailsAuthenticationProvider {
......
......@@ -64,10 +64,12 @@ public class FullControlOnceLoggedInAuthorizationStrategy extends AuthorizationS
return Messages.FullControlOnceLoggedInAuthorizationStrategy_DisplayName();
}
@Override
public AuthorizationStrategy newInstance(StaplerRequest req, JSONObject formData) throws FormException {
return new FullControlOnceLoggedInAuthorizationStrategy();
}
@Override
public String getHelpFile() {
return "/help/security/full-control-once-logged-in.html";
}
......
......@@ -55,6 +55,7 @@ import java.text.MessageFormat;
* @author Kohsuke Kawaguchi
*/
public class HudsonAuthenticationEntryPoint extends AuthenticationProcessingFilterEntryPoint {
@Override
public void commence(ServletRequest request, ServletResponse response, AuthenticationException authException) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse rsp = (HttpServletResponse) response;
......
......@@ -43,6 +43,7 @@ import javax.servlet.http.HttpSession;
public class NotSerilizableSecurityContext implements SecurityContext {
private transient Authentication authentication;
@Override
public boolean equals(Object obj) {
if (obj instanceof SecurityContextImpl) {
SecurityContextImpl test = (SecurityContextImpl) obj;
......@@ -64,6 +65,7 @@ public class NotSerilizableSecurityContext implements SecurityContext {
return authentication;
}
@Override
public int hashCode() {
if (this.authentication == null) {
return -1;
......@@ -76,6 +78,7 @@ public class NotSerilizableSecurityContext implements SecurityContext {
this.authentication = authentication;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(super.toString());
......
......@@ -71,10 +71,12 @@ public class ProjectMatrixAuthorizationStrategy extends GlobalMatrixAuthorizatio
ref = new RobustReflectionConverter(m,new JVM().bestReflectionProvider());
}
@Override
protected GlobalMatrixAuthorizationStrategy create() {
return new ProjectMatrixAuthorizationStrategy();
}
@Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
String name = reader.peekNextChild();
if(name!=null && (name.equals("permission") || name.equals("useProjectSecurity")))
......@@ -85,6 +87,7 @@ public class ProjectMatrixAuthorizationStrategy extends GlobalMatrixAuthorizatio
return ref.unmarshal(reader,context);
}
@Override
public boolean canConvert(Class type) {
return type==ProjectMatrixAuthorizationStrategy.class;
}
......
......@@ -30,7 +30,6 @@ import org.acegisecurity.acls.sid.GrantedAuthoritySid;
import org.acegisecurity.acls.sid.Sid;
import java.util.logging.Logger;
import java.util.logging.Level;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.FINER;
......
......@@ -24,9 +24,6 @@
package hudson.security;
import org.acegisecurity.Authentication;
import org.acegisecurity.GrantedAuthority;
import org.acegisecurity.acls.sid.GrantedAuthoritySid;
import org.acegisecurity.acls.sid.PrincipalSid;
import org.acegisecurity.acls.sid.Sid;
import java.util.ArrayList;
......@@ -68,6 +65,7 @@ public class SparseACL extends SidACL {
add(new Entry(sid,permission,allowed));
}
@Override
public boolean hasPermission(Authentication a, Permission permission) {
if(a==SYSTEM) return true;
Boolean b = _hasPermission(a,permission);
......
......@@ -39,12 +39,14 @@ import org.apache.commons.codec.digest.DigestUtils;
* @author Kohsuke Kawaguchi
*/
public class TokenBasedRememberMeServices2 extends TokenBasedRememberMeServices {
@Override
protected String makeTokenSignature(long tokenExpiryTime, UserDetails userDetails) {
String expectedTokenSignature = DigestUtils.md5Hex(userDetails.getUsername() + ":" + tokenExpiryTime + ":"
+ "N/A" + ":" + getKey());
return expectedTokenSignature;
}
@Override
protected String retrievePassword(Authentication successfulAuthentication) {
return "N/A";
}
......
......@@ -14,7 +14,6 @@ import java.util.logging.Logger;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
......@@ -26,7 +25,6 @@ import javax.servlet.http.HttpServletResponse;
* protect against cross site request forgeries.
*
* @author dty
*
*/
public class CrumbFilter implements Filter {
/**
......@@ -117,5 +115,6 @@ public class CrumbFilter implements Filter {
*/
public void destroy() {
}
private static final Logger LOGGER = Logger.getLogger(CrumbFilter.class.getName());
}
......@@ -5,8 +5,6 @@
*/
package hudson.security.csrf;
import org.kohsuke.stapler.StaplerRequest;
import hudson.Util;
import hudson.model.Descriptor;
......@@ -15,7 +13,6 @@ import hudson.model.Descriptor;
* additional global configuration for custom crumb issuers.
*
* @author dty
*
*/
public abstract class CrumbIssuerDescriptor<T extends CrumbIssuer> extends Descriptor<CrumbIssuer> {
......
......@@ -26,7 +26,6 @@ import org.kohsuke.stapler.StaplerRequest;
* A crumb issuing algorithm based on the request principal and the remote address.
*
* @author dty
*
*/
public class DefaultCrumbIssuer extends CrumbIssuer {
......@@ -115,6 +114,7 @@ public class DefaultCrumbIssuer extends CrumbIssuer {
return Messages.DefaultCrumbIssuer_DisplayName();
}
@Override
public DefaultCrumbIssuer newInstance(StaplerRequest req, JSONObject formData) throws FormException {
return new DefaultCrumbIssuer();
}
......
......@@ -109,6 +109,7 @@ public class CommandLauncher extends ComputerLauncher {
proc.getErrorStream(), listener.getLogger()).start();
computer.setChannel(proc.getInputStream(), proc.getOutputStream(), listener.getLogger(), new Channel.Listener() {
@Override
public void onClosed(Channel channel, IOException cause) {
if (cause != null) {
cause.printStackTrace(
......
......@@ -24,7 +24,6 @@
package hudson.slaves;
import hudson.model.Descriptor;
import hudson.model.Node;
import hudson.model.TaskListener;
import java.io.IOException;
......@@ -53,22 +52,27 @@ public abstract class ComputerLauncherFilter extends ComputerLauncher {
return core;
}
@Override
public boolean isLaunchSupported() {
return core.isLaunchSupported();
}
@Override
public void launch(SlaveComputer computer, TaskListener listener) throws IOException, InterruptedException {
core.launch(computer, listener);
}
@Override
public void afterDisconnect(SlaveComputer computer, TaskListener listener) {
core.afterDisconnect(computer, listener);
}
@Override
public void beforeDisconnect(SlaveComputer computer, TaskListener listener) {
core.beforeDisconnect(computer, listener);
}
@Override
public Descriptor<ComputerLauncher> getDescriptor() {
throw new UnsupportedOperationException();
}
......
......@@ -45,12 +45,12 @@ import java.util.List;
*/
public class EnvironmentVariablesNodeProperty extends NodeProperty<Node> {
/**
/**
* Slave-specific environment variables
*/
private final EnvVars envVars;
@DataBoundConstructor
@DataBoundConstructor
public EnvironmentVariablesNodeProperty(List<Entry> env) {
this.envVars = toMap(env);
}
......@@ -64,13 +64,13 @@ public class EnvironmentVariablesNodeProperty extends NodeProperty<Node> {
}
@Override
public Environment setUp(AbstractBuild build, Launcher launcher,
public Environment setUp(AbstractBuild build, Launcher launcher,
BuildListener listener) throws IOException, InterruptedException {
return Environment.create(envVars);
}
}
@Extension
public static class DescriptorImpl extends NodePropertyDescriptor {
public static class DescriptorImpl extends NodePropertyDescriptor {
@Override
public String getDisplayName() {
......@@ -88,7 +88,7 @@ public class EnvironmentVariablesNodeProperty extends NodeProperty<Node> {
return "/help/system-config/globalEnvironmentVariables.html";
}
}
}
}
public static class Entry {
public String key, value;
......
......@@ -65,10 +65,12 @@ public final class NodeList extends CopyOnWriteArrayList<Node> {
super(xstream);
}
@Override
public boolean canConvert(Class type) {
return type==NodeList.class;
}
@Override
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
for (Node o : (NodeList) source) {
if(o instanceof EphemeralNode)
......@@ -77,10 +79,12 @@ public final class NodeList extends CopyOnWriteArrayList<Node> {
}
}
@Override
protected Object createCollection(Class type) {
return new ArrayList();
}
@Override
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
return new NodeList((List<Node>)super.unmarshal(reader, context));
}
......
......@@ -26,7 +26,6 @@ package hudson.slaves;
import hudson.ExtensionPoint;
import hudson.Launcher;
import hudson.DescriptorExtensionList;
import hudson.FilePath;
import hudson.scm.SCM;
import hudson.model.AbstractBuild;
import hudson.model.BuildListener;
......@@ -34,10 +33,8 @@ import hudson.model.Describable;
import hudson.model.Environment;
import hudson.model.Hudson;
import hudson.model.Node;
import hudson.tasks.Builder;
import java.io.IOException;
import java.io.File;
import java.util.List;
/**
......@@ -65,9 +62,9 @@ import java.util.List;
public abstract class NodeProperty<N extends Node> implements Describable<NodeProperty<?>>, ExtensionPoint {
protected transient N node;
protected void setNode(N node) { this.node = node; }
protected void setNode(N node) { this.node = node; }
public NodePropertyDescriptor getDescriptor() {
return (NodePropertyDescriptor)Hudson.getInstance().getDescriptor(getClass());
}
......
......@@ -54,7 +54,7 @@ public abstract class OfflineCause {
this.description = description;
}
@Exported(name="description")
@Exported(name="description") @Override
public String toString() {
return description.toString();
}
......
......@@ -25,7 +25,6 @@ package hudson.tasks;
import hudson.FilePath;
import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.AbstractProject;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
......@@ -54,6 +53,7 @@ public class BatchFile extends CommandInterpreter {
@Extension
public static final class DescriptorImpl extends BuildStepDescriptor<Builder> {
@Override
public String getHelpFile() {
return "/help/project-config/batch.html";
}
......@@ -62,6 +62,7 @@ public class BatchFile extends CommandInterpreter {
return Messages.BatchFile_DisplayName();
}
@Override
public Builder newInstance(StaplerRequest req, JSONObject data) {
return new BatchFile(data.getString("batchFile"));
}
......
......@@ -252,10 +252,12 @@ public class BuildTrigger extends Recorder implements DependecyDeclarer, MatrixA
return Messages.BuildTrigger_DisplayName();
}
@Override
public String getHelpFile() {
return "/help/project-config/downstream.html";
}
@Override
public Publisher newInstance(StaplerRequest req, JSONObject formData) throws FormException {
return new BuildTrigger(
formData.getString("childProjects"),
......
......@@ -28,7 +28,6 @@ import hudson.Launcher;
import hudson.Util;
import hudson.EnvVars;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.model.TaskListener;
......
......@@ -113,6 +113,7 @@ public class JavadocArchiver extends Recorder {
return true;
}
@Override
public Action getProjectAction(AbstractProject project) {
return new JavadocAction(project);
}
......
......@@ -37,7 +37,6 @@ import java.util.GregorianCalendar;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.FINER;
import java.util.logging.Logger;
import java.util.logging.Level;
/**
* Deletes old log files.
......
......@@ -26,18 +26,13 @@ package hudson.tasks;
import hudson.FilePath;
import hudson.Util;
import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.AbstractProject;
import static hudson.model.Hudson.isWindows;
import hudson.util.FormFieldValidator;
import hudson.util.FormValidation;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.QueryParameter;
import javax.servlet.ServletException;
import java.io.IOException;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
......@@ -97,6 +92,7 @@ public class Shell extends CommandInterpreter {
return ".sh";
}
@Override
public DescriptorImpl getDescriptor() {
return (DescriptorImpl)super.getDescriptor();
}
......@@ -116,6 +112,7 @@ public class Shell extends CommandInterpreter {
return true;
}
@Override
protected void convert(Map<String, Object> oldPropertyBag) {
shell = (String)oldPropertyBag.get("shell");
}
......@@ -135,6 +132,7 @@ public class Shell extends CommandInterpreter {
save();
}
@Override
public String getHelpFile() {
return "/help/project-config/shell.html";
}
......@@ -143,6 +141,7 @@ public class Shell extends CommandInterpreter {
return Messages.Shell_DisplayName();
}
@Override
public Builder newInstance(StaplerRequest req, JSONObject data) {
return new Shell(data.getString("shell"));
}
......
......@@ -376,6 +376,7 @@ public final class CaseResult extends TestObject implements Comparable<CaseResul
return text;
}
@Override
public AbstractBuild<?,?> getOwner() {
return getSuiteResult().getParent().getOwner();
}
......
......@@ -93,12 +93,13 @@ public final class ClassResult extends TabulatedResult implements Comparable<Cla
return null;
}
@Override
public Object getDynamic(String name, StaplerRequest req, StaplerResponse rsp) {
CaseResult c = getCaseResult(name);
if (c != null) {
return c;
return c;
} else {
return super.getDynamic(name, req, rsp);
return super.getDynamic(name, req, rsp);
}
}
......
......@@ -212,6 +212,7 @@ public class History {
return this.o.getOwner().number - that.o.getOwner().number;
}
@Override
public boolean equals(Object o) {
if (!(o instanceof ChartLabel)) {
return false;
......@@ -224,10 +225,12 @@ public class History {
return null;
}
@Override
public int hashCode() {
return o.hashCode();
}
@Override
public String toString() {
String l = o.getOwner().getDisplayName();
String s = o.getOwner().getBuiltOnStr();
......
......@@ -112,6 +112,7 @@ public final class PackageResult extends MetaTabulatedResult implements Comparab
return skipCount;
}
@Override
public Object getDynamic(String name, StaplerRequest req, StaplerResponse rsp) {
ClassResult result = getClassResult(name);
if (result != null) {
......
......@@ -28,19 +28,8 @@ import hudson.model.AbstractBuild;
import hudson.model.AbstractModelObject;
import hudson.model.Action;
import hudson.model.Api;
import hudson.model.Build;
import hudson.model.Item;
import hudson.model.Messages;
import hudson.model.Result;
import hudson.model.Run;
import hudson.util.ChartUtil;
import hudson.util.ColorPalette;
import hudson.util.DataSetBuilder;
import hudson.util.ShiftedCategoryAxis;
import hudson.util.StackedAreaRenderer2;
import java.awt.Color;
import java.awt.Paint;
import java.io.IOException;
import java.io.Serializable;
import java.util.Collection;
......@@ -50,16 +39,6 @@ import java.util.WeakHashMap;
import javax.servlet.ServletException;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.StackedAreaRenderer;
import org.jfree.data.category.CategoryDataset;
import org.jfree.ui.RectangleInsets;
import org.kohsuke.stapler.HttpRedirect;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.QueryParameter;
......@@ -83,7 +62,7 @@ public abstract class TestObject extends AbstractModelObject implements Serializ
/**
* Reverse pointer of {@link TabulatedResult#getChildren()}.
*/
public abstract TestObject getParent();
public abstract TestObject getParent();
public String getId() {
if (id == null) {
......@@ -253,5 +232,5 @@ public abstract class TestObject extends AbstractModelObject implements Serializ
return new HttpRedirect(".");
}
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
}
......@@ -103,6 +103,7 @@ public final class TestResult extends MetaTabulatedResult {
return null;
}
@Override
public String getId() {
return "";
}
......@@ -200,6 +201,7 @@ public final class TestResult extends MetaTabulatedResult {
return Messages.TestResult_getDisplayName();
}
@Override
public AbstractBuild<?,?> getOwner() {
return parent.owner;
}
......@@ -271,6 +273,7 @@ public final class TestResult extends MetaTabulatedResult {
return "";
}
@Override
public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) {
PackageResult result = byPackage(token);
if (result != null) {
......
......@@ -23,7 +23,6 @@
*/
package hudson.tasks.junit;
import hudson.model.Hudson;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
......@@ -68,5 +67,5 @@ class XMLEntityResolver implements EntityResolver {
return null;
}
private static final Logger LOGGER = Logger.getLogger(XMLEntityResolver.class.getName() );
private static final Logger LOGGER = Logger.getLogger(XMLEntityResolver.class.getName());
}
\ No newline at end of file
......@@ -24,7 +24,6 @@
package hudson.tasks.test;
import hudson.Functions;
import hudson.Util;
import hudson.model.*;
import hudson.tasks.junit.CaseResult;
import hudson.util.ChartUtil;
......
......@@ -252,6 +252,7 @@ public class AggregatedTestResultPublisher extends Recorder {
super(Run.class);
}
@Override
public void onCompleted(Run run, TaskListener listener) {
lastChanged = System.currentTimeMillis();
}
......@@ -268,6 +269,7 @@ public class AggregatedTestResultPublisher extends Recorder {
return Messages.AggregatedTestResultPublisher_DisplayName();
}
@Override
public String getHelpFile() {
return "/help/tasks/aggregate-test/help.html";
}
......@@ -285,6 +287,7 @@ public class AggregatedTestResultPublisher extends Recorder {
return FormValidation.ok();
}
@Override
public AggregatedTestResultPublisher newInstance(StaplerRequest req, JSONObject formData) throws FormException {
JSONObject s = formData.getJSONObject("specify");
if(s.isNullObject())
......
......@@ -44,6 +44,7 @@ public class TestResultAggregator extends MatrixAggregator {
super(build, launcher, listener);
}
@Override
public boolean startBuild() throws InterruptedException, IOException {
result = new MatrixTestResult(build);
build.addAction(result);
......
......@@ -31,7 +31,6 @@ import hudson.model.TaskListener;
import hudson.tasks.CommandInterpreter;
import hudson.util.FormValidation;
import java.io.IOException;
import java.util.Collections;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
......
......@@ -62,7 +62,7 @@ public class InstallSourceProperty extends ToolProperty<ToolInstallation> {
}
@Extension
public static class DescriptorImpl extends ToolPropertyDescriptor {
public static class DescriptorImpl extends ToolPropertyDescriptor {
public String getDisplayName() {
return Messages.InstallSourceProperty_DescriptorImpl_displayName();
}
......
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.tools;
import hudson.DescriptorExtensionList;
......@@ -5,8 +28,6 @@ import hudson.ExtensionPoint;
import hudson.model.Describable;
import hudson.model.Hudson;
import java.util.List;
/**
* Extensible property of {@link ToolInstallation}.
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册