Program: 185454
Project: 185454
Buggy source:
@Override public IJavaCompletionProposal createJavaProposal(ContentAssistContext context,JavaContentAssistInvocationContext javaContext){
  int kind;
switch (context.location) {
case ANNOTATION_BODY:
    kind=CompletionProposal.ANNOTATION_ATTRIBUTE_REF;
  break;
case IMPORT:
kind=CompletionProposal.METHOD_NAME_REFERENCE;
break;
case EXPRESSION:
if (METHOD_POINTER_COMPLETION.matcher(context.fullCompletionExpression).matches()) {
kind=CompletionProposal.METHOD_NAME_REFERENCE;
break;
}
default :
kind=CompletionProposal.METHOD_REF;
}
GroovyCompletionProposal proposal=new GroovyCompletionProposal(kind,context.completionLocation);
if (context.location == ContentAssistLocation.METHOD_CONTEXT) {
MethodInfoContentAssistContext methodContext=(MethodInfoContentAssistContext)context;
if (!methodContext.methodName.equals(method.getName())) {
return null;
}
proposal.setCompletion(CharOperation.NO_CHAR);
proposal.setReplaceRange(context.completionLocation,context.completionLocation);
}
 else {
boolean parens=(kind == CompletionProposal.ANNOTATION_ATTRIBUTE_REF ? false : !isParens(context,javaContext));
proposal.setCompletion(completionName(parens));
proposal.setReplaceRange(context.completionLocation - context.completionExpression.length(),context.completionEnd);
}
proposal.setDeclarationSignature(createTypeSignature(method.getDeclaringClass()));
proposal.setName(method.getName().toCharArray());
if (method instanceof NamedArgsMethodNode) {
fillInExtraParameters((NamedArgsMethodNode)method,proposal);
}
 else {
proposal.setParameterNames(createAllParameterNames(context.unit));
proposal.setParameterTypeNames(getParameterTypeNames(method.getParameters()));
}
proposal.setFlags(getModifiers());
proposal.setAdditionalFlags(CompletionFlags.Default);
proposal.setSignature(createMethodSignature());
proposal.setKey(proposal.getSignature());
proposal.setRelevance(computeRelevance(context));
if (getRequiredStaticImport() != null) {
CompletionProposal importProposal;
if (new AssistOptions(javaContext.getProject().getOptions(true)).suggestStaticImport) {
importProposal=CompletionProposal.create(CompletionProposal.METHOD_IMPORT,context.completionLocation);
importProposal.setAdditionalFlags(CompletionFlags.StaticImport);
importProposal.setDeclarationSignature(proposal.getDeclarationSignature());
importProposal.setName(proposal.getName());
}
 else {
importProposal=CompletionProposal.create(CompletionProposal.TYPE_IMPORT,context.completionLocation);
importProposal.setSignature(proposal.getDeclarationSignature());
}
proposal.setRequiredProposals(new CompletionProposal[]{importProposal});
}
LazyJavaCompletionProposal lazyProposal=null;
if (kind == CompletionProposal.ANNOTATION_ATTRIBUTE_REF) {
proposal.setSignature(createTypeSignature(getMethod().getReturnType()));
proposal.setFlags(getModifiers() & 0xFFFDFFFF);
lazyProposal=new LazyJavaCompletionProposal(proposal,javaContext);
lazyProposal.setProposalInfo(new AnnotationAtttributeProposalInfo(javaContext.getProject(),proposal));
}
 else {
lazyProposal=new GroovyJavaMethodCompletionProposal(proposal,getProposalFormattingOptions(),javaContext,contributor);
}
return lazyProposal;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public IJavaCompletionProposal createJavaProposal(ContentAssistContext context,JavaContentAssistInvocationContext javaContext){
  int completionOffset=context.completionLocation, kind=CompletionProposal.METHOD_REF;
switch (context.location) {
case ANNOTATION_BODY:
    kind=CompletionProposal.ANNOTATION_ATTRIBUTE_REF;
  break;
case EXPRESSION:
if (METHOD_POINTER_COMPLETION.matcher(context.fullCompletionExpression).matches()) {
  kind=CompletionProposal.METHOD_NAME_REFERENCE;
}
break;
case IMPORT:
kind=CompletionProposal.METHOD_NAME_REFERENCE;
break;
case METHOD_CONTEXT:
MethodInfoContentAssistContext methodContext=(MethodInfoContentAssistContext)context;
if (!methodContext.methodName.equals(method.getName())) {
return null;
}
completionOffset=methodContext.methodNameEnd;
}
GroovyCompletionProposal proposal=new GroovyCompletionProposal(kind,completionOffset);
if (context.location == ContentAssistLocation.METHOD_CONTEXT) {
proposal.setCompletion(CharOperation.NO_CHAR);
proposal.setReplaceRange(context.completionLocation,context.completionLocation);
}
 else {
boolean parens=(kind == CompletionProposal.ANNOTATION_ATTRIBUTE_REF ? false : !isParens(context,javaContext));
proposal.setCompletion(completionName(parens));
proposal.setReplaceRange(context.completionLocation - context.completionExpression.length(),context.completionEnd);
}
proposal.setDeclarationSignature(createTypeSignature(method.getDeclaringClass()));
proposal.setName(method.getName().toCharArray());
if (method instanceof NamedArgsMethodNode) {
fillInExtraParameters((NamedArgsMethodNode)method,proposal);
}
 else {
proposal.setParameterNames(createAllParameterNames(context.unit));
proposal.setParameterTypeNames(getParameterTypeNames(method.getParameters()));
}
proposal.setFlags(getModifiers());
proposal.setAdditionalFlags(CompletionFlags.Default);
proposal.setSignature(createMethodSignature());
proposal.setKey(proposal.getSignature());
proposal.setRelevance(computeRelevance(context));
if (getRequiredStaticImport() != null) {
CompletionProposal importProposal;
if (new AssistOptions(javaContext.getProject().getOptions(true)).suggestStaticImport) {
importProposal=CompletionProposal.create(CompletionProposal.METHOD_IMPORT,context.completionLocation);
importProposal.setAdditionalFlags(CompletionFlags.StaticImport);
importProposal.setDeclarationSignature(proposal.getDeclarationSignature());
importProposal.setName(proposal.getName());
}
 else {
importProposal=CompletionProposal.create(CompletionProposal.TYPE_IMPORT,context.completionLocation);
importProposal.setSignature(proposal.getDeclarationSignature());
}
proposal.setRequiredProposals(new CompletionProposal[]{importProposal});
}
LazyJavaCompletionProposal lazyProposal=null;
if (kind == CompletionProposal.ANNOTATION_ATTRIBUTE_REF) {
proposal.setSignature(createTypeSignature(getMethod().getReturnType()));
proposal.setFlags(getModifiers() & 0xFFFDFFFF);
lazyProposal=new LazyJavaCompletionProposal(proposal,javaContext);
lazyProposal.setProposalInfo(new AnnotationAtttributeProposalInfo(javaContext.getProject(),proposal));
}
 else {
lazyProposal=new GroovyJavaMethodCompletionProposal(proposal,getProposalFormattingOptions(),javaContext,contributor);
}
return lazyProposal;
}