-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1392 from aneveux/spotbugs
- Loading branch information
Showing
37 changed files
with
156 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,8 @@ | |
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
|
||
/** | ||
* @author Carlos Sanchez [email protected] | ||
*/ | ||
|
@@ -151,14 +153,30 @@ public String toString() { | |
} | ||
|
||
@Override | ||
@NonNull | ||
public ACL getACL() { | ||
final ACL base = super.getACL(); | ||
return new ACL() { | ||
@Override | ||
public boolean hasPermission(Authentication a, Permission permission) { | ||
return permission == Computer.CONFIGURE ? false : base.hasPermission(a,permission); | ||
} | ||
}; | ||
return new KubernetesComputerACL(base); | ||
} | ||
|
||
/** | ||
* Simple static inner class to be used by {@link #getACL()}. | ||
* It replaces an anonymous inner class in order to fix | ||
* <a href="https://spotbugs.readthedocs.io/en/stable/bugDescriptions.html#sic-could-be-refactored-into-a-named-static-inner-class-sic-inner-should-be-static-anon">SIC_INNER_SHOULD_BE_STATIC_ANON</a>. | ||
*/ | ||
private static final class KubernetesComputerACL extends ACL { | ||
|
||
private final ACL base; | ||
|
||
public KubernetesComputerACL(final ACL base) { | ||
this.base = base; | ||
} | ||
|
||
@Override | ||
public boolean hasPermission(Authentication a, Permission permission) { | ||
return permission == Computer.CONFIGURE ? false : base.hasPermission(a,permission); | ||
} | ||
|
||
} | ||
|
||
public void setLaunching(boolean launching) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ | |
import org.jenkinsci.plugins.plaincredentials.StringCredentials; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | ||
|
||
import com.cloudbees.plugins.credentials.CredentialsScope; | ||
import com.cloudbees.plugins.credentials.impl.BaseStandardCredentials; | ||
|
||
|
@@ -14,6 +16,7 @@ | |
* @deprecated Use {@link StringCredentials} | ||
* @author <a href="mailto:[email protected]">Andrew Block</a> | ||
*/ | ||
@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.") | ||
@Deprecated | ||
public class OpenShiftTokenCredentialImpl extends BaseStandardCredentials implements TokenProducer { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ | |
import java.io.Serializable; | ||
import java.util.Collection; | ||
|
||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | ||
|
||
/** | ||
* Pod Template Tool Location | ||
* This class extends Jenkins DescribableList as implemented in Slave Class. Also implements Serializable interface | ||
|
@@ -32,6 +34,7 @@ | |
* | ||
* @author <a href="mailto:[email protected]">Aytunc BEKEN</a> | ||
*/ | ||
@SuppressFBWarnings(value = "SE_NO_SERIALVERSIONID", justification = "Serialization happens exclusively through XStream and not Java Serialization.") | ||
public class PodTemplateToolLocation extends DescribableList<NodeProperty<?>,NodePropertyDescriptor> implements Serializable { | ||
|
||
public PodTemplateToolLocation() {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package org.csanchez.jenkins.plugins.kubernetes; | ||
|
||
import org.jenkinsci.plugins.kubernetes.credentials.FileSystemServiceAccountCredential; | ||
import org.jenkinsci.plugins.kubernetes.credentials.TokenProducer; | ||
import org.kohsuke.stapler.DataBoundConstructor; | ||
|
||
import com.cloudbees.plugins.credentials.CredentialsScope; | ||
|
@@ -14,7 +13,7 @@ | |
* @author <a href="mailto:[email protected]">Nicolas De Loof</a> | ||
*/ | ||
@Deprecated | ||
public class ServiceAccountCredential extends FileSystemServiceAccountCredential implements TokenProducer { | ||
public class ServiceAccountCredential extends FileSystemServiceAccountCredential { | ||
|
||
private static final long serialVersionUID = 2739355565227800401L; | ||
|
||
|
Oops, something went wrong.