Buggy code:
public class Clinit extends AbstractMethodDeclaration { private FieldBinding assertionSyntheticFieldBinding = null ; private FieldBinding classLiteralSyntheticField = null ; public Clinit ( CompilationResult compilationResult ) { } public void analyseCode ( ClassScope classScope , InitializationFlowContext staticInitializerFlowContext , FlowInfo flowInfo ) { } public void generateCode ( ClassScope classScope , ClassFile classFile ) { } private void generateCode ( ClassScope classScope , ClassFile classFile , int clinitOffset ) { ConstantPool constantPool = classFile . constantPool ; int constantPoolOffset = constantPool . currentOffset ; int constantPoolIndex = constantPool . currentIndex ; classFile . generateMethodInfoHeaderForClinit ( ) ; int codeAttributeOffset = classFile . contentsOffset ; classFile . generateCodeAttributeHeader ( ) ; CodeStream codeStream = classFile . codeStream ; this . resolve ( classScope ) ; codeStream . reset ( this , classFile ) ; TypeDeclaration declaringType = classScope . referenceContext ; MethodScope staticInitializerScope = declaringType . staticInitializerScope ; staticInitializerScope . computeLocalVariablePositions ( 0 , codeStream ) ; if ( ( this . assertionSyntheticFieldBinding ) != null ) { codeStream . generateClassLiteralAccessForType ( classScope . enclosingSourceType ( ) , classLiteralSyntheticField ) ; codeStream . invokeJavaLangClassDesiredAssertionStatus ( ) ; Label falseLabel = new Label ( codeStream ) ; codeStream . ifne ( falseLabel ) ; codeStream . iconst_1 ( ) ; Label jumpLabel = new Label ( codeStream ) ; codeStream . goto_ ( jumpLabel ) ; falseLabel . place ( ) ; codeStream . iconst_0 ( ) ; jumpLabel . place ( ) ; codeStream . putstatic ( this . assertionSyntheticFieldBinding ) ; } final FieldDeclaration [ ] fieldDeclarations = declaringType . fields ; <START_BUG> if ( ( declaringType . getKind ( ) ) == ( ENUM ) ) { <END_BUG> int enumCount = 0 ; int notEnumConstants = 0 ; if ( fieldDeclarations != null ) { for ( int i = 0 , max = fieldDeclarations . length ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . isStatic ( ) ) { if ( ( fieldDecl . getKind ( ) ) == ( AbstractVariableDeclaration . ENUM_CONSTANT ) ) { fieldDecl . generateCode ( staticInitializerScope , codeStream ) ; enumCount ++ ; } else { notEnumConstants ++ ; } } } } if ( enumCount > 0 ) { if ( fieldDeclarations != null ) { codeStream . generateInlinedValue ( enumCount ) ; codeStream . anewarray ( declaringType . binding ) ; for ( int i = 0 , max = fieldDeclarations . length ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( ( fieldDecl . getKind ( ) ) == ( AbstractVariableDeclaration . ENUM_CONSTANT ) ) { codeStream . dup ( ) ; codeStream . generateInlinedValue ( fieldDecl . binding . id ) ; codeStream . getstatic ( fieldDecl . binding ) ; codeStream . aastore ( ) ; } } codeStream . putstatic ( declaringType . enumValuesSyntheticfield ) ; } } if ( notEnumConstants != 0 ) { for ( int i = 0 , max = fieldDeclarations . length ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( ( fieldDecl . isStatic ( ) ) && ( ( fieldDecl . getKind ( ) ) != ( AbstractVariableDeclaration . ENUM_CONSTANT ) ) ) { fieldDecl . generateCode ( staticInitializerScope , codeStream ) ; } } } } else { if ( fieldDeclarations != null ) { for ( int i = 0 , max = fieldDeclarations . length ; i < max ; i ++ ) { FieldDeclaration fieldDecl = fieldDeclarations [ i ] ; if ( fieldDecl . isStatic ( ) ) { fieldDecl . generateCode ( staticInitializerScope , codeStream ) ; } } } } if ( ( codeStream . position ) == 0 ) { classFile . contentsOffset = clinitOffset ; ( classFile . methodCount ) -- ; constantPool . resetForClinit ( constantPoolIndex , constantPoolOffset ) ; } else { if ( this . needFreeReturn ) { int oldPosition = codeStream . position ; codeStream . return_ ( ) ; codeStream . updateLocalVariablesAttribute ( oldPosition ) ; } codeStream . recordPositionsFrom ( 0 , declaringType . sourceStart ) ; classFile . completeCodeAttributeForClinit ( codeAttributeOffset ) ; } } public boolean isClinit ( ) { } public boolean isInitializationMethod ( ) { } public boolean isStatic ( ) { } public void parseStatements ( Parser parser , CompilationUnitDeclaration unit ) { } public StringBuffer print ( int tab , StringBuffer output ) { } public void resolve ( ClassScope classScope ) { } public void traverse ( ASTVisitor visitor , ClassScope classScope ) { } public void setAssertionSupport ( FieldBinding assertionSyntheticFieldBinding , boolean needClassLiteralField ) { } }

Fix:
if ( ( declaringType . kind ( ) ) == ( ENUM ) ) {