Buggy code:
public class GET extends AbstractQuery implements Shift { public static final GET _ = new GET ( ) ; private static boolean debug = false ; private GET ( ) { } protected GET ( String ... name ) { } TraversalDescription td = Traversal . description ( ) . depthFirst ( ) . uniqueness ( RELATIONSHIP_PATH ) ; private static TraversalDescription td_eval_ic = Traversal . description ( ) . breadthFirst ( ) . relationships ( AN . _ , OUTGOING ) . relationships ( SHALL . _ , OUTGOING ) ; public OnQuestion onCalcQuestion ( ) { } private OnQuestion question = new OnQuestion ( ) { @ Override public void onMessage ( final PFlow pf ) { } private void evalGet ( final PFlow pf , final Relationship op , final Node node , final Set < Node > thes , final Set < Relationship > visitedREFs ) { } } ; public Set < QCAVector > get ( PFlow pf , Relationship op , QCAVector vector , final Set < Node > thes , Set < Relationship > visitedREFs ) { } public Set < QCAVector > get ( final PFlow pf , Relationship op , Node ref , final Set < Node > thes , final Set < Relationship > visitedREFs ) { } private boolean check ( Set < QCAVector > set , final PFlow pf , final Relationship op , final QCAVector v , final Relationship toCheck , final Set < Node > thes , Set < Relationship > visitedREFs ) { } public Set < QCAVector > get ( final PFlow pf , final Relationship op , final Set < QCAVector > REFs , final Set < Node > thes , Set < Relationship > visitedREFs ) { } private void getOutgoingReferences ( PFlow pf , QCAVector vector , Relationship rr , Node node , Set < QCAVector > newREFs , Set < Relationship > visitedREFs ) { } private Relationship [ ] searchForHAVE ( final PFlow pf , final Relationship ref , final QCAVector v , final Set < Node > thes ) { } private Relationship [ ] searchForHAVE ( final PFlow pflow , Relationship op , final Node ref , final Set < Node > thes ) { } public Relationship [ ] getBySELF ( final PFlow pf , Node context , final Set < Node > thes ) { } private Relationship [ ] getByHave ( final PFlow pflow , Relationship op , final Node context , final Set < Node > thes ) { if ( context == null ) return null ; TraversalDescription trav = td . relationships ( ANY . _ , OUTGOING ) . relationships ( AN . _ , OUTGOING ) . relationships ( REF . _ , OUTGOING ) . relationships ( SHALL . _ , OUTGOING ) . evaluator ( new Searcher ( ) { @ Override public Evaluation evaluate ( Path path ) { return _evaluate_ ( path , thes ) ; } } ) ; Map < Relationship , Path > paths = new javolution . util . FastMap < Relationship , Path > ( ) ; for ( Path path : trav . traverse ( context ) ) { System . out . println ( ( "*<seq2seq4repair_space>" + path ) ) ; if ( ( path . length ( ) ) == 1 ) { if ( op == null ) { System . out . println ( "WARNING:<seq2seq4repair_space>DONT<seq2seq4repair_space>KNOW<seq2seq4repair_space>OP" ) ; continue ; } paths . put ( op , path ) ; } if ( ( path . length ( ) ) == 2 ) { return new Relationship [ ] { path . relationships ( ) . iterator ( ) . next ( ) } ; } Relationship fR = path . relationships ( ) . iterator ( ) . next ( ) ; Path p = paths . get ( fR ) ; if ( ( p == null ) || ( ( p . length ( ) ) > ( path . length ( ) ) ) ) { paths . put ( fR , path ) ; } } Relationship startBy = null ; Relationship res = null ; List < Relationship > resByHAVE = new javolution . util . FastList < Relationship > ( ) ; List < Relationship > resByIS = new javolution . util . FastList < Relationship > ( ) ; for ( Path path : paths . values ( ) ) { for ( Relationship r : path . relationships ( ) ) { if ( startBy == null ) startBy = r ; if ( ! ( pflow . isInStack ( r ) ) ) { if ( r . isType ( AN . _ ) ) { if ( Utils . haveContext ( r . getEndNode ( ) ) ) { res = r ; } else <START_BUG> if ( ( startBy . isType ( REF . _ ) ) || ( ( op != null ) && ( op . isType ( RESULT ) ) ) ) { <END_BUG> res = r ; } } else if ( r . isType ( SHALL . _ ) ) { res = r ; } } } if ( res != null ) { if ( ( startBy != null ) && ( startBy . isType ( REF . _ ) ) ) resByIS . add ( res ) ; else resByHAVE . add ( res ) ; } startBy = null ; } if ( ! ( resByHAVE . isEmpty ( ) ) ) return resByHAVE . toArray ( new Relationship [ resByHAVE . size ( ) ] ) ; return resByIS . toArray ( new Relationship [ resByIS . size ( ) ] ) ; } private Relationship getShall ( final Node context , final Set < Node > thes ) { } }

Fix:
if ( ( res == null ) && ( ( startBy . isType ( REF . _ ) ) || ( ( op != null ) && ( ( op . isType ( REF . _ ) ) || ( op . isType ( RESULT ) ) ) ) ) ) {