Skip to content

Commit

Permalink
fix: serialVersionUID fix for most of the cases found without changin…
Browse files Browse the repository at this point in the history
…g the any of the previous serialVersionUID inconsistency
  • Loading branch information
rng70-or committed Oct 20, 2023
1 parent 1e663d7 commit 96b99f7
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 22 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/cli/SetBuildDescriptionCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "The Serializable should be removed.")
@Extension
public class SetBuildDescriptionCommand extends CLICommand implements Serializable {
private static final long serialVersionUID = -7269184394646019447L;
private static final long serialVersionUID = 1L;

@Override
public String getShortDescription() {
return Messages.SetBuildDescriptionCommand_ShortDescription();
}
}

@Argument(metaVar = "JOB", usage = "Name of the job to build", required = true, index = 0)
public transient Job<?, ?> job;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/HealthReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ public static HealthReport max(HealthReport a, HealthReport b) {
* Fix deserialization of older data.
*/
public static class ConverterImpl extends XStream2.PassthruConverter<HealthReport> {
private static final long serialVersionUID = -1L;
private static final long serialVersionUID = 1L;
public ConverterImpl(XStream2 xstream) { super(xstream); }

Check warning on line 359 in core/src/main/java/hudson/model/HealthReport.java

View check run for this annotation

ci.jenkins.io / Java Compiler

jar:jar

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

Check warning on line 359 in core/src/main/java/hudson/model/HealthReport.java

View check run for this annotation

ci.jenkins.io / Java Compiler

surefire:test

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

Check warning on line 359 in core/src/main/java/hudson/model/HealthReport.java

View check run for this annotation

ci.jenkins.io / Java Compiler

antlr4:antlr4

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

Check warning on line 359 in core/src/main/java/hudson/model/HealthReport.java

View check run for this annotation

ci.jenkins.io / CheckStyle

EmptyLineSeparatorCheck

ERROR: 'CTOR_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>

@Override protected void callback(HealthReport hr, UnmarshallingContext context) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/ParameterDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
@ExportedBean(defaultVisibility = 3)
public abstract class ParameterDefinition implements
Describable<ParameterDefinition>, ExtensionPoint, Serializable {

private static final long serialVersionUID = 1L;
private final String name;

private String description;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/ParameterValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
@ExportedBean(defaultVisibility = 3)
@StaplerAccessibleType
public abstract class ParameterValue implements Serializable {
private static final long serialVersionUID = -7269184774646019967L;
private static final long serialVersionUID = 1L;

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

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Slave.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
* @author Kohsuke Kawaguchi
*/
public abstract class Slave extends Node implements Serializable {
private static final long serialVersionUID = -7267774394646019967L;
private static final long serialVersionUID = 1L;
private static final Logger LOGGER = Logger.getLogger(Slave.class.getName());

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public abstract class AuthorizationStrategy extends AbstractDescribableImpl<Auth
public static final AuthorizationStrategy UNSECURED = new Unsecured();

public static final class Unsecured extends AuthorizationStrategy implements Serializable {
private static final long serialVersionUID = -7269184394646019967L;
private static final long serialVersionUID = 1L;
/**
* Maintains the singleton semantics.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public abstract class FederatedLoginService implements ExtensionPoint {
* Identity information as obtained from {@link FederatedLoginService}.
*/
public abstract class FederatedIdentity implements Serializable {
private static final long serialVersionUID = -7269184394646019567L;
private static final long serialVersionUID = 1L;
/**
* Gets the string representation of the identity in the form that makes sense to the enclosing
* {@link FederatedLoginService}, such as full OpenID URL.
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/tools/ToolInstallation.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
*/
public abstract class ToolInstallation extends AbstractDescribableImpl<ToolInstallation>
implements Serializable, ExtensionPoint {
private static final long serialVersionUID = -7261984394646019967L;
private static final long serialVersionUID = 1L;

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

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/util/ClasspathBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @since 1.300
*/
public class ClasspathBuilder implements Serializable {
private static final long serialVersionUID = -7269184387646019967L;
private static final long serialVersionUID = 1L;

private final List<String> args = new ArrayList<>();

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/util/DirScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public void scan(File dir, FileVisitor visitor) throws IOException {
}

private static class DescendantFileSelector implements FileSelector {
private static final long serialVersionUID = 5L;
private static final long serialVersionUID = 1L;
private final Set<String> alreadyDeselected;
private final FilePath baseDirFP;
private final int baseDirPathLength;
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/util/Secret.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public Object unmarshal(HierarchicalStreamReader reader, final UnmarshallingCont
return fromString(reader.getValue());
}

private static final long serialVersionUID = 7269184394646019967L;
private static final long serialVersionUID = 1L;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
@ExportedBean
@Restricted(NoExternalUse.class)
public class Categories implements HttpResponse, Serializable {
private static final long serialVersionUID = 1L;

private List<Category> items;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
@ExportedBean
@Restricted(NoExternalUse.class)
public class Category implements Serializable {
private static final long serialVersionUID = 9269184394646019967L;
private static final long serialVersionUID = 1L;

private String id;

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/tasks/SimpleBuildWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void setDisposer(@NonNull Disposer disposer) {
*/
public abstract static class Disposer implements Serializable {

private static final long serialVersionUID = -7263485554646019967L;
private static final long serialVersionUID = 1L;
@CheckForNull
private Boolean wrapperRequiresWorkspace;

Expand Down
10 changes: 5 additions & 5 deletions core/src/main/java/jenkins/util/TreeString.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ public final class TreeString implements Serializable {
/**
* Creates a new root {@link TreeString}
*/
/* package */ TreeString() {
/* package */TreeString() {
this(null, "");
}

/* package */ TreeString(final TreeString parent, final String label) {
/* package */TreeString(final TreeString parent, final String label) {
assert parent == null || label.length() > 0; // if there's a parent,
// label can't be empty.

Expand Down Expand Up @@ -158,7 +158,8 @@ public String toString() {
char[] v = table.get(l);
if (v != null) {
label = v;
} else {
}
else {
table.put(l, label);
}
}
Expand Down Expand Up @@ -190,8 +191,7 @@ public static TreeString of(final String s) {
* scoped to one unmarshalling.
*/
public static final class ConverterImpl implements Converter {
public ConverterImpl(final XStream xs) {
}
public ConverterImpl(final XStream xs) {}

@Override
public void marshal(final Object source, final HierarchicalStreamWriter writer,
Expand Down
7 changes: 6 additions & 1 deletion core/src/main/java/jenkins/util/VirtualFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
* @since 1.532
*/
public abstract class VirtualFile implements Comparable<VirtualFile>, Serializable {
private static final long serialVersionUID = 1L;

/**
* Gets the base name, meaning just the last portion of the path name without any
Expand Down Expand Up @@ -568,6 +569,7 @@ public static VirtualFile forFile(final File f) {
}

private static final class FileVF extends VirtualFile {
private static final long serialVersionUID = 2L;
private final File f;
private final File root;
private boolean cacheDescendant = false;
Expand Down Expand Up @@ -864,6 +866,7 @@ public static VirtualFile forFilePath(final FilePath f) {
}

private static final class FilePathVF extends VirtualFile {
private static final long serialVersionUID = 3L;
private final FilePath f;
private final FilePath root;
private boolean cacheDescendant = false;
Expand Down Expand Up @@ -1152,6 +1155,7 @@ private String computeRelativePathToRoot() {
}

private static final class Scanner extends MasterToSlaveFileCallable<List<String>> {
private static final long serialVersionUID = 1L;
private final String includes, excludes;
private final boolean useDefaultExcludes;
private final String verificationRoot;
Expand Down Expand Up @@ -1191,6 +1195,7 @@ private static final class Readable extends MasterToSlaveFileCallable<Boolean> {
@Override public Boolean invoke(File f, VirtualChannel channel) throws IOException, InterruptedException {
return f.canRead();
}
}

private static final long serialVersionUID = 1L;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
@Deprecated
public class AnonymousAuthenticationToken implements Authentication, Serializable {
private static final long serialVersionUID = -7269184394646019967L;
private static final long serialVersionUID = 1L;

// TODO perhaps better to extend AbstractAuthenticationToken
private final org.springframework.security.authentication.AnonymousAuthenticationToken delegate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
@Deprecated
public class WebAuthenticationDetails implements Serializable {
private static final long serialVersionUID = -7369184394646019967L;
private static final long serialVersionUID = 1L;
public WebAuthenticationDetails(HttpServletRequest request) {}

Check warning on line 36 in core/src/main/java/org/acegisecurity/ui/WebAuthenticationDetails.java

View check run for this annotation

ci.jenkins.io / Java Compiler

jar:jar

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

Check warning on line 36 in core/src/main/java/org/acegisecurity/ui/WebAuthenticationDetails.java

View check run for this annotation

ci.jenkins.io / Java Compiler

surefire:test

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

Check warning on line 36 in core/src/main/java/org/acegisecurity/ui/WebAuthenticationDetails.java

View check run for this annotation

ci.jenkins.io / Java Compiler

antlr4:antlr4

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

Check warning on line 36 in core/src/main/java/org/acegisecurity/ui/WebAuthenticationDetails.java

View check run for this annotation

ci.jenkins.io / CheckStyle

EmptyLineSeparatorCheck

ERROR: 'CTOR_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>

}

0 comments on commit 96b99f7

Please sign in to comment.