Skip to content

Commit

Permalink
Merge pull request #180 from MarkEWaite/use-pom-4.0
Browse files Browse the repository at this point in the history
Use pom 4.0
  • Loading branch information
MarkEWaite authored Apr 17, 2020
2 parents 376d34c + 268faa8 commit f726b28
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
15 changes: 7 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.57</version>
<version>4.0</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -47,8 +47,10 @@
<maven.javadoc.skip>true</maven.javadoc.skip>
<hpi.compatibleSinceVersion>5.0</hpi.compatibleSinceVersion>
<junit.jupiter.version>5.6.2</junit.jupiter.version>
<concurrency>2C</concurrency>
<slf4jVersion>1.7.26</slf4jVersion>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.failOnError>true</spotbugs.failOnError>
<spotbugs.threshold>Low</spotbugs.threshold>
</properties>

<dependencyManagement>
Expand All @@ -73,9 +75,9 @@
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
<exclusions>
<exclusion>
<exclusion><!-- prevent transitive inclusion of jsr305 -->
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
Expand Down Expand Up @@ -192,9 +194,6 @@
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.0.0</version>
<configuration>
<effort>Max</effort>
<threshold>Low</threshold>
<failOnError>true</failOnError>
<plugins>
<plugin>
<groupId>com.h3xstream.findsecbugs</groupId>
Expand All @@ -207,7 +206,7 @@
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<version>4.0.1</version>
<version>4.0.2</version>
</dependency>
</dependencies>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand All @@ -51,6 +52,9 @@ class PlatformDetailsTask implements Callable<PlatformDetails, IOException> {
/** Unknown field value string. Package protected for us by LsbRelease class */
static final String UNKNOWN_VALUE_STRING = "unknown+check_lsb_release_installed";

// Added Apr 16, 2020 to resolve spotbugs warning
private static final long serialVersionUID = 2020 - 04 - 16;

/**
* Checks that required SLAVE role is allowed.
*
Expand Down Expand Up @@ -151,7 +155,7 @@ protected PlatformDetails computeLabels(
@NonNull final String arch, @NonNull final String name, @NonNull final String version)
throws IOException {
LsbRelease release;
if (name.toLowerCase().startsWith("linux")) {
if (name.toLowerCase(Locale.ENGLISH).startsWith("linux")) {
release = new LsbRelease();
} else {
release = null;
Expand All @@ -177,7 +181,7 @@ protected PlatformDetails computeLabels(
@NonNull final String version,
@CheckForNull LsbRelease release)
throws IOException {
String computedName = name.toLowerCase();
String computedName = name.toLowerCase(Locale.ENGLISH);
String computedArch = arch;
String computedVersion = version;
if (computedName.startsWith("windows")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Locale;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Stream;
Expand Down Expand Up @@ -105,7 +106,7 @@ private static String computeExpectedName(String filename) {
if (filename.contains("sles")) {
return "SUSE";
}
return filename.toLowerCase();
return filename.toLowerCase(Locale.ENGLISH);
}

private static String computeExpectedVersion(String filename) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Locale;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Stream;
Expand Down Expand Up @@ -117,7 +118,7 @@ private static String computeExpectedName(String filename) {
if (filename.contains("sles")) {
return "SUSE";
}
return filename.toLowerCase();
return filename.toLowerCase(Locale.ENGLISH);
}

private static String computeExpectedVersion(String filename) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.stream.Stream;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
Expand Down Expand Up @@ -116,7 +117,7 @@ private String computeExpectedName(String name) {
if (name.startsWith("Mac")) {
return "mac";
}
return name.toLowerCase();
return name.toLowerCase(Locale.ENGLISH);
}

private String computeVersion(String name, String version) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Locale;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -50,7 +51,7 @@ public void testCall() throws Exception {
private void assertPlatformDetails(PlatformDetails details) {
String osName = SYSTEM_OS_NAME;
assertThat(osName, is(not(PlatformDetailsTask.UNKNOWN_VALUE_STRING)));
if (osName.toLowerCase().startsWith("linux")) {
if (osName.toLowerCase(Locale.ENGLISH).startsWith("linux")) {
String name = details.getName();
assertThat(name, is(not("windows")));
assertThat(name, is(not("linux")));
Expand Down

0 comments on commit f726b28

Please sign in to comment.