Program: 130510
Project: 130510
Buggy source:
private LookupElement buildLookupElement(PsiElement element){
  LookupElementBuilder builder=null;
  if (element instanceof CSharpMethodDeclaration) {
    final CSharpMethodDeclaration methodDeclaration=(CSharpMethodDeclaration)element;
    final DotNetTypeRef[] parameterTypes=methodDeclaration.getParameterTypeRefs();
    String parameterText="String_Node_Str" + StringUtil.join(parameterTypes,new Function<DotNetTypeRef,String>(){
      @Override public String fun(      DotNetTypeRef parameter){
        return parameter.getPresentableText();
      }
    }
,"String_Node_Str") + "String_Node_Str";
    builder=LookupElementBuilder.create(methodDeclaration);
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
    builder=builder.withTypeText(methodDeclaration.getReturnTypeRef().getPresentableText());
    builder=builder.withTailText(parameterText,false);
    if (CSharpMethodImplUtil.isExtensionWrapper(methodDeclaration)) {
      builder=builder.withItemTextUnderlined(true);
    }
    if (!methodDeclaration.isDelegate()) {
      builder=builder.withInsertHandler(new InsertHandler<LookupElement>(){
        @Override public void handleInsert(        InsertionContext insertionContext,        LookupElement lookupElement){
          int offset=insertionContext.getEditor().getCaretModel().getOffset();
          PsiElement elementAt=insertionContext.getFile().findElementAt(offset);
          if (elementAt == null || elementAt.getNode().getElementType() != CSharpTokens.LPAR) {
            insertionContext.getDocument().insertString(offset,"String_Node_Str");
            int step=1;
            if (parameterTypes.length == 0) {
              step=3;
            }
            insertionContext.getEditor().getCaretModel().moveToOffset(offset + step);
            AutoPopupController.getInstance(insertionContext.getProject()).autoPopupParameterInfo(insertionContext.getEditor(),null);
          }
        }
      }
);
    }
  }
 else   if (element instanceof DotNetNamespaceAsElement) {
    DotNetNamespaceAsElement namespaceAsElement=(DotNetNamespaceAsElement)element;
    builder=LookupElementBuilder.create(namespaceAsElement.getName());
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
  }
 else   if (element instanceof CSharpTypeDefStatement) {
    CSharpTypeDefStatement typeDefStatement=(CSharpTypeDefStatement)element;
    builder=LookupElementBuilder.create(typeDefStatement.getName());
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
    builder=builder.withTypeText(typeDefStatement.toTypeRef().getPresentableText());
  }
 else   if (element instanceof DotNetVariable) {
    DotNetVariable dotNetVariable=(DotNetVariable)element;
    builder=LookupElementBuilder.create(dotNetVariable);
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
    builder=builder.withTypeText(dotNetVariable.toTypeRef(true).getPresentableText());
  }
 else   if (element instanceof CSharpMacroDefine) {
    builder=LookupElementBuilder.create((CSharpMacroDefine)element);
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
  }
 else   if (element instanceof CSharpTypeDeclaration) {
    CSharpTypeDeclaration typeDeclaration=(CSharpTypeDeclaration)element;
    builder=LookupElementBuilder.create(typeDeclaration);
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
    builder=builder.withTypeText(typeDeclaration.getPresentableParentQName());
    builder=builder.withTailText(DotNetElementPresentationUtil.formatGenericParameters(typeDeclaration),true);
  }
  if (builder != null) {
    if (DotNetAttributeUtil.hasAttribute(element,DotNetTypes.System.ObsoleteAttribute)) {
      builder=builder.withStrikeoutness(true);
      return PrioritizedLookupElement.withPriority(builder,-1.0);
    }
    return builder;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + element.getClass().getSimpleName() + "String_Node_Str");
  }
}

Fixed version (ground truth):
private LookupElement buildLookupElement(PsiElement element){
  LookupElementBuilder builder=null;
  if (element instanceof CSharpMethodDeclaration) {
    final CSharpMethodDeclaration methodDeclaration=(CSharpMethodDeclaration)element;
    final DotNetTypeRef[] parameterTypes=methodDeclaration.getParameterTypeRefs();
    String parameterText="String_Node_Str" + StringUtil.join(parameterTypes,new Function<DotNetTypeRef,String>(){
      @Override public String fun(      DotNetTypeRef parameter){
        return parameter.getPresentableText();
      }
    }
,"String_Node_Str") + "String_Node_Str";
    builder=LookupElementBuilder.create(methodDeclaration);
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
    builder=builder.withTypeText(methodDeclaration.getReturnTypeRef().getPresentableText());
    builder=builder.withTailText(parameterText,false);
    if (CSharpMethodImplUtil.isExtensionWrapper(methodDeclaration)) {
      builder=builder.withItemTextUnderlined(true);
    }
    if (!methodDeclaration.isDelegate()) {
      builder=builder.withInsertHandler(new InsertHandler<LookupElement>(){
        @Override public void handleInsert(        InsertionContext insertionContext,        LookupElement lookupElement){
          int offset=insertionContext.getEditor().getCaretModel().getOffset();
          PsiElement elementAt=insertionContext.getFile().findElementAt(offset);
          if (elementAt == null || elementAt.getNode().getElementType() != CSharpTokens.LPAR) {
            insertionContext.getDocument().insertString(offset,"String_Node_Str");
            int step=1;
            if (parameterTypes.length == 0) {
              step=3;
            }
            insertionContext.getEditor().getCaretModel().moveToOffset(offset + step);
            AutoPopupController.getInstance(insertionContext.getProject()).autoPopupParameterInfo(insertionContext.getEditor(),null);
          }
        }
      }
);
    }
  }
 else   if (element instanceof DotNetNamespaceAsElement) {
    DotNetNamespaceAsElement namespaceAsElement=(DotNetNamespaceAsElement)element;
    builder=LookupElementBuilder.create(namespaceAsElement.getName());
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
  }
 else   if (element instanceof CSharpTypeDefStatement) {
    CSharpTypeDefStatement typeDefStatement=(CSharpTypeDefStatement)element;
    builder=LookupElementBuilder.create(typeDefStatement.getName());
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
    builder=builder.withTypeText(typeDefStatement.toTypeRef().getPresentableText());
  }
 else   if (element instanceof DotNetGenericParameter) {
    DotNetGenericParameter typeDefStatement=(DotNetGenericParameter)element;
    builder=LookupElementBuilder.create(typeDefStatement.getName());
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
  }
 else   if (element instanceof DotNetVariable) {
    DotNetVariable dotNetVariable=(DotNetVariable)element;
    builder=LookupElementBuilder.create(dotNetVariable);
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
    builder=builder.withTypeText(dotNetVariable.toTypeRef(true).getPresentableText());
  }
 else   if (element instanceof CSharpMacroDefine) {
    builder=LookupElementBuilder.create((CSharpMacroDefine)element);
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
  }
 else   if (element instanceof CSharpTypeDeclaration) {
    CSharpTypeDeclaration typeDeclaration=(CSharpTypeDeclaration)element;
    builder=LookupElementBuilder.create(typeDeclaration);
    builder=builder.withIcon(IconDescriptorUpdaters.getIcon(element,Iconable.ICON_FLAG_VISIBILITY));
    builder=builder.withTypeText(typeDeclaration.getPresentableParentQName());
    builder=builder.withTailText(DotNetElementPresentationUtil.formatGenericParameters(typeDeclaration),true);
  }
  if (builder != null) {
    if (DotNetAttributeUtil.hasAttribute(element,DotNetTypes.System.ObsoleteAttribute)) {
      builder=builder.withStrikeoutness(true);
      return PrioritizedLookupElement.withPriority(builder,-1.0);
    }
    return builder;
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + element.getClass().getSimpleName() + "String_Node_Str");
  }
}