Skip to content

Commit

Permalink
Merge branch 'master' into update-forms
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed Dec 5, 2021
2 parents 51e1a0a + 14a763b commit 6bff25b
Show file tree
Hide file tree
Showing 58 changed files with 170 additions and 146 deletions.
2 changes: 1 addition & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ THE SOFTWARE.
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
<version>3.1.12</version>
<version>3.1.13</version>
</dependency>
<dependency>
<groupId>org.kohsuke</groupId>
Expand Down
8 changes: 7 additions & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ THE SOFTWARE.
<dependency>
<groupId>com.infradna.tool</groupId>
<artifactId>bridge-method-annotation</artifactId>
<version>1.21</version>
<version>${bridge-method-injector.version}</version>
</dependency>

<dependency><!-- until we get this version through Stapler -->
Expand Down Expand Up @@ -380,6 +380,11 @@ THE SOFTWARE.
<groupId>org.fusesource.jansi</groupId>
<artifactId>jansi</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>test-annotations</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
Expand Down Expand Up @@ -407,6 +412,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency><!-- needed by Jelly -->
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/FilePath.java
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ public abstract static class AbstractInterceptorCallableWrapper<T> implements De

private final DelegatingCallable<T, IOException> callable;

public AbstractInterceptorCallableWrapper(DelegatingCallable<T, IOException> callable) {
protected AbstractInterceptorCallableWrapper(DelegatingCallable<T, IOException> callable) {
this.callable = callable;
}

Expand Down Expand Up @@ -1674,8 +1674,8 @@ public String invoke(File dir, VirtualChannel channel) throws IOException {

/**
* Deletes this file.
* @throws IOException if it exists but could not be successfully deleted
* @return true, for a modicum of compatibility
* @throws IOException if it exists but could not be successfully deleted
*/
public boolean delete() throws IOException, InterruptedException {
act(new Delete());
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public abstract class Launcher {
@Restricted(Beta.class)
protected EnvVarsFilterRuleWrapper envVarsFilterRuleWrapper;

public Launcher(@NonNull TaskListener listener, @CheckForNull VirtualChannel channel) {
protected Launcher(@NonNull TaskListener listener, @CheckForNull VirtualChannel channel) {
this.listener = listener;
this.channel = channel;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/PluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ PluginManager doCreate(@NonNull Class<? extends PluginManager> klass,
*/
private final PluginStrategy strategy;

public PluginManager(ServletContext context, File rootDir) {
protected PluginManager(ServletContext context, File rootDir) {
this.context = context;

this.rootDir = rootDir;
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/ProxyConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ public String getPassword() {
}

/**
* @return the encrypted proxy password
*
* @deprecated
* Use {@link #getSecretPassword()}
*
* @return the encrypted proxy password
*/
@Deprecated
public String getEncryptedPassword() {
Expand Down
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/WebAppMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ public class WebAppMain implements ServletContextListener {
}
};

/**This getter returns the int DEFAULT_RING_BUFFER_SIZE from the class RingBufferLogHandler from a static context.
/**
* This getter returns the int DEFAULT_RING_BUFFER_SIZE from the class RingBufferLogHandler from a static context.
* Exposes access from RingBufferLogHandler.DEFAULT_RING_BUFFER_SIZE to WebAppMain.
* Written for the requirements of JENKINS-50669
* @return int This returns DEFAULT_RING_BUFFER_SIZE
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/XmlFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ public String toString() {
* Opens a {@link Reader} that loads XML.
* This method uses {@link #sniffEncoding() the right encoding},
* not just the system default encoding.
* @throws IOException Encoding issues
* @return Reader for the file. should be close externally once read.
* @throws IOException Encoding issues
*/
public Reader readRaw() throws IOException {
try {
Expand Down Expand Up @@ -304,10 +304,10 @@ public void writeRawTo(Writer w) throws IOException {
/**
* Parses the beginning of the file and determines the encoding.
*
* @throws IOException
* if failed to detect encoding.
* @return
* always non-null.
* @throws IOException
* if failed to detect encoding.
*/
public String sniffEncoding() throws IOException {
class Eureka extends SAXException {
Expand Down
18 changes: 18 additions & 0 deletions core/src/main/java/hudson/cli/declarative/MethodBinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Objects;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
Expand Down Expand Up @@ -171,5 +172,22 @@ public Class<? extends Annotation> annotationType() {
public boolean hidden() {
return base.hidden();
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof ArgumentImpl)) {
return false;
}
ArgumentImpl argument = (ArgumentImpl) o;
return Objects.equals(base, argument.base) && bias == argument.bias;
}

@Override
public int hashCode() {
return Objects.hash(base, bias);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
* @since 1.349
*/
public abstract class ConsoleAnnotationDescriptor extends Descriptor<ConsoleNote<?>> implements ExtensionPoint {
public ConsoleAnnotationDescriptor(Class<? extends ConsoleNote<?>> clazz) {
protected ConsoleAnnotationDescriptor(Class<? extends ConsoleNote<?>> clazz) {
super(clazz);
}

public ConsoleAnnotationDescriptor() {
protected ConsoleAnnotationDescriptor() {
}

/**
Expand Down
16 changes: 8 additions & 8 deletions core/src/main/java/hudson/logging/LogRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
import hudson.RestrictedSince;
import hudson.Util;
import hudson.XmlFile;
import hudson.util.CopyOnWriteList;
import hudson.util.HttpResponses;
import java.util.Objects;
import jenkins.util.MemoryReductionUtil;
import jenkins.model.Jenkins;
import hudson.model.AbstractModelObject;
import hudson.model.AutoCompletionCandidates;
import hudson.model.Computer;
Expand All @@ -45,6 +40,8 @@
import hudson.remoting.Channel;
import hudson.remoting.VirtualChannel;
import hudson.slaves.ComputerListener;
import hudson.util.CopyOnWriteList;
import hudson.util.HttpResponses;
import hudson.util.RingBufferLogHandler;
import hudson.util.XStream2;
import java.io.File;
Expand All @@ -61,6 +58,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeMap;
Expand All @@ -70,7 +68,9 @@
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import jenkins.model.Jenkins;
import jenkins.security.MasterToSlaveCallable;
import jenkins.util.MemoryReductionUtil;
import net.sf.json.JSONObject;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
Expand Down Expand Up @@ -98,14 +98,14 @@
public class LogRecorder extends AbstractModelObject implements Saveable {
private volatile String name;

@Deprecated
@Restricted(NoExternalUse.class)
@RestrictedSince("TODO")
/**
* No longer used.
*
* @deprecated use {@link #getLoggers()}
*/
@Deprecated
@Restricted(NoExternalUse.class)
@RestrictedSince("TODO")
public final transient CopyOnWriteList<Target> targets = new CopyOnWriteList<>();
private List<Target> loggers = new ArrayList<>();
private static final TargetComparator TARGET_COMPARATOR = new TargetComparator();
Expand Down
13 changes: 7 additions & 6 deletions core/src/main/java/hudson/model/Computer.java
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public List<TerminationRequest> getTerminatedBy() {
return new ArrayList<>(terminatedBy);
}

public Computer(Node node) {
protected Computer(Node node) {
setNode(node);
}

Expand Down Expand Up @@ -462,10 +462,11 @@ public final Future<?> connect(boolean forceReconnect) {
protected abstract Future<?> _connect(boolean forceReconnect);

/**
* @deprecated Implementation of CLI command "connect-node" moved to {@link hudson.cli.ConnectNodeCommand}.
*
* @param force
* If true cancel any currently pending connect operation and retry from scratch
*
* @deprecated Implementation of CLI command "connect-node" moved to {@link hudson.cli.ConnectNodeCommand}.
*/
@Deprecated
public void cliConnect(boolean force) throws ExecutionException, InterruptedException {
Expand Down Expand Up @@ -524,10 +525,10 @@ public Future<?> disconnect() {
}

/**
* @deprecated Implementation of CLI command "disconnect-node" moved to {@link hudson.cli.DisconnectNodeCommand}.
*
* @param cause
* Record the note about why you are disconnecting this node
*
* @deprecated Implementation of CLI command "disconnect-node" moved to {@link hudson.cli.DisconnectNodeCommand}.
*/
@Deprecated
public void cliDisconnect(String cause) throws ExecutionException, InterruptedException {
Expand All @@ -536,10 +537,10 @@ public void cliDisconnect(String cause) throws ExecutionException, InterruptedEx
}

/**
* @deprecated Implementation of CLI command "offline-node" moved to {@link hudson.cli.OfflineNodeCommand}.
*
* @param cause
* Record the note about why you are disconnecting this node
*
* @deprecated Implementation of CLI command "offline-node" moved to {@link hudson.cli.OfflineNodeCommand}.
*/
@Deprecated
public void cliOffline(String cause) throws ExecutionException, InterruptedException {
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/hudson/model/DirectoryBrowserSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import hudson.FilePath;
import hudson.Util;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -54,7 +53,6 @@
import java.util.stream.Stream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;

import jenkins.model.Jenkins;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ResourceDomainConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,11 @@ default void buildEnvironment(@NonNull Run<?, ?> run, @NonNull EnvVars env) {
/**
* Called by {@link AbstractBuild} to allow plugins to contribute environment variables.
*
* @deprecated Use {@link #buildEnvironment} instead
*
* @param build
* The calling build. Never null.
* @param env
* Environment variables should be added to this map.
* @deprecated Use {@link #buildEnvironment} instead
*/
@Deprecated
@Restricted(ProtectedExternally.class)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/FullDuplexHttpChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public abstract class FullDuplexHttpChannel extends FullDuplexHttpService {
private Channel channel;
private final boolean restricted;

public FullDuplexHttpChannel(UUID uuid, boolean restricted) throws IOException {
protected FullDuplexHttpChannel(UUID uuid, boolean restricted) throws IOException {
super(uuid);
this.restricted = restricted;
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/ItemGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ default Stream<T> getItemsStream(Predicate<T> pred) {

/**
* Gets the {@link Item} inside this group that has a given name, or null if it does not exist.
* @throws AccessDeniedException if the current user has {@link Item#DISCOVER} but not {@link Item#READ} on this item
* @return an item whose {@link Item#getName} is {@code name} and whose {@link Item#getParent} is {@code this}, or null if there is no such item, or there is but the current user lacks both {@link Item#DISCOVER} and {@link Item#READ} on it
* @throws AccessDeniedException if the current user has {@link Item#DISCOVER} but not {@link Item#READ} on this item
*/
@CheckForNull T getItem(String name) throws AccessDeniedException;

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Label.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
@NonNull
public final transient NodeProvisioner nodeProvisioner;

public Label(@NonNull String name) {
protected Label(@NonNull String name) {
this.name = name;
// passing these causes an infinite loop - getTotalExecutors(),getBusyExecutors());
this.loadStatistics = new LoadStatistics(0,0) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/model/ParameterDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public abstract class ParameterDefinition implements

private String description;

public ParameterDefinition(@NonNull String name) {
protected ParameterDefinition(@NonNull String name) {
if (name == null) {
throw new IllegalArgumentException("Parameter name must be non-null");
}
Expand All @@ -113,7 +113,7 @@ public ParameterDefinition(@NonNull String name) {
* @deprecated Prefer {@link #ParameterDefinition(String)} with a {@link org.kohsuke.stapler.DataBoundConstructor} and allow {@link #setDescription} to be used as needed
*/
@Deprecated
public ParameterDefinition(@NonNull String name, String description) {
protected ParameterDefinition(@NonNull String name, String description) {
this(name);
setDescription(description);
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public abstract class Project<P extends Project<P,B>,B extends Build<P,B>>
/**
* Creates a new project.
*/
public Project(ItemGroup parent,String name) {
protected Project(ItemGroup parent,String name) {
super(parent,name);
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,7 @@ public class Artifact {
private String treeNodeId;

/**
*length of this artifact for files.
* length of this artifact for files.
*/
private String length;

Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/hudson/model/Slave.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public abstract class Slave extends Node implements Serializable {
* @deprecated since 2.184
*/
@Deprecated
public Slave(String name, String nodeDescription, String remoteFS, String numExecutors,
protected Slave(String name, String nodeDescription, String remoteFS, String numExecutors,
Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
this(name,nodeDescription,remoteFS,Util.tryParseNumber(numExecutors, 1).intValue(),mode,labelString,launcher,retentionStrategy, nodeProperties);
}
Expand All @@ -173,12 +173,12 @@ public Slave(String name, String nodeDescription, String remoteFS, String numExe
* @deprecated since 2009-02-20.
*/
@Deprecated
public Slave(String name, String nodeDescription, String remoteFS, int numExecutors,
protected Slave(String name, String nodeDescription, String remoteFS, int numExecutors,
Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy) throws FormException, IOException {
this(name, nodeDescription, remoteFS, numExecutors, mode, labelString, launcher, retentionStrategy, new ArrayList());
}

public Slave(@NonNull String name, String remoteFS, ComputerLauncher launcher) throws FormException, IOException {
protected Slave(@NonNull String name, String remoteFS, ComputerLauncher launcher) throws FormException, IOException {
this.name = name;
this.remoteFS = remoteFS;
this.launcher = launcher;
Expand All @@ -189,7 +189,7 @@ public Slave(@NonNull String name, String remoteFS, ComputerLauncher launcher) t
* Use {@link #Slave(String, String, ComputerLauncher)} and set the rest through setters.
*/
@Deprecated
public Slave(@NonNull String name, String nodeDescription, String remoteFS, int numExecutors,
protected Slave(@NonNull String name, String nodeDescription, String remoteFS, int numExecutors,
Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties) throws FormException, IOException {
this.name = name;
this.description = nodeDescription;
Expand Down
Loading

0 comments on commit 6bff25b

Please sign in to comment.