Buggy code:
public abstract class AbstractExpressionBuilder { protected static final int EX_USER = 0 ; protected static final int EX_FATAL = 1 ; protected static final int EX_UNSUPPORTED = 2 ; public static final Class < Object > TYPE_OBJECT = Object . class ; public static final Class < String > TYPE_STRING = String . class ; public static final Class < Character > TYPE_CHAR_OBJ = Character . class ; public static final Class < Number > TYPE_NUMBER = Number . class ; public static final Class < Collection > TYPE_COLLECTION = Collection . class ; public static final Class < Map > TYPE_MAP = Map . class ; public static final int CONTAINS_TYPE_ELEMENT = 1 ; public static final int CONTAINS_TYPE_KEY = 2 ; public static final int CONTAINS_TYPE_VALUE = 3 ; private static final Localizer _loc = Localizer . forPackage ( AbstractExpressionBuilder . class ) ; protected final Resolver resolver ; protected ExpressionFactory factory ; private final Set < ClassMetaData > _accessPath = new HashSet < ClassMetaData > ( ) ; private Map < String , Value > _seenVars = null ; private Set < Value > _boundVars = null ; public AbstractExpressionBuilder ( ExpressionFactory factory , Resolver resolver ) { } protected abstract ClassLoader getClassLoader ( ) { } protected OpenJPAException parseException ( int e , String token , Object [ ] args , Exception nest ) { } protected ClassMetaData addAccessPath ( ClassMetaData meta ) { } protected ClassMetaData [ ] getAccessPath ( ) { } protected boolean isBound ( Value var ) { } protected void bind ( Value var ) { } protected Value getVariable ( String id , boolean bind ) { if ( isSeenVariable ( id ) ) return ( ( Value ) ( _seenVars . get ( id ) ) ) ; Class < ? > type = getDeclaredVariableType ( id ) ; ClassMetaData meta = null ; if ( type == null ) type = AbstractExpressionBuilder . TYPE_OBJECT ; else meta = getMetaData ( type , false ) ; if ( meta != null ) <START_BUG> _accessPath . add ( meta ) ; <END_BUG> Value var ; if ( bind ) var = factory . newBoundVariable ( id , type ) ; else var = factory . newUnboundVariable ( id , type ) ; var . setMetaData ( meta ) ; if ( ( _seenVars ) == null ) _seenVars = new HashMap < String , Value > ( ) ; _seenVars . put ( id , var ) ; return var ; } protected void assertUnboundVariablesValid ( ) { } protected abstract boolean isDeclaredVariable ( String id ) { } protected boolean isSeenVariable ( String id ) { } protected ClassMetaData getMetaData ( Class < ? > c , boolean required ) { } protected ClassMetaData getMetaData ( Class < ? > c , boolean required , ClassLoader loader ) { } protected Value traversePath ( Path path , String field ) { } protected Value traverseXPath ( Path path , String field ) { } protected Value traversePath ( Path path , String field , boolean pcOnly , boolean allowNull ) { } protected Object traverseStaticField ( Class < ? > cls , String field ) { } protected abstract Class < ? > getDeclaredVariableType ( String name ) { } protected void setImplicitTypes ( Value val1 , Value val2 , Class < ? > expected ) { } protected static void setImplicitTypes ( Value val1 , Value val2 , Class < ? > expected , Resolver resolver ) { } public static void convertTypes ( Value val1 , Value val2 ) { } public static void convertTypesQuotedNumbers ( Value val1 , Value val2 ) { } public static boolean isNumeric ( Class < ? > type ) { } protected void setImplicitContainsTypes ( Value val1 , Value val2 , int op ) { } protected static void setImplicitType ( Value val , Class < ? > expected ) { } protected abstract Localizer getLocalizer ( ) { } protected abstract String currentQuery ( ) { } }

Fix:
addAccessPath ( meta ) ;