Skip to content

Commit

Permalink
remove deprecated @nonnull
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlaverse committed May 21, 2021
1 parent d292ed1 commit fd95037
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.jenkinsci.plugins.kubernetes.tokensource;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import jenkins.authentication.tokens.api.AuthenticationTokenException;
import jenkins.authentication.tokens.api.AuthenticationTokenSource;
Expand All @@ -11,9 +10,8 @@
public class DockerServerCredentialsTokenSource extends AuthenticationTokenSource<KubernetesAuthCertificate, DockerServerCredentials> {
public DockerServerCredentialsTokenSource() { super(KubernetesAuthCertificate.class, DockerServerCredentials.class); }

@NonNull
@Override
public KubernetesAuthCertificate convert(@NonNull DockerServerCredentials credential) throws AuthenticationTokenException {
public KubernetesAuthCertificate convert(DockerServerCredentials credential) throws AuthenticationTokenException {
return new KubernetesAuthCertificate(credential.getClientCertificate(), credential.getClientKeySecret());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.jenkinsci.plugins.kubernetes.tokensource;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import jenkins.authentication.tokens.api.AuthenticationTokenException;
import jenkins.authentication.tokens.api.AuthenticationTokenSource;
Expand All @@ -18,9 +17,8 @@ public FileCredentialsTokenSource() {
super(KubernetesAuthKubeconfig.class, FileCredentials.class);
}

@NonNull
@Override
public KubernetesAuthKubeconfig convert(@NonNull FileCredentials credential) throws AuthenticationTokenException {
public KubernetesAuthKubeconfig convert(FileCredentials credential) throws AuthenticationTokenException {
try (InputStream is = credential.getContent()) {
return new KubernetesAuthKubeconfig(IOUtils.toString(is, StandardCharsets.UTF_8));
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.google.jenkins.plugins.credentials.oauth.GoogleOAuth2ScopeRequirement;
import com.google.jenkins.plugins.credentials.oauth.GoogleRobotCredentials;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import jenkins.authentication.tokens.api.AuthenticationTokenSource;
import org.jenkinsci.plugins.kubernetes.auth.impl.KubernetesAuthToken;
Expand All @@ -19,9 +18,8 @@ public GoogleRobotCredentialsTokenSource() {
super(KubernetesAuthToken.class, GoogleRobotCredentials.class);
}

@NonNull
@Override
public KubernetesAuthToken convert(@NonNull GoogleRobotCredentials credential) {
public KubernetesAuthToken convert(GoogleRobotCredentials credential) {
return new KubernetesAuthToken((serviceAddress, caCertData, skipTlsVerify) -> credential.getAccessToken(new GoogleOAuth2ScopeRequirement() {
@Override
public Collection<String> getScopes() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package org.jenkinsci.plugins.kubernetes.tokensource;

import com.cloudbees.plugins.credentials.common.StandardCertificateCredentials;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.util.Secret;
import jenkins.authentication.tokens.api.AuthenticationTokenException;
import jenkins.authentication.tokens.api.AuthenticationTokenSource;
import org.jenkinsci.plugins.kubernetes.auth.impl.KubernetesAuthKeystore;
Expand All @@ -14,9 +12,8 @@ public StandardCertificateCredentialsTokenSource() {
super(KubernetesAuthKeystore.class, StandardCertificateCredentials.class);
}

@NonNull
@Override
public KubernetesAuthKeystore convert(@NonNull StandardCertificateCredentials credential) throws AuthenticationTokenException {
public KubernetesAuthKeystore convert(StandardCertificateCredentials credential) throws AuthenticationTokenException {
return new KubernetesAuthKeystore(credential.getKeyStore(), credential.getPassword());
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.jenkinsci.plugins.kubernetes.tokensource;

import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import jenkins.authentication.tokens.api.AuthenticationTokenSource;
import org.jenkinsci.plugins.kubernetes.auth.impl.KubernetesAuthToken;
Expand All @@ -12,9 +11,8 @@ public StringCredentialsTokenSource() {
super(KubernetesAuthToken.class, StringCredentials.class);
}

@NonNull
@Override
public KubernetesAuthToken convert(@NonNull StringCredentials credential) {
public KubernetesAuthToken convert(StringCredentials credential) {
return new KubernetesAuthToken((serviceAddress, caCertData, skipTlsVerify) -> credential.getSecret().getPlainText());
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.jenkinsci.plugins.kubernetes.tokensource;

import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials;
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import jenkins.authentication.tokens.api.AuthenticationTokenException;
import jenkins.authentication.tokens.api.AuthenticationTokenSource;
Expand All @@ -16,9 +15,8 @@ public UsernamePasswordCredentialsTokenSource() {
super(KubernetesAuth.class, StandardUsernamePasswordCredentials.class);
}

@NonNull
@Override
public KubernetesAuth convert(@NonNull StandardUsernamePasswordCredentials credential) throws AuthenticationTokenException {
public KubernetesAuth convert(StandardUsernamePasswordCredentials credential) throws AuthenticationTokenException {
if (credential instanceof TokenProducer) {
return new KubernetesAuthToken((TokenProducer) credential);
} else {
Expand Down

0 comments on commit fd95037

Please sign in to comment.