Buggy code:
public boolean assignObjectId ( OpenJPAStateManager sm , boolean preFlush ) { } public boolean assignField ( OpenJPAStateManager sm , int field , boolean preFlush ) { } public Class getManagedType ( Object oid ) { } public Class getDataStoreIdType ( ClassMetaData meta ) { } public Object copyDataStoreId ( Object oid , ClassMetaData meta ) { } public Object newDataStoreId ( Object val , ClassMetaData meta ) { } public Id newDataStoreId ( long id , ClassMapping mapping , boolean subs ) { } public ResultObjectProvider executeExtent ( ClassMetaData meta , final boolean subclasses , FetchConfiguration fetch ) { } private BitSet selectExtent ( Select sel , ClassMapping mapping , JDBCFetchConfiguration fetch , boolean subclasses ) { } public StoreQuery newQuery ( String language ) { } public FetchConfiguration newFetchConfiguration ( ) { } public Seq getDataStoreIdSequence ( ClassMetaData meta ) { } public Seq getValueSequence ( FieldMetaData fmd ) { } public void close ( ) { } private void connect ( boolean ref ) { } protected JDBCStoreManager . RefCountConnection connectInternal ( ) throws SQLException { } public Object find ( Object oid , ValueMapping vm , JDBCFetchConfiguration fetch ) { } public Object load ( ClassMapping mapping , JDBCFetchConfiguration fetch , BitSet exclude , Result result ) throws SQLException { } private void load ( ClassMapping mapping , OpenJPAStateManager sm , JDBCFetchConfiguration fetch , Result res ) throws SQLException { } private FieldMapping load ( ClassMapping mapping , OpenJPAStateManager sm , JDBCFetchConfiguration fetch , Result res , FieldMapping eagerToMany ) throws SQLException { } public boolean select ( Select sel , ClassMapping mapping , int subs , OpenJPAStateManager sm , BitSet fields , JDBCFetchConfiguration fetch , int eager , boolean ident , boolean outer ) { } private FieldMapping createEagerSelects ( Select sel , ClassMapping mapping , OpenJPAStateManager sm , BitSet fields , JDBCFetchConfiguration fetch , int eager ) { if ( ( mapping == null ) || ( eager == ( JDBCFetchConfiguration . EAGER_NONE ) ) ) return null ; FieldMapping eagerToMany = createEagerSelects ( sel , mapping . getJoinablePCSuperclassMapping ( ) , sm , fields , fetch , eager ) ; FieldMapping [ ] fms = mapping . getDefinedFieldMappings ( ) ; boolean inEagerJoin = sel . hasEagerJoin ( false ) ; int sels ; int jtype ; int mode ; for ( int i = 0 ; i < ( fms . length ) ; i ++ ) { mode = fms [ i ] . getEagerFetchMode ( ) ; if ( mode == ( fetch . EAGER_NONE ) ) continue ; if ( ! ( JDBCStoreManager . requiresSelect ( fms [ i ] , sm , fields , fetch ) ) ) continue ; jtype = ( ( fms [ i ] . getNullValue ( ) ) == ( fms [ i ] . NULL_EXCEPTION ) ) ? sel . EAGER_INNER : sel . EAGER_OUTER ; if ( ( ( ( mode != ( fetch . EAGER_PARALLEL ) ) && ( ! ( fms [ i ] . isEagerSelectToMany ( ) ) ) ) && ( ( fms [ i ] . supportsSelect ( sel , jtype , sm , this , fetch ) ) > 0 ) ) && ( ( sel . eagerClone ( fms [ i ] , jtype , false , 1 ) ) != null ) ) continue ; <START_BUG> boolean hasJoin = fetch . hasJoin ( fms [ i ] . getFullName ( ) ) ; <END_BUG> if ( ( ( ( ( ( ( hasJoin || ( mode == ( fetch . EAGER_JOIN ) ) ) || ( ( mode == ( fetch . DEFAULT ) ) && ( sm != null ) ) ) && ( fms [ i ] . isEagerSelectToMany ( ) ) ) && ( ! inEagerJoin ) ) && ( ! ( sel . hasEagerJoin ( true ) ) ) ) && ( ( ! ( sel . getAutoDistinct ( ) ) ) || ( ( ( ! ( sel . isLRS ( ) ) ) && ( ( sel . getStartIndex ( ) ) == 0 ) ) && ( ( sel . getEndIndex ( ) ) == ( Long . MAX_VALUE ) ) ) ) ) && ( ( fms [ i ] . supportsSelect ( sel , jtype , sm , this , fetch ) ) > 0 ) ) { if ( ( sel . eagerClone ( fms [ i ] , jtype , true , 1 ) ) != null ) eagerToMany = fms [ i ] ; else continue ; } if ( ( eager == ( fetch . EAGER_PARALLEL ) ) && ( ( sels = fms [ i ] . supportsSelect ( sel , sel . EAGER_PARALLEL , sm , this , fetch ) ) != 0 ) ) sel . eagerClone ( fms [ i ] , EAGER_PARALLEL , fms [ i ] . isEagerSelectToMany ( ) , sels ) ; } return eagerToMany ; } private static boolean requiresSelect ( FieldMapping fm , OpenJPAStateManager sm , BitSet fields , JDBCFetchConfiguration fetch ) { } private int selectBaseMappings ( Select sel , ClassMapping mapping , ClassMapping orig , OpenJPAStateManager sm , BitSet fields , JDBCFetchConfiguration fetch , int eager , FieldMapping eagerToMany , boolean ident , boolean joined ) { } private boolean optSelect ( FieldMapping fm , Select sel , OpenJPAStateManager sm , JDBCFetchConfiguration fetch ) { } private void selectSubclassMappings ( Select sel , ClassMapping mapping , OpenJPAStateManager sm , JDBCFetchConfiguration fetch ) { } private static Joins joinSubclass ( Select sel , ClassMapping base , ClassMapping sub , Joins joins ) { } public void loadSubclasses ( ClassMapping mapping ) { } private void beforeExecuteStatement ( Statement stmnt ) { } private void afterExecuteStatement ( Statement stmnt ) { } private static class ClientConnection extends DelegatingConnection { private boolean _closed = false ; public ClientConnection ( Connection conn ) { }

Fix:
boolean hasJoin = fetch . hasJoin ( fms [ i ] . getFullName ( false ) ) ;