Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions core/src/main/java/hudson/FilePath.java
Original file line number Diff line number Diff line change
Expand Up @@ -1985,8 +1985,6 @@ private static void _chmod(File f, int mask) throws IOException {
Files.setPosixFilePermissions(fileToPath(f), Util.modeToPermissions(mask));
}

private static boolean CHMOD_WARNED = false;

/**
* Gets the file permission bit mask.
*
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/hudson/LocalPluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import java.io.File;
import java.util.Collection;
import java.util.Collections;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import jenkins.util.SystemProperties;

Expand Down Expand Up @@ -87,6 +86,4 @@ protected Collection<String> loadBundledPlugins() {
loadDetachedPlugins();
}
}

private static final Logger LOGGER = Logger.getLogger(LocalPluginManager.class.getName());
}
3 changes: 0 additions & 3 deletions core/src/main/java/hudson/cli/CancelQuietDownCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package hudson.cli;

import hudson.Extension;
import java.util.logging.Logger;
import jenkins.model.Jenkins;

/**
Expand All @@ -37,8 +36,6 @@
@Extension
public class CancelQuietDownCommand extends CLICommand {

private static final Logger LOGGER = Logger.getLogger(CancelQuietDownCommand.class.getName());

@Override
public String getShortDescription() {
return Messages.CancelQuietDownCommand_ShortDescription();
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/hudson/cli/ClearQueueCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package hudson.cli;

import hudson.Extension;
import java.util.logging.Logger;
import jenkins.model.Jenkins;

/**
Expand All @@ -37,8 +36,6 @@
@Extension
public class ClearQueueCommand extends CLICommand {

private static final Logger LOGGER = Logger.getLogger(ClearQueueCommand.class.getName());

@Override
public String getShortDescription() {
return Messages.ClearQueueCommand_ShortDescription();
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/hudson/cli/ConnectNodeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import hudson.model.Computer;
import java.util.HashSet;
import java.util.List;
import java.util.logging.Logger;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;

Expand All @@ -48,8 +47,6 @@ public class ConnectNodeCommand extends CLICommand {
@Option(name = "-f", usage = "Cancel any currently pending connect operation and retry from scratch")
public boolean force = false;

private static final Logger LOGGER = Logger.getLogger(ConnectNodeCommand.class.getName());

@Override
public String getShortDescription() {
return Messages.ConnectNodeCommand_ShortDescription();
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/hudson/cli/DisconnectNodeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import hudson.util.EditDistance;
import java.util.HashSet;
import java.util.List;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;
Expand All @@ -49,8 +48,6 @@ public class DisconnectNodeCommand extends CLICommand {
@Option(name = "-m", usage = "Record the reason about why you are disconnecting this node")
public String cause;

private static final Logger LOGGER = Logger.getLogger(DisconnectNodeCommand.class.getName());

@Override
public String getShortDescription() {
return Messages.DisconnectNodeCommand_ShortDescription();
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/hudson/cli/QuietDownCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package hudson.cli;

import hudson.Extension;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import org.kohsuke.args4j.Option;

Expand All @@ -38,8 +37,6 @@
@Extension
public class QuietDownCommand extends CLICommand {

private static final Logger LOGGER = Logger.getLogger(QuietDownCommand.class.getName());

@Option(name = "-block", usage = "Block until the system really quiets down and no builds are running")
public boolean block = false;

Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/hudson/console/ModelHyperlinkNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import hudson.model.Node;
import hudson.model.Run;
import hudson.model.User;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import org.jenkinsci.Symbol;

Expand Down Expand Up @@ -82,6 +81,4 @@ public String getDisplayName() {
}

private static final long serialVersionUID = 1L;

private static final Logger LOGGER = Logger.getLogger(ModelHyperlinkNote.class.getName());
}
1 change: 0 additions & 1 deletion core/src/main/java/hudson/model/DownloadService.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public static class Downloadable implements ExtensionPoint {
private final String url;
private final long interval;
private volatile long due = 0;
private volatile long lastAttempt = Long.MIN_VALUE;

/**
* Creates a new downloadable.
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/hudson/model/RunParameterDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import hudson.util.EnumConverter;
import hudson.util.RunList;
import java.util.Objects;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
import org.jenkinsci.Symbol;
Expand Down Expand Up @@ -243,6 +242,4 @@ public boolean equals(Object obj) {
return false;
return Objects.equals(filter, other.filter);
}

private static final Logger LOGGER = Logger.getLogger(RunParameterDefinition.class.getName());
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ private void error(Computer c, Throwable x) {
* returns computers that were not monitored as they were either offline or monitor produced {@code null} {@link Callable}.
*/
protected static final class Result<T> {
private static final long serialVersionUID = -7671448355804481216L;

private final @NonNull Map<Computer, T> data;
private final @NonNull ArrayList<Computer> skipped;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import hudson.model.Computer;
import hudson.node_monitors.DiskSpaceMonitorDescriptor.DiskSpace;
import java.text.ParseException;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.kohsuke.stapler.DataBoundSetter;
Expand Down Expand Up @@ -94,7 +93,5 @@
((DiskSpaceMonitorDescriptor) getDescriptor()).markNodeOfflineOrOnline(c, size, this);
return size;
}

private static final Logger LOGGER = Logger.getLogger(AbstractDiskSpaceMonitor.class.getName());
private static final long DEFAULT_THRESHOLD = 1024L * 1024 * 1024;

Check warning on line 96 in core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java

View check run for this annotation

ci.jenkins.io / Java Compiler

checkstyle:check

ERROR: 'VARIABLE_DEF' should be separated from previous line. [EmptyLineSeparator]

Check warning on line 96 in core/src/main/java/hudson/node_monitors/AbstractDiskSpaceMonitor.java

View check run for this annotation

ci.jenkins.io / CheckStyle

EmptyLineSeparatorCheck

ERROR: 'VARIABLE_DEF' should be separated from previous line.
Raw output
<p>Since Checkstyle 5.8</p><p> Checks for empty line separators after header, package, all import declarations, fields, constructors, methods, nested classes, static initializers and instance initializers. </p><p> ATTENTION: empty line separator is required between AST siblings, not after line where token is found. </p>
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import io.jenkins.servlet.http.HttpServletResponseWrapper;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletResponse;
import jenkins.util.SystemProperties;
import org.acegisecurity.AccessDeniedException;
import org.acegisecurity.Authentication;

Expand All @@ -15,9 +14,6 @@
@Deprecated
public class AccessDeniedException2 extends AccessDeniedException {

/** If true, report {@code X-You-Are-In-Group} headers. Disabled due to JENKINS-39402; use {@code /whoAmI} etc. to diagnose permission issues. */
private static /* not final */ boolean REPORT_GROUP_HEADERS = SystemProperties.getBoolean(AccessDeniedException2.class.getName() + ".REPORT_GROUP_HEADERS");

/**
* This object represents the user being authenticated.
*/
Expand Down
4 changes: 0 additions & 4 deletions core/src/main/java/hudson/util/ChunkedInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.logging.Logger;

/**
* <p>Transparently coalesces chunks of a HTTP stream that uses
Expand Down Expand Up @@ -76,9 +75,6 @@ public class ChunkedInputStream extends InputStream {
/** True if this stream is closed */
private boolean closed = false;

/** Log object for this class. */
private static final Logger LOGGER = Logger.getLogger(ChunkedInputStream.class.getName());

/**
* ChunkedInputStream constructor
*
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/hudson/util/ProcessTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,6 @@ protected OSProcess createProcess(final int pid) throws IOException {
}

private class SolarisProcess extends UnixProcess {
private static final byte PR_MODEL_ILP32 = 1;
private static final byte PR_MODEL_LP64 = 2;

/*
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/jenkins/cli/SafeRestartCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import hudson.Extension;
import hudson.cli.CLICommand;
import hudson.cli.Messages;
import java.util.logging.Logger;
import jenkins.model.Jenkins;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
Expand All @@ -42,7 +41,6 @@
@Extension
@Restricted(NoExternalUse.class)
public class SafeRestartCommand extends CLICommand {
private static final Logger LOGGER = Logger.getLogger(SafeRestartCommand.class.getName());

@Option(name = "-message", usage = "Message for safe restart that will be visible to users")
public String message = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ public class JenkinsLocationConfiguration extends GlobalConfiguration implements
private String adminAddress;
private String jenkinsUrl;

// just to suppress warnings
private transient String charset, useSsl;

Comment on lines -61 to -63
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introduced in 526c788 to not have warnings during deserialization.

Probably reasonable to remove at this point, but only because of age.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considered obsolete right from the beginning. Perfect example what this project needs. @NotMyFault

Therefore treaded as Technical depth.

use or loose.

You can use silly PMD to fix it all manually or just apply rewrite to get auto fixes. PMD could still benefit as no tool is perfect.

Copy link
Member

@daniel-beck daniel-beck Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

considered obsolete right from the beginning. Perfect example what this project needs.

The behavior of the software changes depending on whether this field is defined or not. If the fields did not exist, administrators are shown warnings from deserialization (in this case of backward-compatibility supporting code), usually indicative of a configuration issue close to data loss. These fields existing prevents that.

So if you think this project needs less backwards compatibility and more administrator confusion, you're exactly right.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These fields existing prevents that.

Did not know that, right. Thanks for explaining to me. Then need simple ignore for this case, as its important.

public static @NonNull JenkinsLocationConfiguration get() {
return GlobalConfiguration.all().getInstance(JenkinsLocationConfiguration.class);
}
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/jenkins/model/NodeListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import hudson.ExtensionPoint;
import hudson.model.Node;
import java.util.List;
import java.util.logging.Logger;
import jenkins.util.Listeners;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.Beta;
Expand All @@ -42,8 +41,6 @@
*/
public abstract class NodeListener implements ExtensionPoint {

private static final Logger LOGGER = Logger.getLogger(NodeListener.class.getName());

/**
* Allows to veto node loading.
* @param node the node being loaded. Not yet attached to Jenkins.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,13 @@
import hudson.ExtensionPoint;
import hudson.model.User;
import java.util.List;
import java.util.logging.Logger;
import jenkins.security.SecurityListener;
import jenkins.util.Listeners;

/**
* Listener notified when a user was requested to changed their seed
* @since 2.160 and 2.150.2, but restricted (unavailable to plugins) before 2.406
*/
public abstract class UserSeedChangeListener implements ExtensionPoint {
private static final Logger LOGGER = Logger.getLogger(SecurityListener.class.getName());

/**
* Called after a seed was changed but before the user is saved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import java.io.Serializable;
import java.util.logging.Logger;

/**
* Extension point to control how to restart an inbound agent when it loses the connection with the master.
Expand Down Expand Up @@ -41,7 +40,5 @@ public static ExtensionList<SlaveRestarter> all() {
return ExtensionList.lookup(SlaveRestarter.class);
}

private static final Logger LOGGER = Logger.getLogger(SlaveRestarter.class.getName());

private static final long serialVersionUID = 1L;
}
2 changes: 0 additions & 2 deletions core/src/main/java/jenkins/telemetry/impl/UserLanguages.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.util.TreeMap;
import java.util.concurrent.ConcurrentSkipListMap;
import java.util.concurrent.atomic.AtomicLong;
import java.util.logging.Logger;
import jenkins.telemetry.Telemetry;
import jenkins.util.HttpServletFilter;
import net.sf.json.JSONObject;
Expand All @@ -47,7 +46,6 @@
public class UserLanguages extends Telemetry {

private static final Map<String, AtomicLong> requestsByLanguage = new ConcurrentSkipListMap<>();
private static Logger LOGGER = Logger.getLogger(UserLanguages.class.getName());

@NonNull
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class MarkFindingOutputStreamTest {

private String mark = MarkFindingOutputStream.MARK;
private String markHead = mark.substring(0, 5);
private String markTail = mark.substring(5);

private ByteArrayOutputStream baos = new ByteArrayOutputStream();
private MarkCountingOutputStream m = new MarkCountingOutputStream(baos);
Expand Down
1 change: 0 additions & 1 deletion core/src/test/java/jenkins/util/VirtualFileTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,6 @@ private File createInvalidFileSymlink() throws IOException, InterruptedException
}

private long computeEarlierSystemTime() {
long earlierSystemTime = 0L;
if (Functions.isWindows()) {
return 0L;
}
Expand Down
1 change: 0 additions & 1 deletion test/src/test/java/hudson/PluginManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ void uploadDependencyResolution() throws Throwable {

// wait for all the download jobs to complete
boolean done = true;
boolean passed = true;
do {
Thread.sleep(100);
done = true;
Expand Down
2 changes: 0 additions & 2 deletions test/src/test/java/hudson/cli/QuietDownCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,6 @@ void quietDownShouldSuccessWithBlockAndFinishingExecutor() throws Exception {
final OneShotEvent finish = new OneShotEvent();
final FreeStyleBuild build = OnlineNodeCommandTest.startBlockingAndFinishingBuild(project, finish);
assertThat(((FreeStyleProject) j.jenkins.getItem("aProject")).getBuilds(), hasSize(1));

boolean timeoutOccurred = false;
final FutureTask exec_task = new FutureTask(() -> {
assertJenkinsNotInQuietMode();
final long time_before = System.currentTimeMillis();
Expand Down
4 changes: 0 additions & 4 deletions test/src/test/java/hudson/model/QueueTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.logging.Level;
import java.util.logging.Logger;
import jenkins.model.BlockedBecauseOfBuildInProgress;
import jenkins.model.Jenkins;
Expand All @@ -125,7 +124,6 @@
import org.junit.jupiter.api.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.LogRecorder;
import org.jvnet.hudson.test.MockAuthorizationStrategy;
import org.jvnet.hudson.test.MockQueueItemAuthenticator;
import org.jvnet.hudson.test.SequenceLock;
Expand All @@ -143,8 +141,6 @@
@WithJenkins
public class QueueTest {

private final LogRecorder logging = new LogRecorder().record(Queue.class, Level.FINE);

private JenkinsRule r;

@BeforeEach
Expand Down
5 changes: 0 additions & 5 deletions test/src/test/java/hudson/model/SimpleJobTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.logging.Level;
import jenkins.model.lazy.LazyBuildMixIn;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.LogRecorder;
import org.jvnet.hudson.test.junit.jupiter.WithJenkins;

/**
Expand All @@ -16,8 +13,6 @@
@WithJenkins
class SimpleJobTest {

private final LogRecorder logging = new LogRecorder().record(LazyBuildMixIn.class, Level.FINE);

private static JenkinsRule r;

@BeforeAll
Expand Down
Loading
Loading