Skip to content

Commit

Permalink
misc: fix FindBugs warnings for release
Browse files Browse the repository at this point in the history
  • Loading branch information
evandbrown committed Dec 4, 2018
1 parent 423964b commit 1709b92
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 deletions.
24 changes: 3 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.7</version>
<version>3.28</version>
<relativePath />
</parent>
<artifactId>google-compute-engine</artifactId>
Expand Down Expand Up @@ -93,7 +93,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.2</version>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
Expand Down Expand Up @@ -146,25 +146,7 @@
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<skip>true</skip>
<effort>Max</effort>
<threshold>Medium</threshold>
<xmlOutput>true</xmlOutput>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
import java.util.Optional;

public class ComputeEngineInstance extends AbstractCloudSlave {
private static final long serialVersionUID = 1;
private static final Logger LOGGER = Logger.getLogger(ComputeEngineInstance.class.getName());
public final String zone;
public final String cloudName;
public final String sshUser;
public final Optional<WindowsConfiguration> windowsConfig;
public transient final Optional<WindowsConfiguration> windowsConfig;
public Integer launchTimeout; // Seconds
private Boolean connected;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,17 @@ private boolean authenticateSSH(WindowsConfiguration windowsConfig, Connection s

private boolean bootstrap(ComputeEngineComputer computer, TaskListener listener) throws IOException,
Exception { //TODO(evanbrown): better exceptions
if (computer == null) {
throw new IllegalArgumentException("A null ComputeEngineComputer was provided");
}
logInfo(computer, listener, "bootstrap");

ComputeEngineInstance node = computer.getNode();
WindowsConfiguration windowsConfig = node.windowsConfig.get();
if (node == null) {
throw new IllegalArgumentException("A ComputeEngineComputer with no node was provided");
}
WindowsConfiguration windowsConfig = node.windowsConfig.get();

Connection bootstrapConn = null;
try {
int tries = bootstrapAuthTries;
Expand Down Expand Up @@ -271,4 +276,4 @@ public boolean verifyServerHostKey(String hostname, int port, String serverHostK
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ public String getPassword() {
CredentialsProvider.lookupCredentials(StandardUsernamePasswordCredentials.class,
Jenkins.getInstance(), ACL.SYSTEM, domainRequirements),
CredentialsMatchers.withId(passwordCredentialsId.get()));

if (cred == null) {
return null;
}
return cred.getPassword().getPlainText();
}

Expand Down

0 comments on commit 1709b92

Please sign in to comment.