Skip to content
Permalink
Browse files

[JENKINS-38048] Relax nullability on Item/ItemGroup context parameters.

The underlying checks already handle null values.
Makes it easier to provide credentials dropdowns in global configuration.
  • Loading branch information
jglick committed Sep 8, 2016
1 parent e0d05e2 commit 65e143c42ee9ba7de274482dbf4751e37de8d93d
@@ -29,6 +29,7 @@
import com.cloudbees.plugins.credentials.domains.DomainRequirement;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
import hudson.model.Descriptor;
import hudson.model.Item;
import hudson.model.ItemGroup;
@@ -292,7 +293,7 @@
* @see CredentialsProvider#listCredentials(Class, Item, Authentication, List, CredentialsMatcher)
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> include(@NonNull Item context, @NonNull Class<? extends C> type) {
public AbstractIdCredentialsListBoxModel<T, C> include(@Nullable Item context, @NonNull Class<? extends C> type) {
return include(context, type, Collections.<DomainRequirement>emptyList());
}

@@ -306,7 +307,7 @@
* @see CredentialsProvider#listCredentials(Class, ItemGroup, Authentication, List, CredentialsMatcher)
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> include(@NonNull ItemGroup context,
public AbstractIdCredentialsListBoxModel<T, C> include(@Nullable ItemGroup context,
@NonNull Class<? extends C> type) {
return include(context, type, Collections.<DomainRequirement>emptyList());
}
@@ -323,7 +324,7 @@
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> includeAs(@NonNull Authentication authentication,
@NonNull Item context,
@Nullable Item context,
@NonNull Class<? extends C> type) {
return includeAs(authentication, context, type, Collections.<DomainRequirement>emptyList());
}
@@ -340,7 +341,7 @@
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> includeAs(@NonNull Authentication authentication,
@NonNull ItemGroup context,
@Nullable ItemGroup context,
@NonNull Class<? extends C> type) {
return includeAs(authentication, context, type, Collections.<DomainRequirement>emptyList());
}
@@ -356,7 +357,7 @@
* @see CredentialsProvider#listCredentials(Class, Item, Authentication, List, CredentialsMatcher)
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> include(@NonNull Item context, @NonNull Class<? extends C> type,
public AbstractIdCredentialsListBoxModel<T, C> include(@Nullable Item context, @NonNull Class<? extends C> type,
@NonNull List<DomainRequirement> domainRequirements) {
return includeMatching(context, type, domainRequirements, CredentialsMatchers.always());
}
@@ -372,7 +373,7 @@
* @see CredentialsProvider#listCredentials(Class, ItemGroup, Authentication, List, CredentialsMatcher)
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> include(@NonNull ItemGroup context, @NonNull Class<? extends C> type,
public AbstractIdCredentialsListBoxModel<T, C> include(@Nullable ItemGroup context, @NonNull Class<? extends C> type,
@NonNull List<DomainRequirement> domainRequirements) {
return includeMatching(context, type, domainRequirements, CredentialsMatchers.always());
}
@@ -390,7 +391,7 @@
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> includeAs(@NonNull Authentication authentication,
@NonNull Item context,
@Nullable Item context,
@NonNull Class<? extends C> type,
@NonNull List<DomainRequirement> domainRequirements) {
return includeMatchingAs(authentication, context, type, domainRequirements, CredentialsMatchers.always());
@@ -409,7 +410,7 @@
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> includeAs(@NonNull Authentication authentication,
@NonNull ItemGroup context,
@Nullable ItemGroup context,
@NonNull Class<? extends C> type,
@NonNull List<DomainRequirement> domainRequirements) {
return includeMatchingAs(authentication, context, type, domainRequirements, CredentialsMatchers.always());
@@ -427,7 +428,7 @@
* @see CredentialsProvider#listCredentials(Class, Item, Authentication, List, CredentialsMatcher)
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> includeMatching(@NonNull Item context,
public AbstractIdCredentialsListBoxModel<T, C> includeMatching(@Nullable Item context,
@NonNull Class<? extends C> type,
@NonNull List<DomainRequirement> domainRequirements,
@NonNull CredentialsMatcher matcher) {
@@ -446,7 +447,7 @@
* @see CredentialsProvider#listCredentials(Class, ItemGroup, Authentication, List, CredentialsMatcher)
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> includeMatching(@NonNull ItemGroup context,
public AbstractIdCredentialsListBoxModel<T, C> includeMatching(@Nullable ItemGroup context,
@NonNull Class<? extends C> type,
@NonNull List<DomainRequirement> domainRequirements,
@NonNull CredentialsMatcher matcher) {
@@ -467,7 +468,7 @@
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> includeMatchingAs(@NonNull Authentication authentication,
@NonNull Item context,
@Nullable Item context,
@NonNull Class<? extends C> type,
@NonNull
List<DomainRequirement> domainRequirements,
@@ -490,7 +491,7 @@
* @since 2.1.0
*/
public AbstractIdCredentialsListBoxModel<T, C> includeMatchingAs(@NonNull Authentication authentication,
@NonNull ItemGroup context,
@Nullable ItemGroup context,
@NonNull Class<? extends C> type,
@NonNull
List<DomainRequirement> domainRequirements,

0 comments on commit 65e143c

Please sign in to comment.
You can’t perform that action at this time.