@CheckForNull

This commit is contained in:
Jesse Glick 2014-07-21 13:08:22 -04:00
parent c7a236ca1b
commit 7076f0de7e
2 changed files with 4 additions and 4 deletions

View File

@ -2316,9 +2316,9 @@ public final class FilePath implements Serializable {
/** /**
* Shortcut for {@link #validateFileMask(String)} in case the left-hand side can be null. * Shortcut for {@link #validateFileMask(String)} in case the left-hand side can be null.
*/ */
public static FormValidation validateFileMask(FilePath pathOrNull, String value) throws IOException { public static FormValidation validateFileMask(@CheckForNull FilePath path, String value) throws IOException {
if(pathOrNull==null) return FormValidation.ok(); if(path==null) return FormValidation.ok();
return pathOrNull.validateFileMask(value); return path.validateFileMask(value);
} }
/** /**

View File

@ -544,7 +544,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
* null if there's no available workspace. * null if there's no available workspace.
* @since 1.319 * @since 1.319
*/ */
public final FilePath getSomeWorkspace() { public final @CheckForNull FilePath getSomeWorkspace() {
R b = getSomeBuildWithWorkspace(); R b = getSomeBuildWithWorkspace();
if (b!=null) return b.getWorkspace(); if (b!=null) return b.getWorkspace();
for (WorkspaceBrowser browser : Jenkins.getInstance().getExtensionList(WorkspaceBrowser.class)) { for (WorkspaceBrowser browser : Jenkins.getInstance().getExtensionList(WorkspaceBrowser.class)) {