Skip to content

Commit

Permalink
Merge pull request jenkinsci#4238 from StefanSpieker/spotbugs_number_…
Browse files Browse the repository at this point in the history
…ctor

Spotbugs: Replaced inefficient Number constructor with static valueOf
  • Loading branch information
oleg-nenashev authored Oct 1, 2019
2 parents a3ed4aa + 30ecd07 commit 5f4b878
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/tasks/BatchFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected String getFileExtension() {

@CheckForNull
public final Integer getUnstableReturn() {
return new Integer(0).equals(unstableReturn) ? null : unstableReturn;
return Integer.valueOf(0).equals(unstableReturn) ? null : unstableReturn;
}

@DataBoundSetter
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/tasks/Shell.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected String getFileExtension() {

@CheckForNull
public final Integer getUnstableReturn() {
return new Integer(0).equals(unstableReturn) ? null : unstableReturn;
return Integer.valueOf(0).equals(unstableReturn) ? null : unstableReturn;
}

@DataBoundSetter
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/widgets/HistoryWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ private Long getPagingParam(@CheckForNull StaplerRequest currentRequest, @CheckF
return null;
}
try {
return new Long(paramVal);
return Long.valueOf(paramVal);
} catch (NumberFormatException nfe) {
return null;
}
Expand Down

0 comments on commit 5f4b878

Please sign in to comment.