Null annotations for PollingResult.class

This commit is contained in:
Kanstantsin Shautsou committed 2014-11-27 04:05:52 +03:00
1 parent 9aaeb0a3f2
commit 2d89b832ee
1 file changed
+8 -5
@@ -5,6 +5,9 @@ import hudson.model.TaskListener;
import hudson.Launcher;
import hudson.FilePath;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.Serializable;
/**
@@ -23,13 +26,13 @@ public final class PollingResult implements Serializable {
* (This comes from either the workspace, or from the remote repository as of the last polling.
* Can be null.
*/
public final SCMRevisionState baseline;
public final @CheckForNull SCMRevisionState baseline;
/**
* Current state of the remote repository. To be passed to the next invocation of the polling method.
* Can be null.
*/
public final SCMRevisionState remote;
public final @CheckForNull SCMRevisionState remote;
/**
* Degree of the change between baseline and remote. Never null.
@@ -39,7 +42,7 @@ public final class PollingResult implements Serializable {
* the immediate rebuild, and (2) allow SCM to ignore some changes in the repository to implement
* exclusion feature.
*/
public final Change change;
public final @Nonnull Change change;
/**
* Degree of changes between the previous state and this state.
@@ -77,14 +80,14 @@ public final class PollingResult implements Serializable {
INCOMPARABLE
}
public PollingResult(SCMRevisionState baseline, SCMRevisionState remote, Change change) {
public PollingResult(@CheckForNull SCMRevisionState baseline, @CheckForNull SCMRevisionState remote, @Nonnull Change change) {
if (change==null) throw new IllegalArgumentException();
this.baseline = baseline;
this.remote = remote;
this.change = change;
}
public PollingResult(Change change) {
public PollingResult(@Nonnull Change change) {
this(null,null,change);
}