提交 5e0e5533 编写于 作者: O Oleg Nenashev

[JENKINS-50064] - Suppress FindBugs warning in CLI, switch to the medium level

上级 20bc2e89
......@@ -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.NoCloseInputStream;
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 @@ import org.apache.sshd.common.util.security.SecurityUtils;
*/
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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册