Skip to content

Commit 9f7a36d

Browse files
committed
Replace Nullable with CheckForNull: CheckForNull is now supported by NullAway as well.
1 parent a3257d8 commit 9f7a36d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/main/java/io/jenkins/plugins/util/BuildAction.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import java.util.concurrent.locks.ReentrantLock;
1010

1111
import edu.hm.hafner.util.VisibleForTesting;
12-
import edu.umd.cs.findbugs.annotations.Nullable;
12+
import edu.umd.cs.findbugs.annotations.CheckForNull;
1313

1414
import hudson.model.Action;
1515
import hudson.model.Run;
@@ -32,7 +32,7 @@ public abstract class BuildAction<T> implements LastBuildAction, RunAction2, Ser
3232
private transient Run<?, ?> owner;
3333
private transient ReentrantLock lock = new ReentrantLock();
3434

35-
@Nullable
35+
@CheckForNull
3636
private transient WeakReference<T> resultReference;
3737

3838
/**
@@ -152,7 +152,7 @@ private Path getResultXmlPath() {
152152
* @return the next available {@link BuildAction}, or an empty result if there is no such action
153153
*/
154154
public static <T extends BuildAction<?>> Optional<T> getBuildActionFromHistoryStartingFrom(
155-
@Nullable final Run<?, ?> baseline, final Class<T> buildActionClass) {
155+
@CheckForNull final Run<?, ?> baseline, final Class<T> buildActionClass) {
156156
for (Run<?, ?> run = baseline; run != null; run = run.getPreviousBuild()) {
157157
T action = run.getAction(buildActionClass);
158158
if (action != null) {

src/main/java/io/jenkins/plugins/util/EnvironmentResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.apache.commons.lang3.StringUtils;
44

55
import edu.hm.hafner.util.VisibleForTesting;
6-
import edu.umd.cs.findbugs.annotations.Nullable;
6+
import edu.umd.cs.findbugs.annotations.CheckForNull;
77

88
import hudson.EnvVars;
99
import hudson.Util;
@@ -42,7 +42,7 @@ public EnvironmentResolver() {
4242
*
4343
* @return the expanded value
4444
*/
45-
public String expandEnvironmentVariables(@Nullable final EnvVars environment, final String nonExpandedValue) {
45+
public String expandEnvironmentVariables(@CheckForNull final EnvVars environment, final String nonExpandedValue) {
4646
String expanded = nonExpandedValue;
4747
if (environment != null && !environment.isEmpty()) {
4848
for (int i = 0; i < resolveVariablesDepth && StringUtils.isNotBlank(expanded); i++) {

0 commit comments

Comments
 (0)