Skip to content

Commit

Permalink
fix PMD Avoid unused local variables such as 'con'.
Browse files Browse the repository at this point in the history
  • Loading branch information
yurake committed Apr 5, 2023
1 parent 5097f3d commit 196ad9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public class MysqlService implements Database {

public boolean connectionStatus() {
boolean status = false;
try (Connection con = ds.getConnection()) {
try {
ds.getConnection();
status = true;
} catch (SQLException | NullPointerException e) {
logger.log(Level.SEVERE, "Status Check Error.", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public class PostgresService implements Database {

public boolean connectionStatus() {
boolean status = false;
try (Connection con = ds.getConnection()) {
try {
ds.getConnection();
status = true;
} catch (SQLException | NullPointerException e) {
logger.log(Level.SEVERE, "Status Check Error.", e);
Expand Down

0 comments on commit 196ad9b

Please sign in to comment.