Buggy code:
public void setBytecodeWriter ( BytecodeWriter writer ) { } public int run ( ) { } public void record ( ) throws IOException { } private void record ( BCClass bc ) throws IOException { } private void validateProperties ( ) { } private static String getSetterName ( FieldMetaData fmd ) { } static BCField getReturnedField ( BCMethod meth ) { } static BCField getAssignedField ( BCMethod meth ) { } private static BCField findField ( BCMethod meth , Instruction template , boolean findAccessed ) { } private void addViolation ( String key , Object [ ] args , boolean fatal ) { } private void processViolations ( ) { } private void replaceAndValidateFieldAccess ( ) { } private void replaceAndValidateFieldAccess ( Code code , Instruction ins , boolean get , Instruction stat ) { } private boolean isBackingFieldOfAnotherProperty ( String name , Code code ) { } private ClassMetaData getPersistenceCapableOwner ( String fieldName , Class owner ) { } private void addPCMethods ( ) throws NoSuchMethodException { } private void addClearFieldsMethod ( ) throws NoSuchMethodException { } private void addNewInstanceMethod ( boolean oid ) { } private void addManagedFieldCountMethod ( ) { } private void addProvideFieldsMethods ( ) throws NoSuchMethodException { } private void addReplaceFieldsMethods ( ) throws NoSuchMethodException { } private void addCopyFieldsMethod ( ) throws NoSuchMethodException { } private int beginSwitchMethod ( String name , Code code ) { } private void addMultipleFieldsMethodVersion ( BCMethod single ) { } private void addStockMethods ( ) throws NoSuchMethodException { } private void translateFromStateManagerMethod ( Method m ) { } private void addGetVersionMethod ( ) throws NoSuchMethodException { } private Class unwrapVersionField ( FieldMetaData fmd ) { } private void addReplaceFlagsMethod ( ) { } private void addReplaceStateManagerMethod ( ) { } private void addNoOpApplicationIdentityMethods ( ) { } private void addCopyKeyFieldsToObjectIdMethod ( boolean fieldManager ) throws NoSuchMethodException { } private void addCopyKeyFieldsFromObjectIdMethod ( boolean fieldManager ) throws NoSuchMethodException { } private Boolean usesClassStringIdConstructor ( ) { } private Class unwrapSingleFieldIdentity ( FieldMetaData fmd ) { } private Method getFieldSupplierMethod ( Class type ) throws NoSuchMethodException { } private Method getFieldConsumerMethod ( Class type ) throws NoSuchMethodException { } private void addNewObjectIdInstanceMethod ( boolean obj ) throws NoSuchMethodException { } private Method getStateManagerMethod ( Class type , String prefix , boolean get , boolean curValue ) throws NoSuchMethodException { } private Method getMethod ( Class owner , Class type , String prefix , boolean get , boolean haspc , boolean curValue ) throws NoSuchMethodException { } private Instruction throwException ( Code code , Class type ) { } private void enhanceClass ( ) { } private void addFields ( ) { } private void addStaticInitializer ( ) { } private static byte getFieldFlag ( FieldMetaData fmd ) { } private void addSerializationCode ( ) { } private boolean externalizeDetached ( ) { } private void modifyWriteObjectMethod ( BCMethod method , boolean full ) { } private void modifyReadObjectMethod ( BCMethod method , boolean full ) { } private void addIsDetachedMethod ( ) throws NoSuchMethodException { } private void writeIsDetachedMethod ( Code code ) throws NoSuchMethodException { } private static JumpInstruction ifDefaultValue ( Code code , FieldMetaData fmd ) { } private Code getOrCreateClassInitCode ( boolean replaceLast ) { } private void addCloningCode ( ) { } private boolean enhanceObjectId ( ) throws IOException { } private Field findDeclaredField ( Class cls , String name ) { } private Method findDeclaredGetterMethod ( Class cls , String baseName ) { } private Method findDeclaredMethod ( Class cls , String name , Class [ ] params ) { } private void makeObjectIdFieldPublic ( Field field ) { } private void makeObjectIdMethodPublic ( Method meth ) { } private BCClass getObjectIdBytecode ( Class cls ) { } public PCEnhancer . AuxiliaryEnhancer [ ] getAuxiliaryEnhancers ( ) { if ( ( _auxEnhancers ) == null ) { try { <START_BUG> Class [ ] classes = Services . getImplementorClasses ( PCEnhancer . AuxiliaryEnhancer . class ) ; <END_BUG> _auxEnhancers = new PCEnhancer . AuxiliaryEnhancer [ classes . length ] ; for ( int i = 0 ; i < ( _auxEnhancers . length ) ; i ++ ) _auxEnhancers [ i ] = ( ( PCEnhancer . AuxiliaryEnhancer ) ( classes [ i ] . newInstance ( ) ) ) ; } catch ( Throwable t ) { throw new GeneralException ( t ) ; } } return _auxEnhancers ; } private void runAuxiliaryEnhancers ( ) { } private boolean skipEnhance ( BCMethod method ) { } private void addAccessors ( ) throws NoSuchMethodException { } private void addGetMethod ( int index , FieldMetaData fmd ) throws NoSuchMethodException { } private void addSetMethod ( int index , FieldMetaData fmd ) throws NoSuchMethodException { } private void addAttachDetachCode ( ) throws NoSuchMethodException { } private void addDetachedStateMethods ( boolean impl ) { } private void addDetachExternalize ( boolean parentDetachable , boolean detachedState ) throws NoSuchMethodException { } private void addReadExternal ( boolean parentDetachable , boolean detachedState ) throws NoSuchMethodException { } private void addReadUnmanaged ( Collection unmgd , boolean parentDetachable ) throws NoSuchMethodException { } private void readExternal ( Code code , String fieldName , Class type , FieldMetaData fmd ) throws NoSuchMethodException { } private void addWriteExternal ( boolean parentDetachable , boolean detachedState ) throws NoSuchMethodException { } private void addWriteUnmanaged ( Collection unmgd , boolean parentDetachable ) throws NoSuchMethodException { } private void writeExternal ( Code code , String fieldName , Class type , FieldMetaData fmd ) throws NoSuchMethodException { } private void addGetManagedValueCode ( Code code , FieldMetaData fmd ) throws NoSuchMethodException { } private void addSetManagedValueCode ( Code code , FieldMetaData fmd ) throws NoSuchMethodException { } private int getAccessorParameterOffset ( ) { } private Instruction loadManagedInstance ( Code code , boolean forAccessor ) { } private BCMethod createGetMethod ( FieldMetaData fmd ) { } private BCMethod createSetMethod ( FieldMetaData fmd ) { } private static void transferCodeAttributes ( BCMethod from , BCMethod to ) { }

Fix:
Class [ ] classes = Services . getImplementorClasses ( PCEnhancer . AuxiliaryEnhancer . class , getClass ( ) . getClassLoader ( ) ) ;