Remove useless cast

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

Closes gh-10078
This commit is contained in:
Stephane Nicoll 2017-08-25 18:53:56 +02:00
parent a37a45921f
commit 69faa7dd33
1 changed files with 3 additions and 2 deletions

View File

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