Skip to content
Permalink
Browse files
Merge pull request #3338 from oleg-nenashev/findbugs/JENKINS-50064
Cleanup FindBugs in CLI + some refactoring
  • Loading branch information
oleg-nenashev committed Mar 18, 2018
2 parents 34b1e83 + de86f32 commit bb89137596349eb1c82e93b645a41d058e90f864
Showing with 14 additions and 3 deletions.
  1. +10 −0 cli/pom.xml
  2. +3 −0 cli/src/main/java/hudson/cli/SSHCLI.java
  3. +0 −3 core/pom.xml
  4. +1 −0 pom.xml
@@ -13,6 +13,11 @@
<name>Jenkins cli</name>
<description>Command line interface for Jenkins</description>

<properties>
<!-- TODO: remove once Medium level is set in the core (JENKINS-36716) -->
<findbugs.threshold>Medium</findbugs.threshold>
</properties>

<dependencies>
<dependency>
<groupId>org.powermock</groupId>
@@ -67,6 +72,11 @@
<artifactId>trilead-ssh2</artifactId>
<version>build214-jenkins-1</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
@@ -51,6 +51,8 @@
import org.apache.sshd.common.util.io.NoCloseOutputStream;
import org.apache.sshd.common.util.security.SecurityUtils;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

/**
* Implements SSH connection mode of {@link CLI}.
* In a separate class to avoid any class loading of {@code sshd-core} when not using {@code -ssh} mode.
@@ -59,6 +61,7 @@
*/
class SSHCLI {

@SuppressFBWarnings(value = "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE", justification = "Due to whatever reason FindBugs reports it fot try-with-resources")
static int sshConnection(String jenkinsUrl, String user, List<String> args, PrivateKeyProvider provider, final boolean strictHostKey) throws IOException {
Logger.getLogger(SecurityUtils.class.getName()).setLevel(Level.WARNING); // suppress: BouncyCastle not registered, using the default JCE provider
URL url = new URL(jenkinsUrl + "login");
@@ -42,8 +42,6 @@ THE SOFTWARE.
<stapler.version>1.254</stapler.version>
<spring.version>2.5.6.SEC03</spring.version>
<groovy.version>2.4.11</groovy.version>
<!-- TODO: Actually many issues are being filtered by src/findbugs/findbugs-excludes.xml -->
<findbugs.failOnError>true</findbugs.failOnError>
</properties>

<dependencies>
@@ -600,7 +598,6 @@ THE SOFTWARE.
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>

@@ -107,6 +107,7 @@ THE SOFTWARE.
<remoting.version>3.18</remoting.version>
<remoting.minimum.supported.version>2.60</remoting.minimum.supported.version>

<!-- TODO: JENKINS-36716 - Switch to Medium once FindBugs is cleaned up, 430 issues on Mar 10, 2018 -->
<findbugs.effort>Max</findbugs.effort>
<findbugs.threshold>High</findbugs.threshold>
<findbugs.excludeFilterFile>../src/findbugs/findbugs-excludes.xml</findbugs.excludeFilterFile>

0 comments on commit bb89137

Please sign in to comment.