Skip to content

Commit

Permalink
Merge pull request #19290 from lyyprean
Browse files Browse the repository at this point in the history
* gh-19290:
  Remove redundant hasText check as query always has text

Closes gh-19290
  • Loading branch information
wilkinsona committed Dec 5, 2019
2 parents 3834052 + c6a1844 commit c6d4ff6
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,10 @@ private void doDataSourceHealthCheck(Health.Builder builder) throws Exception {
String product = getProduct();
builder.up().withDetail("database", product);
String validationQuery = getValidationQuery(product);
if (StringUtils.hasText(validationQuery)) {
// Avoid calling getObject as it breaks MySQL on Java 7
List<Object> results = this.jdbcTemplate.query(validationQuery, new SingleColumnRowMapper());
Object result = DataAccessUtils.requiredSingleResult(results);
builder.withDetail("hello", result);
}
// Avoid calling getObject as it breaks MySQL on Java 7
List<Object> results = this.jdbcTemplate.query(validationQuery, new SingleColumnRowMapper());
Object result = DataAccessUtils.requiredSingleResult(results);
builder.withDetail("hello", result);
}

private String getProduct() {
Expand Down

0 comments on commit c6d4ff6

Please sign in to comment.