Skip to content

Commit

Permalink
[JENKINS-47069] Fix findbugs issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrille Le Clerc committed Oct 2, 2017
1 parent f0f6ed4 commit d7a5556
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
Expand Up @@ -460,21 +460,22 @@ public List<Map<String, String>> getGeneratedArtifacts(@Nonnull String jobFullNa

List<Map<String, String>> results = new ArrayList<>();
try (Connection cnn = this.jdbcConnectionPool.getConnection()) {
PreparedStatement stmt = cnn.prepareStatement(generatedArtifactsSql);
stmt.setString(1, jobFullName);
stmt.setInt(2, buildNumber);
try (ResultSet rst = stmt.executeQuery()) {
while (rst.next()) {
Map<String, String> artifact = new HashMap<>();

String gav =
rst.getString("maven_artifact.group_id") + ":" +
rst.getString("maven_artifact.artifact_id") + ":" +
rst.getString("maven_artifact.version");
artifact.put("gav", gav);
artifact.put("type", rst.getString("maven_artifact.type"));
artifact.put("skip_downstream_triggers", rst.getString("generated_maven_artifact.skip_downstream_triggers"));
results.add(artifact);
try (PreparedStatement stmt = cnn.prepareStatement(generatedArtifactsSql)) {
stmt.setString(1, jobFullName);
stmt.setInt(2, buildNumber);
try (ResultSet rst = stmt.executeQuery()) {
while (rst.next()) {
Map<String, String> artifact = new HashMap<>();

String gav =
rst.getString("maven_artifact.group_id") + ":" +
rst.getString("maven_artifact.artifact_id") + ":" +
rst.getString("maven_artifact.version");
artifact.put("gav", gav);
artifact.put("type", rst.getString("maven_artifact.type"));
artifact.put("skip_downstream_triggers", rst.getString("generated_maven_artifact.skip_downstream_triggers"));
results.add(artifact);
}
}
}
} catch(SQLException e) {
Expand Down
2 changes: 1 addition & 1 deletion maven-spy/pom.xml
Expand Up @@ -110,7 +110,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<version>3.0.4</version>
<version>3.0.5</version>
<executions>
<execution>
<phase>verify</phase>
Expand Down

0 comments on commit d7a5556

Please sign in to comment.