Buggy code:
public PCEnhancer ( OpenJPAConfiguration conf , BCClass type , ClassMetaData meta ) { } public BCClass getBytecode ( ) { } public Collection getObjectIdBytecode ( ) { } public ClassMetaData getMetaData ( ) { } public boolean getAddDefaultConstructor ( ) { } public void setAddDefaultConstructor ( boolean addDefaultConstructor ) { } public boolean getEnforcePropertyRestrictions ( ) { } public void setEnforcePropertyRestrictions ( boolean fail ) { } public File getDirectory ( ) { } public void setDirectory ( File dir ) { } public BytecodeWriter getBytecodeWriter ( ) { } 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 ( ) { _pc . declareInterface ( PCEnhancer . PCTYPE ) ; BCMethod method = _pc . getDeclaredMethod ( "<init>" , ( ( String [ ] ) ( null ) ) ) ; if ( method == null ) { Class type = _pc . getType ( ) ; if ( ! ( _defCons ) ) throw new UserException ( PCEnhancer . _loc . get ( "enhance-defaultconst" , type ) ) ; method = _pc . addDefaultConstructor ( ) ; String access ; if ( _meta . isDetachable ( ) ) { method . makePublic ( ) ; access = "public" ; } else if ( _pc . isFinal ( ) ) { method . makePrivate ( ) ; access = "private" ; } else { method . makeProtected ( ) ; access = "protected" ; } <START_BUG> if ( _log . isWarnEnabled ( ) ) <END_BUG> _log . warn ( PCEnhancer . _loc . get ( "enhance-adddefaultconst" , type , access ) ) ; } } 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 ( ) { } 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 { }

Fix:
if ( ( ! ( _meta . getDescribedType ( ) . isInterface ( ) ) ) && ( _log . isWarnEnabled ( ) ) )