From d8d08a1ff6b09d1c7e0a3b25e53592d9affc73b3 Mon Sep 17 00:00:00 2001 From: Nicki Watt Date: Thu, 11 Jul 2013 22:50:52 +0100 Subject: [PATCH] DATAGRAPH-330 : Used foreach and adjusted comment --- .../data/neo4j/repository/query/CypherQuery.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/CypherQuery.java b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/CypherQuery.java index bb0bc88f8..bbb5bd345 100644 --- a/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/CypherQuery.java +++ b/spring-data-neo4j/src/main/java/org/springframework/data/neo4j/repository/query/CypherQuery.java @@ -94,9 +94,7 @@ public class CypherQuery implements CypherQueryDefinition { private Sort getCypherEntityRefAwareSort(Sort sorts) { List entityAwareOrders = new ArrayList(); - Iterator i = sorts.iterator(); - while( i.hasNext()) { - Sort.Order o = i.next(); + for (Sort.Order o : sorts) { entityAwareOrders.add( getEntityAwareOrderRef(o) ); } Sort entityAwareSort = new Sort(entityAwareOrders); @@ -104,9 +102,7 @@ public class CypherQuery implements CypherQueryDefinition { } private Sort.Order getEntityAwareOrderRef(Sort.Order o) { - // Cater for cases which cause 80% of the reported grief, i.e. assumes a string - // with no period refers to a property on entity - however this will - // not always be the case .. confirm with Michael .. + // Assumes a string with no period refers to a property on entity return (o.getProperty().contains(".")) ? o : new Sort.Order(o.getDirection(),getEntityName(entity)+"."+o.getProperty());