Skip to content

Commit

Permalink
Update to latest Jenkins Dependency and fix some find bugs warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mdkf authored and Michael Fowler committed Apr 13, 2017
1 parent 8cbfac9 commit 2ada6ed
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>2.11</version>
<version>2.23</version>
<relativePath />
</parent>
<packaging>hpi</packaging>
Expand All @@ -14,7 +14,7 @@
<java.level>7</java.level>
<!-- Jenkins Test Harness version you use to test the plugin. -->
<!-- For Jenkins version >= 1.580.1 use JTH 2.x or higher. -->
<jenkins-test-harness.version>2.13</jenkins-test-harness.version>
<jenkins-test-harness.version>2.19</jenkins-test-harness.version>
<!-- Other properties you may want to use:
~ hpi-plugin.version: The HPI Maven Plugin version used by the plugin..
~ stapler-plugin.version: The Stapler Maven plugin version required by the plugin.
Expand Down
Expand Up @@ -132,6 +132,7 @@ public class StashNotifier extends Notifier implements SimpleBuildStep {

// public members ----------------------------------------------------------

@Override
public BuildStepMonitor getRequiredMonitorService() {
return BuildStepMonitor.NONE;
}
Expand Down Expand Up @@ -452,6 +453,7 @@ private SSLContext buildSslContext(boolean ignoreUnverifiedSSL, Credentials cred
}
if (ignoreUnverifiedSSL) {
TrustStrategy easyStrategy = new TrustStrategy() {
@Override
public boolean isTrusted(X509Certificate[] chain, String authType)
throws CertificateException {
return true;
Expand Down Expand Up @@ -562,7 +564,7 @@ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item project) {
}

public String getStashRootUrl() {
if ((stashRootUrl == null) || (stashRootUrl.trim().equals(""))) {
if ((stashRootUrl == null) || (stashRootUrl.trim().isEmpty())) {
return null;
} else {
return stashRootUrl;
Expand Down Expand Up @@ -610,13 +612,13 @@ public FormValidation doCheckStashServerBaseUrl(

// calculate effective url from global and local config
String url = value;
if ((url != null) && (!url.trim().equals(""))) {
if ((url != null) && (!url.trim().isEmpty())) {
url = url.trim();
} else {
url = stashRootUrl != null ? stashRootUrl.trim() : null;
}

if ((url == null) || url.equals("")) {
if ((url == null) || url.isEmpty()) {
return FormValidation.error(
"Please specify a valid URL here or in the global "
+ "configuration");
Expand All @@ -633,10 +635,12 @@ public FormValidation doCheckStashServerBaseUrl(
}

@SuppressWarnings("rawtypes")
@Override
public boolean isApplicable(Class<? extends AbstractProject> aClass) {
return true;
}

@Override
public String getDisplayName() {
return "Notify Stash Instance";
}
Expand Down

0 comments on commit 2ada6ed

Please sign in to comment.