Buggy code:
private static final char [ ] SEMICOLON = new char [ ] { ';' } ; private static final char [ ] CLASS = "Class" . toCharArray ( ) ; private static final char [ ] VOID = "void" . toCharArray ( ) ; private static final char [ ] INT = "int" . toCharArray ( ) ; private static final char [ ] INT_SIGNATURE = new char [ ] { Signature . C_INT } ; private static final char [ ] VALUE = "value" . toCharArray ( ) ; private static final char [ ] EXTENDS = "extends" . toCharArray ( ) ; private static final char [ ] SUPER = "super" . toCharArray ( ) ; private static final int SUPERTYPE = 1 ; private static final int SUBTYPE = 2 ; private static final int FIELD = 0 ; private static final int LOCAL = 1 ; private static final int ARGUMENT = 2 ; int expectedTypesPtr = - 1 ; TypeBinding [ ] expectedTypes = new TypeBinding [ 1 ] ; int expectedTypesFilter ; int uninterestingBindingsPtr = - 1 ; Binding [ ] uninterestingBindings = new Binding [ 1 ] ; int forbbidenBindingsPtr = - 1 ; Binding [ ] forbbidenBindings = new Binding [ 1 ] ; boolean assistNodeIsClass ; boolean assistNodeIsEnum ; boolean assistNodeIsException ; boolean assistNodeIsInterface ; boolean assistNodeIsAnnotation ; boolean assistNodeIsConstructor ; int assistNodeInJavadoc = 0 ; IJavaProject javaProject ; CompletionParser parser ; CompletionRequestor requestor ; ProblemReporter problemReporter ; char [ ] source ; char [ ] completionToken ; char [ ] qualifiedCompletionToken ; boolean resolvingImports = false ; boolean resolvingStaticImports = false ; boolean insideQualifiedReference = false ; boolean noProposal = true ; CategorizedProblem problem = null ; char [ ] fileName = null ; int startPosition ; int actualCompletionPosition ; int endPosition ; int offset ; int javadocTagPosition ; HashtableOfObject knownPkgs = new HashtableOfObject ( 10 ) ; HashtableOfObject knownTypes = new HashtableOfObject ( 10 ) ; Scanner nameScanner ; static final BaseTypeBinding [ ] BASE_TYPES = new BaseTypeBinding [ ] { TypeBinding . BOOLEAN , TypeBinding . BYTE , TypeBinding . CHAR , TypeBinding . DOUBLE , TypeBinding . FLOAT , TypeBinding . INT , TypeBinding . LONG , TypeBinding . SHORT , TypeBinding . VOID } ; static final int BASE_TYPES_LENGTH = CompletionEngine . BASE_TYPES . length ; static final char [ ] [ ] BASE_TYPE_NAMES = new char [ CompletionEngine . BASE_TYPES_LENGTH ] [ ] ; static final char [ ] classField = "class" . toCharArray ( ) ; static final char [ ] lengthField = "length" . toCharArray ( ) ; static final char [ ] cloneMethod = "clone" . toCharArray ( ) ; static final char [ ] THIS = "this" . toCharArray ( ) ; static final char [ ] THROWS = "throws" . toCharArray ( ) ; static InvocationSite FakeInvocationSite = new InvocationSite ( ) { public TypeBinding [ ] genericTypeArguments ( ) { } public boolean isSuperAccess ( ) { } public boolean isTypeAccess ( ) { } public void setActualReceiverType ( ReferenceBinding receiverType ) { } public void setDepth ( int depth ) { } public void setFieldIndex ( int depth ) { } public int sourceStart ( ) { } public int sourceEnd ( ) { } } ; private class AcceptedType { public AcceptedType ( char [ ] packageName , char [ ] simpleTypeName , char [ ] [ ] enclosingTypeNames , int modifiers , int accessibility ) { } public char [ ] packageName ; public char [ ] simpleTypeName ; public char [ ] [ ] enclosingTypeNames ; public int modifiers ; public int accessibility ; public boolean mustBeQualified = false ; public char [ ] fullyQualifiedName = null ; public char [ ] qualifiedTypeName = null ; public String toString ( ) { } } private ObjectVector acceptedTypes ; public CompletionEngine ( SearchableEnvironment nameEnvironment , CompletionRequestor requestor , Map settings , IJavaProject javaProject ) { } public void acceptType ( char [ ] packageName , char [ ] simpleTypeName , char [ ] [ ] enclosingTypeNames , int modifiers , AccessRestriction accessRestriction ) { } private void acceptTypes ( ) { } private void proposeType ( char [ ] packageName , char [ ] simpleTypeName , int modifiers , int accessibility , char [ ] typeName , char [ ] fullyQualifiedName , boolean isQualified ) { } public void acceptPackage ( char [ ] packageName ) { } private void buildContext ( ASTNode astNode , ASTNode astNodeParent , Binding qualifiedBinding , Scope scope ) { } private boolean complete ( ASTNode astNode , ASTNode astNodeParent , Binding qualifiedBinding , Scope scope , boolean insideTypeAnnotation ) { } public void complete ( IType type , char [ ] snippet , int position , char [ ] [ ] localVariableTypeNames , char [ ] [ ] localVariableNames , int [ ] localVariableModifiers , boolean isStatic ) { } private Initializer parseSnippeInitializer ( char [ ] snippet , int position , char [ ] [ ] localVariableTypeNames , char [ ] [ ] localVariableNames , int [ ] localVariableModifiers , boolean isStatic ) { } public void complete ( ICompilationUnit sourceUnit , int completionPosition , int pos ) { } private TypeBinding [ ] computeTypes ( Expression [ ] arguments ) { } private void findAnnotationAttributes ( char [ ] token , MemberValuePair [ ] attributesFound , ReferenceBinding annotation ) { } private void findAnnotationReference ( TypeReference ref , Scope scope ) { } private void findAnonymousType ( ReferenceBinding currentType , TypeBinding [ ] argTypes , Scope scope , InvocationSite invocationSite ) { } private void findClassField ( char [ ] token , TypeBinding receiverType , Scope scope ) { } private void findEnumConstant ( char [ ] enumConstantName , SwitchStatement switchStatement ) { TypeBinding expressionType = switchStatement . expression . resolvedType ; if ( ( expressionType != null ) && ( expressionType . isEnum ( ) ) ) { ReferenceBinding enumType = ( ( ReferenceBinding ) ( expressionType ) ) ; CaseStatement [ ] cases = switchStatement . cases ; char [ ] [ ] alreadyUsedConstants = new char [ switchStatement . caseCount ] [ ] ; int alreadyUsedConstantCount = 0 ; for ( int i = 0 ; i < ( switchStatement . caseCount ) ; i ++ ) { <START_BUG> if ( cases [ i ] . isEnumConstant ) { <END_BUG> alreadyUsedConstants [ ( alreadyUsedConstantCount ++ ) ] = ( ( SingleNameReference ) ( cases [ i ] . constantExpression ) ) . token ; } }

Fix:
if ( ( cases [ i ] . isEnumConstant ) && ( ( cases [ i ] . constantExpression ) instanceof SingleNameReference ) ) {