Remove useless cast

The number of nodes can be added to the details without the need to cast
it.

Closes gh-10078
pull/10079/head
Stephane Nicoll 7 years ago
parent a37a45921f
commit 69faa7dd33

@ -27,6 +27,7 @@ import org.neo4j.ogm.session.SessionFactory;
* statement.
*
* @author Eric Spiegelberg
* @author Stephane Nicoll
* @since 2.0.0
*/
public class Neo4jHealthIndicator extends AbstractHealthIndicator {
@ -51,8 +52,8 @@ public class Neo4jHealthIndicator extends AbstractHealthIndicator {
protected void doHealthCheck(Health.Builder builder) throws Exception {
Session session = this.sessionFactory.openSession();
Result result = session.query(CYPHER, Collections.emptyMap());
int nodes = (int) result.queryResults().iterator().next().get("nodes");
builder.up().withDetail("nodes", nodes);
builder.up().withDetail("nodes", result.queryResults()
.iterator().next().get("nodes"));
}
}

Loading…
Cancel
Save