HHH-2166 Long 'in' lists in queries results in a Java stack overflow exception.
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18356 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
01432e3a16
commit
95e10ad81d
|
@ -63,20 +63,26 @@ public class NodeTraverser {
|
|||
throw new IllegalArgumentException(
|
||||
"node to traverse cannot be null!" );
|
||||
}
|
||||
AST node = ast.getFirstChild();
|
||||
visitDepthFirst( ast.getFirstChild() );
|
||||
}
|
||||
|
||||
private void visitDepthFirst(AST ast){
|
||||
if(ast==null){
|
||||
return;
|
||||
}
|
||||
Stack stack = new Stack();
|
||||
if ( node != null ) {
|
||||
stack.push( node );
|
||||
if ( ast != null ) {
|
||||
stack.push( ast );
|
||||
while (!stack.empty()) {
|
||||
node = (AST) stack.pop();
|
||||
strategy.visit( node );
|
||||
if ( node.getFirstChild() != null ) {
|
||||
stack.push( node.getFirstChild() );
|
||||
}
|
||||
if ( node.getNextSibling() != null ) {
|
||||
stack.push( node.getNextSibling() );
|
||||
}
|
||||
ast = (AST) stack.pop();
|
||||
strategy.visit( ast );
|
||||
if ( ast.getNextSibling() != null )
|
||||
stack.push( ast.getNextSibling() );
|
||||
if ( ast.getFirstChild() != null )
|
||||
stack.push( ast.getFirstChild() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue