Skip to content
Permalink
Browse files
[JENKINS-50064] - Suppress FindBugs warning in CLI, switch to the med…
…ium level
  • Loading branch information
oleg-nenashev committed Mar 10, 2018
1 parent 20bc2e8 commit 5e0e55335319f41e821c3b1423e69510c9c20559
Showing with 13 additions and 0 deletions.
  1. +10 −0 cli/pom.xml
  2. +3 −0 cli/src/main/java/hudson/cli/SSHCLI.java
@@ -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");

0 comments on commit 5e0e553

Please sign in to comment.