From 2d89b832eee360103e8f2fad76dd9bd991156dee Mon Sep 17 00:00:00 2001 From: Kanstantsin Shautsou Date: Wed, 19 Nov 2014 01:00:36 +0300 Subject: [PATCH] Null annotations for PollingResult.class --- core/src/main/java/hudson/scm/PollingResult.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/scm/PollingResult.java b/core/src/main/java/hudson/scm/PollingResult.java index f6e7ae7a59..a5ec21fb40 100644 --- a/core/src/main/java/hudson/scm/PollingResult.java +++ b/core/src/main/java/hudson/scm/PollingResult.java @@ -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); }