Skip to content
Permalink
Browse files

[JENKINS-38978] Prevent FindBugs errors

  • Loading branch information
marcrohlfs committed Jan 3, 2018
1 parent 4e63757 commit c68fedad11ecf292385f8d40155534c282c1d44c
@@ -85,7 +85,7 @@
private static final Pattern MATCH_ALL = Pattern.compile(".*");
private static final Charset UTF8 = Charset.forName("UTF-8");

private transient int maxVers = Integer.MIN_VALUE;
private transient Integer maxVers = null;
private transient Pattern versionFilterPattern = null;

private final String repoBaseUrl;
@@ -124,13 +124,12 @@ public MavenMetadataParameterDefinition(String name, String description, String
}

public int getMaxVers() {
if (this.maxVers == Integer.MIN_VALUE) {
int maxVers = Integer.MAX_VALUE;
if (this.maxVers == null) {
try {
maxVers = Integer.parseInt(maxVersions);
this.maxVers = Integer.parseInt(maxVersions);
} catch (NumberFormatException e) {
this.maxVers = Integer.MAX_VALUE;
}
this.maxVers = maxVers;
}
return this.maxVers;
}
@@ -309,12 +308,7 @@ private MavenMetadataVersions getArtifactMetadata() {
result.versioning.versions.add("<" + e.getClass().getName() + ": " + e.getMessage() + ">");
return result;
} finally {
try {
if (input != null)
input.close();
} catch (IOException e) {
// ignore
}
IOUtils.closeQuietly(input);
}
}

0 comments on commit c68feda

Please sign in to comment.
You can’t perform that action at this time.