Buggy code:
public class JPQLExpressionBuilder extends AbstractExpressionBuilder implements JPQLTreeConstants { private static final int VAR_PATH = 1 ; private static final int VAR_ERROR = 2 ; private static final Localizer _loc = Localizer . forPackage ( JPQLExpressionBuilder . class ) ; private final Stack contexts = new Stack ( ) ; private LinkedMap parameterTypes ; private int aliasCount = 0 ; public JPQLExpressionBuilder ( ExpressionFactory factory , ExpressionStoreQuery query , Object parsedQuery ) { } protected Localizer getLocalizer ( ) { } protected ClassLoader getClassLoader ( ) { } protected JPQLExpressionBuilder . ParsedJPQL getParsedQuery ( ) { } protected JPQLExpressionBuilder . ParsedJPQL getParsedQuery ( String jpql ) { } private void setCandidate ( ClassMetaData cmd , String schemaAlias ) { } private String nextAlias ( ) { } protected ClassMetaData resolveClassMetaData ( JPQLExpressionBuilder . JPQLNode node ) { } private ClassMetaData getClassMetaData ( String alias , boolean assertValid ) { } private Class getCandidateType ( ) { } private ClassMetaData getCandidateMetaData ( ) { } protected ClassMetaData getCandidateMetaData ( JPQLExpressionBuilder . JPQLNode node ) { } protected String currentQuery ( ) { } QueryExpressions getQueryExpressions ( ) { } private Expression and ( Expression e1 , Expression e2 ) { } private static String assemble ( JPQLExpressionBuilder . JPQLNode node ) { } private static String assemble ( JPQLExpressionBuilder . JPQLNode node , String delimiter , int last ) { } private Expression assignProjections ( JPQLExpressionBuilder . JPQLNode parametersNode , QueryExpressions exps ) { } private void evalQueryOperation ( QueryExpressions exps ) { } private void evalGroupingClause ( QueryExpressions exps ) { } private void evalHavingClause ( QueryExpressions exps ) { } private void evalOrderingClauses ( QueryExpressions exps ) { } private Expression evalSelectClause ( QueryExpressions exps ) { } private String assertSchemaAlias ( ) { } protected Expression evalFetchJoins ( QueryExpressions exps ) { } protected void evalSetClause ( QueryExpressions exps ) { } private Expression evalWhereClause ( ) { } private Expression evalFromClause ( boolean needsAlias ) { } private Expression addJoin ( JPQLExpressionBuilder . JPQLNode node , boolean inner , Expression exp ) { } private Expression addJoin ( Path path , JPQLExpressionBuilder . JPQLNode aliasNode , Expression exp ) { } private Expression evalFromItem ( Expression exp , JPQLExpressionBuilder . JPQLNode node , boolean needsAlias ) { } protected boolean isDeclaredVariable ( String name ) { } boolean isPath ( JPQLExpressionBuilder . JPQLNode node ) { } private static ClassMetaData getFieldType ( FieldMetaData fmd ) { } protected Value getVariable ( String id , boolean bind ) { } protected boolean isSeendVariable ( String id ) { } private String assertSchemaName ( JPQLExpressionBuilder . JPQLNode node ) { } private Object eval ( JPQLExpressionBuilder . JPQLNode node ) { } private void assertQueryExtensions ( String clause ) { } protected void setImplicitTypes ( Value val1 , Value val2 , Class expected ) { } private Value getStringValue ( JPQLExpressionBuilder . JPQLNode node ) { } private Value getNumberValue ( JPQLExpressionBuilder . JPQLNode node ) { } private Value getTypeValue ( JPQLExpressionBuilder . JPQLNode node , Class implicitType ) { } private Value getSubquery ( JPQLExpressionBuilder . JPQLNode node ) { } private Parameter getParameter ( String id , boolean positional ) { } private Expression evalNot ( boolean not , Expression exp ) { } private String trimQuotes ( String str ) { } private short negative ( JPQLExpressionBuilder . JPQLNode node ) { } private Value getIdentifier ( JPQLExpressionBuilder . JPQLNode node ) { } private Value getPathOrConstant ( JPQLExpressionBuilder . JPQLNode node ) { String className = JPQLExpressionBuilder . assemble ( node , "." , 1 ) ; Class c = resolver . classForName ( className , null ) ; if ( c != null ) { String fieldName = JPQLExpressionBuilder . lastChild ( node ) . text ; try { Field field = c . getField ( fieldName ) ; Object value = field . get ( null ) ; return factory . newLiteral ( value , TYPE_UNKNOWN ) ; } catch ( NoSuchFieldException nsfe ) { <START_BUG> throw parseException ( EX_USER , "no-field" , new Object [ ] { className , fieldName } , nsfe ) ; <END_BUG> } catch ( Exception e ) { throw parseException ( EX_USER , "unaccessible-field" , new Object [ ] { className , fieldName } , e ) ; } } else { return getPath ( node , false , true ) ; } } private Path getPath ( JPQLExpressionBuilder . JPQLNode node ) { } private Path getPath ( JPQLExpressionBuilder . JPQLNode node , boolean pcOnly , boolean inner ) { } protected Class getDeclaredVariableType ( String name ) { } private Expression getExpression ( JPQLExpressionBuilder . JPQLNode node ) { } private Value getValue ( JPQLExpressionBuilder . JPQLNode node ) { } private Path newPath ( Value val , ClassMetaData meta ) { } private Value getValue ( JPQLExpressionBuilder . JPQLNode node , int handleVar ) { } private JPQLExpressionBuilder . Context ctx ( ) { } private JPQLExpressionBuilder . JPQLNode root ( ) { } private ClassMetaData getMetaDataForAlias ( String alias ) { } private class Context { private final JPQLExpressionBuilder . ParsedJPQL parsed ; private ClassMetaData meta ; private String schemaAlias ; private Subquery subquery ; Context ( JPQLExpressionBuilder . ParsedJPQL parsed , Subquery subquery ) { } } private JPQLExpressionBuilder . JPQLNode onlyChild ( JPQLExpressionBuilder . JPQLNode node ) throws UserException { } private JPQLExpressionBuilder . JPQLNode left ( JPQLExpressionBuilder . JPQLNode node ) { } private JPQLExpressionBuilder . JPQLNode right ( JPQLExpressionBuilder . JPQLNode node ) { } private JPQLExpressionBuilder . JPQLNode child ( JPQLExpressionBuilder . JPQLNode node , int childNum , int assertCount ) { } private JPQLExpressionBuilder . JPQLNode firstChild ( JPQLExpressionBuilder . JPQLNode node ) { } private static JPQLExpressionBuilder . JPQLNode secondChild ( JPQLExpressionBuilder . JPQLNode node ) { } private static JPQLExpressionBuilder . JPQLNode thirdChild ( JPQLExpressionBuilder . JPQLNode node ) { } private static JPQLExpressionBuilder . JPQLNode lastChild ( JPQLExpressionBuilder . JPQLNode node ) { }

Fix:
throw parseException ( EX_USER , "no-field" , new Object [ ] { c . getName ( ) , fieldName } , nsfe ) ;