Buggy code:
public class ManagedClassSubclasser { private static final Localizer _loc = Localizer . forPackage ( ManagedClassSubclasser . class ) ; public static List < Class < ? > > prepareUnenhancedClasses ( final OpenJPAConfiguration conf , final Collection < ? extends Class < ? > > classes , final ClassLoader envLoader ) { if ( classes == null ) return null ; if ( ( classes . size ( ) ) == 0 ) return Collections . emptyList ( ) ; Log log = conf . getLog ( LOG_ENHANCE ) ; if ( ( conf . getRuntimeUnenhancedClassesConstant ( ) ) != ( RuntimeUnenhancedClassesModes . SUPPORTED ) ) { Collection < Class < ? > > unenhanced = new ArrayList < Class < ? > > ( ) ; for ( Class < ? > cls : classes ) if ( ! ( PersistenceCapable . class . isAssignableFrom ( cls ) ) ) unenhanced . add ( cls ) ; if ( ( unenhanced . size ( ) ) > 0 ) { if ( ( PCEnhancerAgent . getLoadSuccessful ( ) ) == true ) { if ( log . isWarnEnabled ( ) ) { log . warn ( ManagedClassSubclasser . _loc . get ( "entities-loaded-before-em" ) ) ; } if ( log . isTraceEnabled ( ) ) { log . trace ( ( ( ( ( ManagedClassSubclasser . class . getName ( ) ) + ".prepareUnenhancedClasses()" ) + "<seq2seq4repair_space>-<seq2seq4repair_space>The<seq2seq4repair_space>following<seq2seq4repair_space>classes<seq2seq4repair_space>are<seq2seq4repair_space>unenhanced<seq2seq4repair_space>" ) + ( unenhanced . toString ( ) ) ) ) ; } } Message msg = ManagedClassSubclasser . _loc . get ( "runtime-optimization-disabled" , Exceptions . toClassNames ( unenhanced ) ) ; if ( ( conf . getRuntimeUnenhancedClassesConstant ( ) ) == ( RuntimeUnenhancedClassesModes . WARN ) ) { log . warn ( msg ) ; } else { throw new org . apache . openjpa . util . UserException ( msg ) ; } } return null ; } boolean redefine = ClassRedefiner . canRedefineClasses ( log ) ; if ( redefine ) { log . info ( ManagedClassSubclasser . _loc . get ( "enhance-and-subclass-and-redef-start" , classes ) ) ; } else { <START_BUG> log . info ( ManagedClassSubclasser . _loc . get ( "enhance-and-subclass-no-redef-start" , classes ) ) ; <END_BUG> } final Map < Class < ? > , byte [ ] > map = new HashMap < Class < ? > , byte [ ] > ( ) ; final List < Class < ? > > subs = new ArrayList < Class < ? > > ( classes . size ( ) ) ; final List < Class < ? > > ints = new ArrayList < Class < ? > > ( classes . size ( ) ) ; Set < Class < ? > > unspecified = null ; for ( Class < ? > cls : classes ) { final Class < ? > c = cls ; final PCEnhancer enhancer = new PCEnhancer ( conf , cls ) ; enhancer . setBytecodeWriter ( new BytecodeWriter ( ) { public void write ( BCClass bc ) throws IOException { ManagedClassSubclasser . write ( bc , enhancer , map , c , subs , ints ) ; } } ) ; if ( redefine ) { enhancer . setRedefine ( true ) ; } enhancer . setCreateSubclass ( true ) ; enhancer . setAddDefaultConstructor ( true ) ; ClassMetaData meta = enhancer . getMetaData ( ) ; if ( meta == null ) { throw new org . apache . openjpa . util . MetaDataException ( ManagedClassSubclasser . _loc . get ( "no-meta" , cls ) ) . setFatal ( true ) ; } ManagedClassSubclasser . configureMetaData ( meta , conf , redefine , false ) ; unspecified = ManagedClassSubclasser . collectRelatedUnspecifiedTypes ( enhancer . getMetaData ( ) , classes , unspecified ) ; int runResult = enhancer . run ( ) ; if ( runResult == ( PCEnhancer . ENHANCE_PC ) ) { try { enhancer . record ( ) ; } catch ( IOException e ) { throw new InternalException ( e ) ; } } } if ( ( unspecified != null ) && ( ! ( unspecified . isEmpty ( ) ) ) ) throw new org . apache . openjpa . util . UserException ( ManagedClassSubclasser . _loc . get ( "unspecified-unenhanced-types" , Exceptions . toClassNames ( classes ) , unspecified ) ) ; ClassRedefiner . redefineClasses ( conf , map ) ; for ( Class < ? > cls : map . keySet ( ) ) { ManagedClassSubclasser . setIntercepting ( conf , envLoader , cls ) ; ManagedClassSubclasser . configureMetaData ( conf , envLoader , cls , redefine ) ; } for ( Class < ? > cls : subs ) ManagedClassSubclasser . configureMetaData ( conf , envLoader , cls , redefine ) ; for ( Class < ? > cls : ints ) ManagedClassSubclasser . setIntercepting ( conf , envLoader , cls ) ; return subs ; } private static Set < Class < ? > > collectRelatedUnspecifiedTypes ( ClassMetaData meta , Collection < ? extends Class < ? > > classes , Set < Class < ? > > unspecified ) { } private static Set < Class < ? > > collectUnspecifiedType ( Class < ? > cls , Collection < ? extends Class < ? > > classes , Set < Class < ? > > unspecified ) { } private static void configureMetaData ( OpenJPAConfiguration conf , ClassLoader envLoader , Class < ? > cls , boolean redefineAvailable ) { } private static void configureMetaData ( ClassMetaData meta , OpenJPAConfiguration conf , boolean redefineAvailable , boolean warn ) { } private static void write ( BCClass bc , PCEnhancer enhancer , Map < Class < ? > , byte [ ] > map , Class < ? > cls , List < Class < ? > > subs , List < Class < ? > > ints ) throws IOException { }

Fix:
log . warn ( ManagedClassSubclasser . _loc . get ( "enhance-and-subclass-no-redef-start" , classes ) ) ;