REPO-484: Code formatting.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130645 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-09-14 13:27:05 +00:00
parent e05b5d5a0e
commit 5cf090c1f1

View File

@@ -76,7 +76,6 @@ public abstract class QueryHelper
*/ */
void in(String property, boolean negated, String... propertyValues); void in(String property, boolean negated, String... propertyValues);
/** /**
* Called any time a MATCHES clause is encountered. * Called any time a MATCHES clause is encountered.
* @param property Name of the property * @param property Name of the property
@@ -127,7 +126,6 @@ public abstract class QueryHelper
*/ */
public static void walk(Query query, WalkerCallback callback) public static void walk(Query query, WalkerCallback callback)
{ {
CommonTree tree = query.getTree(); CommonTree tree = query.getTree();
if (tree != null) if (tree != null)
{ {
@@ -168,7 +166,8 @@ public abstract class QueryHelper
List<Tree> children = getChildren(tree); List<Tree> children = getChildren(tree);
//Don't need the first item because its the property name //Don't need the first item because its the property name
String[] inVals = new String[children.size()-1]; String[] inVals = new String[children.size()-1];
for (int i = 1; i < children.size(); i++) { for (int i = 1; i < children.size(); i++)
{
inVals[i-1] = stripQuotes(children.get(i).getText()); inVals[i-1] = stripQuotes(children.get(i).getText());
} }
callback.in(tree.getChild(0).getText(), negated, inVals); callback.in(tree.getChild(0).getText(), negated, inVals);
@@ -201,14 +200,16 @@ public abstract class QueryHelper
case WhereClauseParser.OR: case WhereClauseParser.OR:
callback.or(); callback.or();
List<Tree> children = getChildren(tree); List<Tree> children = getChildren(tree);
for (Tree child : children) { for (Tree child : children)
{
callbackTree(child, callback, negated); callbackTree(child, callback, negated);
} }
return; return;
case WhereClauseParser.AND: case WhereClauseParser.AND:
callback.and(); callback.and();
List<Tree> childrenOfAnd = getChildren(tree); List<Tree> childrenOfAnd = getChildren(tree);
for (Tree child : childrenOfAnd) { for (Tree child : childrenOfAnd)
{
callbackTree(child, callback, negated); callbackTree(child, callback, negated);
} }
return; return;
@@ -224,30 +225,30 @@ public abstract class QueryHelper
* @param tree the current tree * @param tree the current tree
* @return siblings - all the elements at the same level in the tree * @return siblings - all the elements at the same level in the tree
*/ */
// public static List<Tree> getYoungerSiblings(Tree tree) // public static List<Tree> getYoungerSiblings(Tree tree)
// { // {
// Tree parent = tree.getParent(); // Tree parent = tree.getParent();
// //
// if (parent!=null && parent.getChildCount() > 0) // if (parent!=null && parent.getChildCount() > 0)
// { // {
// List<Tree> sibs = new ArrayList<Tree>(parent.getChildCount()-1); // List<Tree> sibs = new ArrayList<Tree>(parent.getChildCount()-1);
// boolean laterChildren = false; // boolean laterChildren = false;
// for (int i = 0; i < parent.getChildCount(); i++) { // for (int i = 0; i < parent.getChildCount(); i++) {
// Tree child = parent.getChild(i); // Tree child = parent.getChild(i);
// if (tree.equals(child)) // if (tree.equals(child))
// { // {
// laterChildren = true; // laterChildren = true;
// } // }
// else // else
// { // {
// if (laterChildren) sibs.add(child); // if (laterChildren) sibs.add(child);
// } // }
// } // }
// return sibs; // return sibs;
// } // }
// //
// //
// } // }
/** /**
* Gets the children as a List * Gets the children as a List