nus-yam/ex-repair huggingface dataset:
Program: 130484
Project: 130484
Buggy source:
private static void parseCatchStatement(@NotNull CSharpBuilderWrapper builder,@Nullable PsiBuilder.Marker marker){
  PsiBuilder.Marker mark;
  if (marker != null) {
    builder.error("String_Node_Str");
    mark=marker;
  }
 else {
    mark=builder.mark();
  }
  builder.advanceLexer();
  if (builder.getTokenType() == LPAR) {
    builder.advanceLexer();
    PsiBuilder.Marker varMarker=builder.mark();
    if (parseType(builder) == null) {
      builder.error("String_Node_Str");
      varMarker.drop();
    }
 else {
      expect(builder,CSharpTokens.IDENTIFIER,null);
      varMarker.done(LOCAL_VARIABLE);
    }
    expect(builder,RPAR,"String_Node_Str");
  }
  builder.enableSoftKeyword(CSharpSoftTokens.WHEN_KEYWORD);
  IElementType tokenType=builder.getTokenType();
  builder.disableSoftKeyword(CSharpSoftTokens.WHEN_KEYWORD);
  if (tokenType == CSharpSoftTokens.WHEN_KEYWORD) {
    builder.advanceLexer();
    parseExpressionInParenth(builder);
  }
  if (builder.getTokenType() == LBRACE) {
    parseStatement(builder);
  }
 else {
    builder.error("String_Node_Str");
  }
  mark.done(CATCH_STATEMENT);
}

Fixed version (ground truth):
private static void parseCatchStatement(@NotNull CSharpBuilderWrapper builder,@Nullable PsiBuilder.Marker marker){
  PsiBuilder.Marker mark;
  if (marker != null) {
    builder.error("String_Node_Str");
    mark=marker;
  }
 else {
    mark=builder.mark();
  }
  builder.advanceLexer();
  if (builder.getTokenType() == LPAR) {
    builder.advanceLexer();
    PsiBuilder.Marker varMarker=builder.mark();
    if (parseType(builder) == null) {
      builder.error("String_Node_Str");
      varMarker.drop();
    }
 else {
      if (builder.getTokenType() == CSharpTokens.IDENTIFIER) {
        doneIdentifier(builder,0);
      }
      varMarker.done(LOCAL_VARIABLE);
    }
    expect(builder,RPAR,"String_Node_Str");
  }
  builder.enableSoftKeyword(CSharpSoftTokens.WHEN_KEYWORD);
  IElementType tokenType=builder.getTokenType();
  builder.disableSoftKeyword(CSharpSoftTokens.WHEN_KEYWORD);
  if (tokenType == CSharpSoftTokens.WHEN_KEYWORD) {
    builder.advanceLexer();
    parseExpressionInParenth(builder);
  }
  if (builder.getTokenType() == LBRACE) {
    parseStatement(builder);
  }
 else {
    builder.error("String_Node_Str");
  }
  mark.done(CATCH_STATEMENT);
}
Program: 130485
Project: 130485
Buggy source:
@Nullable @Override public PsiElement getNameIdentifier(){
  return findNotNullChildByClass(CSharpIdentifier.class);
}

Fixed version (ground truth):
@Nullable @Override public PsiElement getNameIdentifier(){
  return findChildByClass(CSharpIdentifier.class);
}
Program: 130486
Project: 130486
Buggy source:
public static boolean mayRenameInplace(PsiElement elementToRename,final PsiElement nameSuggestionContext){
  if (nameSuggestionContext != null && nameSuggestionContext.getContainingFile() != elementToRename.getContainingFile()) {
    return false;
  }
  if (elementToRename instanceof DotNetNamespaceAsElement) {
    return true;
  }
  if (!(elementToRename instanceof CSharpLocalVariable) && !(elementToRename instanceof DotNetParameter) && !(elementToRename instanceof CSharpLambdaParameter)) {
    return false;
  }
  SearchScope useScope=PsiSearchHelper.SERVICE.getInstance(elementToRename.getProject()).getUseScope(elementToRename);
  if (!(useScope instanceof LocalSearchScope)) {
    return false;
  }
  PsiElement[] scopeElements=((LocalSearchScope)useScope).getScope();
  if (scopeElements.length > 1) {
    return false;
  }
  PsiFile containingFile=elementToRename.getContainingFile();
  return PsiTreeUtil.isAncestor(containingFile,scopeElements[0],false);
}

Fixed version (ground truth):
@RequiredReadAction public static boolean mayRenameInplace(PsiElement elementToRename,final PsiElement nameSuggestionContext){
  if (nameSuggestionContext != null && nameSuggestionContext.getContainingFile() != elementToRename.getContainingFile()) {
    return false;
  }
  if (elementToRename instanceof DotNetNamespaceAsElement) {
    return true;
  }
  if (!(elementToRename instanceof CSharpLocalVariable) && !(elementToRename instanceof DotNetParameter) && !(elementToRename instanceof CSharpLambdaParameter)) {
    return false;
  }
  SearchScope useScope=PsiSearchHelper.SERVICE.getInstance(elementToRename.getProject()).getUseScope(elementToRename);
  if (!(useScope instanceof LocalSearchScope)) {
    return false;
  }
  PsiElement[] scopeElements=((LocalSearchScope)useScope).getScope();
  if (scopeElements.length > 1) {
    return false;
  }
  PsiFile containingFile=elementToRename.getContainingFile();
  return PsiTreeUtil.isAncestor(containingFile,scopeElements[0],false);
}
Program: 130487
Project: 130487
Buggy source:
@Override public boolean isMemberInplaceRenameAvailable(PsiElement element,PsiElement context){
  if (element instanceof DotNetParameter && element instanceof StubBasedPsiElement) {
    return true;
  }
  return element instanceof DotNetQualifiedElement && !(element instanceof DotNetNamespaceAsElement);
}

Fixed version (ground truth):
@Override @RequiredReadAction public boolean isMemberInplaceRenameAvailable(PsiElement element,PsiElement context){
  if (element instanceof DotNetParameter && element instanceof StubBasedPsiElement) {
    return true;
  }
  if (element instanceof CSharpTypeDeclaration && ((CSharpTypeDeclaration)element).hasModifier(CSharpModifier.PARTIAL)) {
    return false;
  }
  return element instanceof DotNetQualifiedElement && !(element instanceof DotNetNamespaceAsElement);
}
Program: 130488
Project: 130488
Buggy source:
@Override public boolean isInplaceRenameAvailable(PsiElement element,PsiElement context){
  return mayRenameInplace(element,context);
}

Fixed version (ground truth):
@Override @RequiredReadAction public boolean isInplaceRenameAvailable(PsiElement element,PsiElement context){
  return mayRenameInplace(element,context);
}
Program: 130489
Project: 130489
Buggy source:
@Override public void prepareRenaming(PsiElement element,String newName,Map<PsiElement,String> allRenames,SearchScope scope){
  CSharpResolveContext context=CSharpResolveContextUtil.createContext(DotNetGenericExtractor.EMPTY,element.getResolveScope(),element);
  CSharpElementGroup<CSharpConstructorDeclaration> constructors=context.constructorGroup();
  if (constructors != null) {
    for (    CSharpConstructorDeclaration declaration : constructors.getElements()) {
      allRenames.put(declaration,newName);
    }
  }
  constructors=context.deConstructorGroup();
  if (constructors != null) {
    for (    CSharpConstructorDeclaration declaration : constructors.getElements()) {
      allRenames.put(declaration,newName);
    }
  }
  if (element instanceof CSharpTypeDeclaration) {
    PsiFile containingFile=element.getContainingFile();
    if (containingFile instanceof CSharpFile) {
      DotNetNamedElement singleElement=CSharpPsiUtilImpl.findSingleElement((CSharpFile)containingFile);
      if (element.isEquivalentTo(singleElement)) {
        allRenames.put(containingFile,newName + "String_Node_Str" + containingFile.getFileType().getDefaultExtension());
      }
    }
  }
  if (context instanceof CSharpCompositeResolveContext) {
    for (    CSharpResolveContext resolveContext : ((CSharpCompositeResolveContext)context).getContexts()) {
      if (resolveContext instanceof CSharpTypeResolveContext) {
        allRenames.put(((CSharpTypeResolveContext)resolveContext).getElement(),newName);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void prepareRenaming(PsiElement element,String newName,Map<PsiElement,String> allRenames,SearchScope scope){
  CSharpResolveContext context=CSharpResolveContextUtil.createContext(DotNetGenericExtractor.EMPTY,element.getResolveScope(),element);
  CSharpElementGroup<CSharpConstructorDeclaration> constructors=context.constructorGroup();
  if (constructors != null) {
    for (    CSharpConstructorDeclaration declaration : constructors.getElements()) {
      allRenames.put(declaration,newName);
    }
  }
  constructors=context.deConstructorGroup();
  if (constructors != null) {
    for (    CSharpConstructorDeclaration declaration : constructors.getElements()) {
      allRenames.put(declaration,newName);
    }
  }
  CSharpTypeDeclaration[] typesIfPartial=getTypesIfPartial(context);
  for (  CSharpTypeDeclaration typeDeclaration : typesIfPartial) {
    allRenames.put(typeDeclaration,newName);
    PsiFile containingFile=typeDeclaration.getContainingFile();
    if (containingFile instanceof CSharpFile) {
      DotNetNamedElement singleElement=CSharpPsiUtilImpl.findSingleElement((CSharpFile)containingFile);
      if (typeDeclaration.isEquivalentTo(singleElement)) {
        allRenames.put(containingFile,newName + "String_Node_Str" + containingFile.getFileType().getDefaultExtension());
      }
    }
  }
}
Program: 130490
Project: 130490
Buggy source:
public void visitNamespaceDeclaration(CSharpNamespaceDeclarationImpl declaration){
  visitElement(declaration);
}

Fixed version (ground truth):
public void visitNamespaceDeclaration(CSharpNamespaceDeclaration declaration){
  visitElement(declaration);
}
Program: 130491
Project: 130491
Buggy source:
@NotNull public static PsiElement wrap(PsiElement element,@Nullable PsiElement parent){
  if (element instanceof MsilClassEntry) {
    PsiElement cache=ourCache.get(element);
    if (cache != null) {
      return cache;
    }
    cache=wrapToDelegateMethod((DotNetTypeDeclaration)element,parent);
    if (cache == null) {
      cache=new MsilClassAsCSharpTypeDefinition(parent,(MsilClassEntry)element);
    }
    ourCache.put((MsilClassEntry)element,cache);
    return cache;
  }
  return element;
}

Fixed version (ground truth):
@NotNull public static PsiElement wrap(PsiElement element,@Nullable PsiElement parent){
  if (element instanceof MsilClassEntry) {
    PsiElement cache=ourCache.get(element);
    if (cache != null) {
      return cache;
    }
    if (parent == null) {
      String parentQName=((MsilClassEntry)element).getPresentableParentQName();
      if (!StringUtil.isEmpty(parentQName)) {
        parent=new CSharpLightNamespaceDeclarationBuilder(element.getProject(),parentQName);
      }
    }
    cache=wrapToDelegateMethod((DotNetTypeDeclaration)element,parent);
    if (cache == null) {
      cache=new MsilClassAsCSharpTypeDefinition(parent,(MsilClassEntry)element);
    }
    ourCache.put((MsilClassEntry)element,cache);
    return cache;
  }
  return element;
}
Program: 130492
Project: 130492
Buggy source:
public T addGenericParameter(DotNetGenericParameter genericParameter){
  if (myGenericParameters.isEmpty()) {
    myGenericParameters=new ArrayList<DotNetGenericParameter>(2);
  }
  myGenericParameters.add(genericParameter);
  return (T)this;
}

Fixed version (ground truth):
public T addGenericParameter(DotNetGenericParameter genericParameter){
  if (myGenericParameters.isEmpty()) {
    myGenericParameters=new ArrayList<DotNetGenericParameter>(2);
  }
  if (genericParameter instanceof CSharpLightGenericParameterBuilder) {
    ((CSharpLightGenericParameterBuilder)genericParameter).setIndex(myGenericParameters.size());
  }
  myGenericParameters.add(genericParameter);
  return (T)this;
}
Program: 130493
Project: 130493
Buggy source:
@NotNull public CSharpLightTypeDeclarationBuilder addGenericParameter(DotNetGenericParameter parameter){
  myGenericParameters.add(parameter);
  return this;
}

Fixed version (ground truth):
@NotNull public CSharpLightTypeDeclarationBuilder addGenericParameter(DotNetGenericParameter genericParameter){
  if (genericParameter instanceof CSharpLightGenericParameterBuilder) {
    ((CSharpLightGenericParameterBuilder)genericParameter).setIndex(myGenericParameters.size());
  }
  myGenericParameters.add(genericParameter);
  return this;
}
Program: 130495
Project: 130495
Buggy source:
public static boolean isEqualWithVirtualImpl(@NotNull PsiElement element,@NotNull PsiElement element2,@NotNull PsiElement scope){
  return isEqual(element,element2,true,scope);
}

Fixed version (ground truth):
public static boolean isEqualWithVirtualImpl(@NotNull PsiElement element,@NotNull PsiElement element2,@NotNull PsiElement scope){
  return isEqual(element,element2,CHECK_VIRTUAL_IMPL_TYPE,scope);
}
Program: 130496
Project: 130496
Buggy source:
private static boolean compareVirtualImpl(@NotNull PsiElement o1,@NotNull PsiElement o2,@NotNull PsiElement scope){
  DotNetType type1=((DotNetVirtualImplementOwner)o1).getTypeForImplement();
  DotNetType type2=((DotNetVirtualImplementOwner)o2).getTypeForImplement();
  if (type1 == null && type2 == null) {
    return true;
  }
  if (type1 == null || type2 == null) {
    return false;
  }
  return CSharpTypeUtil.isTypeEqual(type1.toTypeRef(),type2.toTypeRef(),scope);
}

Fixed version (ground truth):
private static boolean compareVirtualImpl(@NotNull PsiElement o1,@NotNull PsiElement o2,int flags,@NotNull PsiElement scope){
  if (!BitUtil.isSet(flags,CHECK_VIRTUAL_IMPL_TYPE)) {
    return true;
  }
  DotNetType type1=((DotNetVirtualImplementOwner)o1).getTypeForImplement();
  DotNetType type2=((DotNetVirtualImplementOwner)o2).getTypeForImplement();
  if (type1 == null && type2 == null) {
    return true;
  }
  if (type1 == null || type2 == null) {
    return false;
  }
  return CSharpTypeUtil.isTypeEqual(type1.toTypeRef(),type2.toTypeRef(),scope);
}
Program: 130498
Project: 130498
Buggy source:
@Override public boolean canMarkAsUnused(DotNetParameter parameter){
  DotNetLikeMethodDeclaration method=parameter.getMethod();
  if (method instanceof CSharpMethodDeclaration && ((CSharpMethodDeclaration)method).isDelegate()) {
    return false;
  }
  if (method.hasModifier(CSharpModifier.ABSTRACT) || method.hasModifier(CSharpModifier.OVERRIDE)) {
    return false;
  }
  return super.canMarkAsUnused(parameter);
}

Fixed version (ground truth):
@Override public boolean canMarkAsUnused(DotNetParameter parameter){
  if (parameter.getParent().getParent() instanceof CSharpAnonymMethodExpressionImpl) {
    return false;
  }
  DotNetLikeMethodDeclaration method=parameter.getMethod();
  if (method instanceof CSharpMethodDeclaration && ((CSharpMethodDeclaration)method).isDelegate()) {
    return false;
  }
  if (method.hasModifier(CSharpModifier.ABSTRACT) || method.hasModifier(CSharpModifier.OVERRIDE)) {
    return false;
  }
  return super.canMarkAsUnused(parameter);
}
Program: 130499
Project: 130499
Buggy source:
private static boolean canParseAsVariable(CSharpBuilderWrapper builder){
  PsiBuilder.Marker newMarker=builder.mark();
  try {
    TypeInfo typeInfo=parseType(builder,BracketFailPolicy.NOTHING,true);
    if (typeInfo == null) {
      return false;
    }
    IElementType tokenType=builder.getTokenType();
    if (tokenType == LPAR) {
      return false;
    }
    if (typeInfo.isParameterized) {
      return true;
    }
    if (tokenType == IDENTIFIER) {
      IElementType lookAhead=builder.lookAhead(1);
      if (lookAhead == SEMICOLON || lookAhead == EQ || lookAhead == COMMA) {
        return true;
      }
    }
    return false;
  }
  finally {
    newMarker.rollbackTo();
  }
}

Fixed version (ground truth):
private static boolean canParseAsVariable(CSharpBuilderWrapper builder){
  PsiBuilder.Marker newMarker=builder.mark();
  try {
    TypeInfo typeInfo=parseType(builder,BracketFailPolicy.RETURN_BEFORE,true);
    if (typeInfo == null) {
      return false;
    }
    IElementType tokenType=builder.getTokenType();
    if (tokenType == LPAR) {
      return false;
    }
    if (typeInfo.isParameterized) {
      return true;
    }
    if (tokenType == IDENTIFIER) {
      IElementType lookAhead=builder.lookAhead(1);
      if (lookAhead == SEMICOLON || lookAhead == EQ || lookAhead == COMMA) {
        return true;
      }
    }
    return false;
  }
  finally {
    newMarker.rollbackTo();
  }
}
Program: 130501
Project: 130501
Buggy source:
private static List<CSharpMethodDeclaration> findParentMethods(final CSharpTypeDeclaration owner,final CSharpMethodDeclaration target){
  final List<CSharpMethodDeclaration> parents=new SmartList<CSharpMethodDeclaration>();
  MemberResolveScopeProcessor processor=new MemberResolveScopeProcessor(owner.getResolveScope(),ResolveResult.EMPTY_ARRAY,new ExecuteTarget[]{ExecuteTarget.ELEMENT_GROUP});
  ResolveState state=ResolveState.initial();
  state=state.put(CSharpResolveUtil.SELECTOR,new MemberByNameSelector(target.getName()));
  CSharpResolveUtil.walkChildren(processor,owner,false,state);
  PsiElement[] psiElements=processor.toPsiElements();
  for (  PsiElement psiElement : psiElements) {
    CSharpElementGroup<?> elementGroup=(CSharpElementGroup<?>)psiElement;
    for (    PsiElement element : elementGroup.getElements()) {
      if (element instanceof CSharpMethodDeclaration) {
        if (element.getParent() == owner) {
          continue;
        }
        if (CS0102.checkMethod((CSharpMethodDeclaration)element,target,element)) {
          parents.add((CSharpMethodDeclaration)element);
        }
      }
    }
  }
  return parents;
}

Fixed version (ground truth):
private static List<CSharpMethodDeclaration> findParentMethods(final CSharpTypeDeclaration owner,final CSharpMethodDeclaration target){
  final List<CSharpMethodDeclaration> parents=new SmartList<CSharpMethodDeclaration>();
  MemberResolveScopeProcessor processor=new MemberResolveScopeProcessor(owner.getResolveScope(),ResolveResult.EMPTY_ARRAY,new ExecuteTarget[]{ExecuteTarget.ELEMENT_GROUP});
  ResolveState state=ResolveState.initial();
  state=state.put(CSharpResolveUtil.SELECTOR,new MemberByNameSelector(target.getName()));
  CSharpResolveUtil.walkChildren(processor,owner,false,true,state);
  PsiElement[] psiElements=processor.toPsiElements();
  for (  PsiElement psiElement : psiElements) {
    CSharpElementGroup<?> elementGroup=(CSharpElementGroup<?>)psiElement;
    for (    PsiElement element : elementGroup.getElements()) {
      if (element instanceof CSharpMethodDeclaration) {
        if (element.getParent() == owner) {
          continue;
        }
        if (CS0102.checkMethod((CSharpMethodDeclaration)element,target,element)) {
          parents.add((CSharpMethodDeclaration)element);
        }
      }
    }
  }
  return parents;
}
Program: 130503
Project: 130503
Buggy source:
@Nullable public static DotNetPropertyDeclaration findPropertyByName(@NotNull final String name,@NotNull PsiElement owner,@NotNull DotNetGenericExtractor extractor){
  MemberResolveScopeProcessor memberResolveScopeProcessor=new MemberResolveScopeProcessor(owner.getResolveScope(),ResolveResult.EMPTY_ARRAY,new ExecuteTarget[]{ExecuteTarget.PROPERTY});
  ResolveState state=ResolveState.initial();
  state=state.put(CSharpResolveUtil.EXTRACTOR,extractor);
  state=state.put(CSharpResolveUtil.SELECTOR,new MemberByNameSelector(name));
  CSharpResolveUtil.walkChildren(memberResolveScopeProcessor,owner,false,state);
  PsiElement[] psiElements=memberResolveScopeProcessor.toPsiElements();
  return (DotNetPropertyDeclaration)ArrayUtil.getFirstElement(psiElements);
}

Fixed version (ground truth):
@Nullable public static DotNetPropertyDeclaration findPropertyByName(@NotNull final String name,@NotNull PsiElement owner,@NotNull DotNetGenericExtractor extractor){
  MemberResolveScopeProcessor memberResolveScopeProcessor=new MemberResolveScopeProcessor(owner.getResolveScope(),ResolveResult.EMPTY_ARRAY,new ExecuteTarget[]{ExecuteTarget.PROPERTY});
  ResolveState state=ResolveState.initial();
  state=state.put(CSharpResolveUtil.EXTRACTOR,extractor);
  state=state.put(CSharpResolveUtil.SELECTOR,new MemberByNameSelector(name));
  CSharpResolveUtil.walkChildren(memberResolveScopeProcessor,owner,false,true,state);
  PsiElement[] psiElements=memberResolveScopeProcessor.toPsiElements();
  return (DotNetPropertyDeclaration)ArrayUtil.getFirstElement(psiElements);
}
Program: 130504
Project: 130504
Buggy source:
@Nullable public static DotNetMethodDeclaration findMethodByName(@NotNull final String name,@NotNull PsiElement owner,@NotNull DotNetGenericExtractor extractor){
  MemberResolveScopeProcessor memberResolveScopeProcessor=new MemberResolveScopeProcessor(owner.getResolveScope(),ResolveResult.EMPTY_ARRAY,new ExecuteTarget[]{ExecuteTarget.ELEMENT_GROUP});
  ResolveState state=ResolveState.initial();
  state=state.put(CSharpResolveUtil.EXTRACTOR,extractor);
  state=state.put(CSharpResolveUtil.SELECTOR,new MemberByNameSelector(name));
  CSharpResolveUtil.walkChildren(memberResolveScopeProcessor,owner,false,state);
  PsiElement[] psiElements=memberResolveScopeProcessor.toPsiElements();
  for (  PsiElement psiElement : psiElements) {
    if (psiElement instanceof CSharpElementGroup) {
      for (      PsiElement element : ((CSharpElementGroup<?>)psiElement).getElements()) {
        if (element instanceof DotNetMethodDeclaration && ((DotNetMethodDeclaration)element).getParameters().length == 0) {
          return (DotNetMethodDeclaration)element;
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
@Nullable public static DotNetMethodDeclaration findMethodByName(@NotNull final String name,@NotNull PsiElement owner,@NotNull DotNetGenericExtractor extractor){
  MemberResolveScopeProcessor memberResolveScopeProcessor=new MemberResolveScopeProcessor(owner.getResolveScope(),ResolveResult.EMPTY_ARRAY,new ExecuteTarget[]{ExecuteTarget.ELEMENT_GROUP});
  ResolveState state=ResolveState.initial();
  state=state.put(CSharpResolveUtil.EXTRACTOR,extractor);
  state=state.put(CSharpResolveUtil.SELECTOR,new MemberByNameSelector(name));
  CSharpResolveUtil.walkChildren(memberResolveScopeProcessor,owner,false,true,state);
  PsiElement[] psiElements=memberResolveScopeProcessor.toPsiElements();
  for (  PsiElement psiElement : psiElements) {
    if (psiElement instanceof CSharpElementGroup) {
      for (      PsiElement element : ((CSharpElementGroup<?>)psiElement).getElements()) {
        if (element instanceof DotNetMethodDeclaration && ((DotNetMethodDeclaration)element).getParameters().length == 0) {
          return (DotNetMethodDeclaration)element;
        }
      }
    }
  }
  return null;
}
Program: 130505
Project: 130505
Buggy source:
private void highlightCall(@NotNull PsiElement callElement,@NotNull PsiElement referenceElement){
  ResolveResult[] resolveResults=ResolveResult.EMPTY_ARRAY;
  if (callElement instanceof PsiPolyVariantReference) {
    resolveResults=((PsiPolyVariantReference)callElement).multiResolve(false);
  }
  ResolveResult goodResult=resolveResults.length > 0 && resolveResults[0].isValidResult() ? resolveResults[0] : null;
  if (goodResult != null) {
    PsiElement element=goodResult.getElement();
    HighlightInfo highlightInfo=highlightNamed(element,referenceElement,callElement);
    if (highlightInfo != null && CSharpMethodImplUtil.isExtensionWrapper(element)) {
      QuickFixAction.registerQuickFixAction(highlightInfo,ConvertToNormalCallFix.INSTANCE);
    }
  }
 else {
    if (resolveResults.length == 0) {
      HighlightInfo info=HighlightInfo.newHighlightInfo(HighlightInfoType.WRONG_REF).descriptionAndTooltip("String_Node_Str" + referenceElement.getText() + "String_Node_Str").range(referenceElement).create();
      myHighlightInfoHolder.add(info);
      if (callElement instanceof PsiReference) {
        UnresolvedReferenceQuickFixProvider.registerReferenceFixes((PsiReference)callElement,new QuickFixActionRegistrarImpl(info));
      }
    }
 else {
      ResolveError forError=createResolveError(callElement,resolveResults[0].getElement());
      if (forError == null) {
        return;
      }
      myHighlightInfoHolder.add(forError.create());
    }
  }
}

Fixed version (ground truth):
private void highlightCall(@NotNull PsiElement callElement,@NotNull PsiElement referenceElement){
  ResolveResult[] resolveResults=ResolveResult.EMPTY_ARRAY;
  if (callElement instanceof PsiPolyVariantReference) {
    resolveResults=((PsiPolyVariantReference)callElement).multiResolve(false);
  }
  ResolveResult goodResult=CSharpResolveUtil.findFirstValidResult(resolveResults);
  if (goodResult != null) {
    PsiElement element=goodResult.getElement();
    HighlightInfo highlightInfo=highlightNamed(element,referenceElement,callElement);
    if (highlightInfo != null && CSharpMethodImplUtil.isExtensionWrapper(element)) {
      QuickFixAction.registerQuickFixAction(highlightInfo,ConvertToNormalCallFix.INSTANCE);
    }
  }
 else {
    if (resolveResults.length == 0) {
      HighlightInfo info=HighlightInfo.newHighlightInfo(HighlightInfoType.WRONG_REF).descriptionAndTooltip("String_Node_Str" + referenceElement.getText() + "String_Node_Str").range(referenceElement).create();
      myHighlightInfoHolder.add(info);
      if (callElement instanceof PsiReference) {
        UnresolvedReferenceQuickFixProvider.registerReferenceFixes((PsiReference)callElement,new QuickFixActionRegistrarImpl(info));
      }
    }
 else {
      ResolveError forError=createResolveError(callElement,resolveResults[0].getElement());
      if (forError == null) {
        return;
      }
      myHighlightInfoHolder.add(forError.create());
    }
  }
}
Program: 130506
Project: 130506
Buggy source:
@Nullable @Override public PsiElement resolveToCallable(){
  ResolveResult[] resolveResults=multiResolve(false);
  if (resolveResults.length == 0) {
    return null;
  }
  ResolveResult resolveResult=resolveResults[0];
  if (!resolveResult.isValidResult()) {
    return null;
  }
  return resolveResult.getElement();
}

Fixed version (ground truth):
@Nullable @Override public PsiElement resolveToCallable(){
  ResolveResult[] resolveResults=multiResolve(false);
  if (resolveResults.length == 0) {
    return null;
  }
  return CSharpResolveUtil.findFirstValidElement(resolveResults);
}
Program: 130507
Project: 130507
Buggy source:
@NotNull public DotNetTypeRef toTypeRefWithoutCaching(ResolveToKind kind,boolean resolveFromParent){
  ResolveResult[] resolveResults=multiResolveImpl(kind,resolveFromParent);
  if (resolveResults.length == 0) {
    return DotNetTypeRef.ERROR_TYPE;
  }
  ResolveResult resolveResult=resolveResults[0];
  if (!resolveResult.isValidResult()) {
    return DotNetTypeRef.ERROR_TYPE;
  }
  return toTypeRef(resolveResult);
}

Fixed version (ground truth):
@NotNull public DotNetTypeRef toTypeRefWithoutCaching(ResolveToKind kind,boolean resolveFromParent){
  ResolveResult[] resolveResults=multiResolveImpl(kind,resolveFromParent);
  if (resolveResults.length == 0) {
    return DotNetTypeRef.ERROR_TYPE;
  }
  ResolveResult firstValidResult=CSharpResolveUtil.findFirstValidResult(resolveResults);
  if (firstValidResult == null) {
    return DotNetTypeRef.ERROR_TYPE;
  }
  return toTypeRef(firstValidResult);
}
Program: 130508
Project: 130508
Buggy source:
@Nullable @Override public PsiElement resolve(){
  ResolveResult[] resolveResults=multiResolve(false);
  if (resolveResults.length == 0) {
    return null;
  }
  ResolveResult resolveResult=resolveResults[0];
  if (!resolveResult.isValidResult()) {
    return null;
  }
  return resolveResult.getElement();
}

Fixed version (ground truth):
@Nullable @Override public PsiElement resolve(){
  return CSharpResolveUtil.findFirstValidElement(multiResolve(false));
}
Program: 130509
Project: 130509
Buggy source:
private static CSharpLightMethodDeclaration transform(CSharpMethodDeclaration methodDeclaration){
}

Fixed version (ground truth):
private static CSharpLightMethodDeclaration transform(final CSharpMethodDeclaration methodDeclaration){
}
Program: 130511
Project: 130511
Buggy source:
private static AbstractScopeProcessor createMemberProcessor(@NotNull PsiElement element,ResolveToKind kind,ResolveResult[] elements,boolean completion){
  ExecuteTarget[] targets;
switch (kind) {
case TYPE_LIKE:
    targets=new ExecuteTarget[]{ExecuteTarget.GENERIC_PARAMETER,ExecuteTarget.TYPE,ExecuteTarget.DELEGATE_METHOD,ExecuteTarget.TYPE_DEF};
  break;
case NAMESPACE:
targets=new ExecuteTarget[]{ExecuteTarget.NAMESPACE};
break;
case FIELD_OR_PROPERTY:
targets=new ExecuteTarget[]{ExecuteTarget.FIELD,ExecuteTarget.PROPERTY};
break;
case ARRAY_METHOD:
targets=new ExecuteTarget[]{ExecuteTarget.ELEMENT_GROUP};
break;
case METHOD:
targets=new ExecuteTarget[]{ExecuteTarget.ELEMENT_GROUP,ExecuteTarget.FIELD,ExecuteTarget.PROPERTY,ExecuteTarget.EVENT,ExecuteTarget.LOCAL_VARIABLE_OR_PARAMETER};
break;
default :
targets=new ExecuteTarget[]{ExecuteTarget.MEMBER,ExecuteTarget.TYPE_DEF,ExecuteTarget.ELEMENT_GROUP};
break;
}
return completion ? new CompletionResolveScopeProcessor(element.getResolveScope(),elements,targets) : new MemberResolveScopeProcessor(element.getResolveScope(),elements,targets);
}

Fixed version (ground truth):
private static AbstractScopeProcessor createMemberProcessor(@NotNull PsiElement element,ResolveToKind kind,ResolveResult[] elements,boolean completion){
  ExecuteTarget[] targets;
switch (kind) {
case TYPE_LIKE:
    targets=new ExecuteTarget[]{ExecuteTarget.GENERIC_PARAMETER,ExecuteTarget.TYPE,ExecuteTarget.DELEGATE_METHOD,ExecuteTarget.TYPE_DEF};
  break;
case NAMESPACE:
targets=new ExecuteTarget[]{ExecuteTarget.NAMESPACE};
break;
case FIELD_OR_PROPERTY:
targets=new ExecuteTarget[]{ExecuteTarget.FIELD,ExecuteTarget.PROPERTY};
break;
case ARRAY_METHOD:
targets=new ExecuteTarget[]{ExecuteTarget.ELEMENT_GROUP};
break;
case METHOD:
targets=new ExecuteTarget[]{ExecuteTarget.ELEMENT_GROUP,ExecuteTarget.FIELD,ExecuteTarget.PROPERTY,ExecuteTarget.EVENT,ExecuteTarget.LOCAL_VARIABLE_OR_PARAMETER};
break;
default :
targets=new ExecuteTarget[]{ExecuteTarget.MEMBER,ExecuteTarget.TYPE_DEF,ExecuteTarget.ELEMENT_GROUP};
if (completion) {
targets=ArrayUtil.append(targets,ExecuteTarget.GENERIC_PARAMETER);
}
break;
}
return completion ? new CompletionResolveScopeProcessor(element.getResolveScope(),elements,targets) : new MemberResolveScopeProcessor(element.getResolveScope(),elements,targets);
}
Program: 130512
Project: 130512
Buggy source:
@NotNull @Override public DotNetNamespaceAsElement[] getUsingNamespaces(){
  CSharpUsingNamespaceStatementImpl[] usingDirectives=getUsingDirectives();
  List<DotNetNamespaceAsElement> namespaceAsElements=new ArrayList<DotNetNamespaceAsElement>(usingDirectives.length + 1);
  for (  CSharpUsingNamespaceStatementImpl usingDirective : usingDirectives) {
    DotNetNamespaceAsElement resolve=usingDirective.resolve();
    if (resolve != null) {
      namespaceAsElements.add(resolve);
    }
  }
  PsiElement parent=getParent();
  if (parent instanceof CSharpFile) {
    namespaceAsElements.add(DotNetPsiSearcher.getInstance(getProject()).findNamespace("String_Node_Str",getResolveScope()));
  }
  return ContainerUtil.toArray(namespaceAsElements,DotNetNamespaceAsElement.ARRAY_FACTORY);
}

Fixed version (ground truth):
@NotNull @Override public DotNetNamespaceAsElement[] getUsingNamespaces(){
  CSharpUsingNamespaceStatementImpl[] usingDirectives=getUsingDirectives();
  List<DotNetNamespaceAsElement> namespaceAsElements=new ArrayList<DotNetNamespaceAsElement>(usingDirectives.length + 1);
  for (  CSharpUsingNamespaceStatementImpl usingDirective : usingDirectives) {
    DotNetNamespaceAsElement resolve=usingDirective.resolve();
    if (resolve != null) {
      namespaceAsElements.add(resolve);
    }
  }
  return ContainerUtil.toArray(namespaceAsElements,DotNetNamespaceAsElement.ARRAY_FACTORY);
}
Program: 130513
Project: 130513
Buggy source:
public static boolean walkUsing(@NotNull final PsiScopeProcessor processor,@NotNull final PsiElement entrance,@NotNull final PsiElement sender,@Nullable PsiElement maxScope,@NotNull final ResolveState state){
  if (!entrance.isValid()) {
    CSharpResolveUtil.LOGGER.error(new PsiInvalidElementAccessException(entrance));
  }
  PsiElement prevParent=entrance;
  PsiElement scope=entrance;
  if (maxScope == null) {
    maxScope=sender.getContainingFile();
  }
  while (scope != null) {
    ProgressIndicatorProvider.checkCanceled();
    if (scope instanceof CSharpUsingListOwner) {
      CSharpUsingList usingList=((CSharpUsingListOwner)scope).getUsingList();
      if (usingList != null) {
        if (!processor.execute(usingList,state)) {
          return false;
        }
      }
    }
    if (entrance != sender) {
      break;
    }
    if (scope == maxScope) {
      break;
    }
    prevParent=scope;
    scope=prevParent.getContext();
    if (scope != null && scope != prevParent.getParent() && !scope.isValid()) {
      break;
    }
  }
  return true;
}

Fixed version (ground truth):
public static boolean walkUsing(@NotNull final PsiScopeProcessor processor,@NotNull final PsiElement entrance,@NotNull final PsiElement sender,@Nullable PsiElement maxScope,@NotNull final ResolveState state){
}
Program: 130515
Project: 130515
Buggy source:
@Override public boolean hasExtensions(){
  for (  DotNetQualifiedElement qualifiedElement : getMembers()) {
    if (CSharpMethodImplUtil.isExtensionMethod(qualifiedElement)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean hasExtensions(){
  return CSharpTypeDeclarationImplUtil.hasExtensions(this);
}
Program: 130516
Project: 130516
Buggy source:
@Override public boolean hasExtensions(){
  return false;
}

Fixed version (ground truth):
@Override public boolean hasExtensions(){
  return CSharpTypeDeclarationImplUtil.hasExtensions(this);
}
Program: 130517
Project: 130517
Buggy source:
@Override public boolean hasExtensions(){
  CSharpTypeStub stub=getStub();
  if (stub != null) {
    return stub.hasExtensions();
  }
  for (  DotNetQualifiedElement qualifiedElement : getMembers()) {
    if (CSharpMethodImplUtil.isExtensionMethod(qualifiedElement)) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean hasExtensions(){
  CSharpTypeStub stub=getStub();
  if (stub != null) {
    return stub.hasExtensions();
  }
  return CSharpTypeDeclarationImplUtil.hasExtensions(this);
}
Program: 130518
Project: 130518
Buggy source:
public static void parseArrayAfterThis(CSharpBuilderWrapper builderWrapper,PsiBuilder.Marker marker){
  if (builderWrapper.getTokenType() == LBRACKET) {
    MethodParsing.parseParameterList(builderWrapper,RBRACKET);
    parseAccessors(builderWrapper,XXX_ACCESSOR,PROPERTY_ACCESSOR_START);
    marker.done(ARRAY_METHOD_DECLARATION);
  }
 else {
    builderWrapper.error("String_Node_Str");
  }
}

Fixed version (ground truth):
public static void parseArrayAfterThis(CSharpBuilderWrapper builderWrapper,PsiBuilder.Marker marker){
  if (builderWrapper.getTokenType() == LBRACKET) {
    MethodParsing.parseParameterList(builderWrapper,RBRACKET);
  }
 else {
    builderWrapper.error("String_Node_Str");
  }
  parseAccessors(builderWrapper,XXX_ACCESSOR,PROPERTY_ACCESSOR_START);
  marker.done(ARRAY_METHOD_DECLARATION);
}
Program: 130520
Project: 130520
Buggy source:
public MsilMethodAsCSharpMethodDeclaration(PsiElement parent,@Nullable MsilClassEntry msilClassEntry,@NotNull MsilMethodEntry methodEntry){
  super(parent,getAdditionModifiers(methodEntry),methodEntry);
  myDelegate=msilClassEntry;
}

Fixed version (ground truth):
public MsilMethodAsCSharpMethodDeclaration(PsiElement parent,@Nullable DotNetTypeDeclaration declaration,@NotNull MsilMethodEntry methodEntry){
  super(parent,getAdditionModifiers(methodEntry),methodEntry);
  myDelegate=declaration;
}
Program: 130522
Project: 130522
Buggy source:
@Nullable public static PsiElement wrap(PsiElement element){
}

Fixed version (ground truth):
@Nullable public static PsiElement wrap(PsiElement element){
  if (element instanceof MsilClassEntry) {
    PsiElement cache=ourCache.get(element);
    if (cache != null) {
      return cache;
    }
    cache=wrapToDelegateMethod((DotNetTypeDeclaration)element);
    if (cache == null) {
      cache=new MsilClassAsCSharpTypeDefinition(null,(MsilClassEntry)element);
    }
    ourCache.put((MsilClassEntry)element,cache);
    return cache;
  }
  return element;
}
Program: 130523
Project: 130523
Buggy source:
public BaseCSharpModuleExtension(@NotNull String id,@NotNull ModifiableRootModel module){
  super(id,module);
  myLanguageVersionPointer=new CSharpLanguageVersionPointer(getProject(),id);
}

Fixed version (ground truth):
public BaseCSharpModuleExtension(@NotNull String id,@NotNull ModuleRootLayer module){
  super(id,module);
  myLanguageVersionPointer=new CSharpLanguageVersionPointer(getProject(),id);
}
Program: 130525
Project: 130525
Buggy source:
private boolean isDefined(String text){
  List<String> defs=redefined.get();
  if (defs == null) {
    defs=baseVariables;
  }
  return !defs.isEmpty() && MacroEvaluator.evaluate(text,defs);
}

Fixed version (ground truth):
private boolean isDefined(String text){
  List<String> defs=redefined.get();
  if (defs == null) {
    defs=baseVariables;
  }
  return MacroEvaluator.evaluate(text,defs);
}
Program: 130528
Project: 130528
Buggy source:
@NotNull @Override public DotNetTypeRef[] getExtendTypeRefs(){
  DotNetTypeRef[] extendTypeRefs=myMsilElement.getExtendTypeRefs();
  if (extendTypeRefs.length == 0) {
    return DotNetTypeRef.EMPTY_ARRAY;
  }
  DotNetTypeRef[] typeRefs=new DotNetTypeRef[extendTypeRefs.length];
  for (int i=0; i < typeRefs.length; i++) {
    typeRefs[i]=new MsilToCSharpTypeRef(extendTypeRefs[i]);
  }
  return typeRefs;
}

Fixed version (ground truth):
@NotNull @Override public DotNetTypeRef[] getExtendTypeRefs(){
  DotNetTypeRef[] extendTypeRefs=myMsilElement.getExtendTypeRefs();
  if (extendTypeRefs.length == 0) {
    return DotNetTypeRef.EMPTY_ARRAY;
  }
  DotNetTypeRef[] typeRefs=new DotNetTypeRef[extendTypeRefs.length];
  for (int i=0; i < typeRefs.length; i++) {
    typeRefs[i]=MsilToCSharpUtil.extractToCSharp(extendTypeRefs[i],myMsilElement);
  }
  return typeRefs;
}
Program: 130529
Project: 130529
Buggy source:
private static void processModifierList(StringBuilder builder,DotNetModifierListOwner owner){
  DotNetModifierList modifierList=owner.getModifierList();
  if (modifierList != null) {
    for (    DotNetModifier dotNetModifier : modifierList.getModifiers()) {
      builder.append(dotNetModifier.getPresentableText()).append("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private static void processModifierList(StringBuilder builder,DotNetModifierListOwner owner){
  DotNetModifierList modifierList=owner.getModifierList();
  if (modifierList != null) {
    for (    DotNetModifier dotNetModifier : modifierList.getModifiers()) {
      if (dotNetModifier == CSharpModifier.REF || dotNetModifier == CSharpModifier.OUT) {
        continue;
      }
      builder.append(dotNetModifier.getPresentableText()).append("String_Node_Str");
    }
  }
}
Program: 130530
Project: 130530
Buggy source:
private static void processParameterList(DotNetParameterListOwner declaration,StringBuilder builder,char p1,char p2){
  builder.append(p1);
  StubBlockUtil.join(builder,declaration.getParameters(),new PairFunction<StringBuilder,DotNetParameter,Void>(){
    @Nullable @Override public Void fun(    StringBuilder t,    DotNetParameter v){
      appendTypeRef(t,v.toTypeRef(false));
      t.append("String_Node_Str");
      t.append(v.getName());
      return null;
    }
  }
,"String_Node_Str");
  builder.append(p2);
}

Fixed version (ground truth):
private static void processParameterList(DotNetParameterListOwner declaration,StringBuilder builder,char p1,char p2){
  builder.append(p1);
  StubBlockUtil.join(builder,declaration.getParameters(),new PairFunction<StringBuilder,DotNetParameter,Void>(){
    @Nullable @Override public Void fun(    StringBuilder t,    DotNetParameter v){
      processModifierList(t,v);
      appendTypeRef(t,v.toTypeRef(false));
      t.append("String_Node_Str");
      t.append(v.getName());
      return null;
    }
  }
,"String_Node_Str");
  builder.append(p2);
}
Program: 130531
Project: 130531
Buggy source:
@Nullable @Override public Void fun(StringBuilder t,DotNetParameter v){
  appendTypeRef(t,v.toTypeRef(false));
  t.append("String_Node_Str");
  t.append(v.getName());
  return null;
}

Fixed version (ground truth):
@Nullable @Override public Void fun(StringBuilder t,DotNetParameter v){
  processModifierList(t,v);
  appendTypeRef(t,v.toTypeRef(false));
  t.append("String_Node_Str");
  t.append(v.getName());
  return null;
}
Program: 130533
Project: 130533
Buggy source:
private static boolean processTypeDeclaration(@NotNull final PsiScopeProcessor processor,DotNetTypeDeclaration typeDeclaration,ResolveState state,List<DotNetTypeRef> supers,DotNetGenericExtractor genericExtractor,Set<String> typeVisited){
  String vmName=DotNetVirtualMachineUtil.toVMQualifiedName(typeDeclaration);
  if (typeVisited.contains(vmName)) {
    return true;
  }
 else {
    typeVisited.add(vmName);
  }
  for (  DotNetNamedElement namedElement : typeDeclaration.getMembers()) {
    if (!checkConditionKey(processor,namedElement)) {
      continue;
    }
    if (namedElement instanceof DotNetVirtualImplementOwner && ((DotNetVirtualImplementOwner)namedElement).getTypeRefForImplement() != DotNetTypeRef.ERROR_TYPE) {
      continue;
    }
    DotNetNamedElement extracted=GenericUnwrapTool.extract(namedElement,genericExtractor);
    if (!processor.execute(extracted,state)) {
      return false;
    }
  }
  Collections.addAll(supers,typeDeclaration.getExtendTypeRefs());
  return true;
}

Fixed version (ground truth):
private static boolean processTypeDeclaration(@NotNull final PsiScopeProcessor processor,DotNetTypeDeclaration typeDeclaration,ResolveState state,List<DotNetTypeRef> supers,DotNetGenericExtractor genericExtractor,@Nullable Set<String> typeVisited){
  if (typeVisited != null) {
    String vmName=DotNetVirtualMachineUtil.toVMQualifiedName(typeDeclaration);
    if (typeVisited.contains(vmName)) {
      return true;
    }
 else {
      typeVisited.add(vmName);
    }
  }
  for (  DotNetNamedElement namedElement : typeDeclaration.getMembers()) {
    if (!checkConditionKey(processor,namedElement)) {
      continue;
    }
    if (namedElement instanceof DotNetVirtualImplementOwner && ((DotNetVirtualImplementOwner)namedElement).getTypeRefForImplement() != DotNetTypeRef.ERROR_TYPE) {
      continue;
    }
    DotNetNamedElement extracted=GenericUnwrapTool.extract(namedElement,genericExtractor);
    if (!processor.execute(extracted,state)) {
      return false;
    }
  }
  Collections.addAll(supers,typeDeclaration.getExtendTypeRefs());
  return true;
}
Program: 130534
Project: 130534
Buggy source:
@Override public void visitMethodDeclaration(CSharpMethodDeclaration declaration){
  StringBuilder builder=new StringBuilder();
  processModifierList(builder,declaration);
  if (declaration.isDelegate()) {
    builder.append("String_Node_Str");
  }
  builder.append(declaration.getReturnTypeRef().getQualifiedText());
  builder.append("String_Node_Str");
  if (declaration.isOperator()) {
    builder.append("String_Node_Str");
  }
  builder.append(declaration.getName());
  builder.append("String_Node_Str");
  StubBlockUtil.join(builder,declaration.getParameters(),new PairFunction<StringBuilder,DotNetParameter,Void>(){
    @Nullable @Override public Void fun(    StringBuilder t,    DotNetParameter v){
      processModifierList(t,v);
      t.append(v.toTypeRef(false).getQualifiedText());
      t.append("String_Node_Str");
      t.append(v.getName());
      return null;
    }
  }
,"String_Node_Str");
  builder.append("String_Node_Str");
  boolean canHaveBody=!declaration.hasModifier(CSharpModifier.ABSTRACT);
  if (canHaveBody) {
    builder.append("String_Node_Str");
  }
 else {
    builder.append("String_Node_Str");
  }
  myBlocks.add(new LineStubBlock(builder));
}

Fixed version (ground truth):
@Override public void visitMethodDeclaration(CSharpMethodDeclaration declaration){
  StringBuilder builder=new StringBuilder();
  processModifierList(builder,declaration);
  if (declaration.isDelegate()) {
    builder.append("String_Node_Str");
  }
  builder.append(declaration.getReturnTypeRef().getQualifiedText());
  builder.append("String_Node_Str");
  if (declaration.isOperator()) {
    builder.append("String_Node_Str");
  }
  builder.append(declaration.getName());
  builder.append("String_Node_Str");
  StubBlockUtil.join(builder,declaration.getParameters(),new PairFunction<StringBuilder,DotNetParameter,Void>(){
    @Nullable @Override public Void fun(    StringBuilder t,    DotNetParameter v){
      DotNetTypeRef typeRef=v.toTypeRef(false);
      t.append(typeRef.getQualifiedText());
      t.append("String_Node_Str");
      t.append(v.getName());
      return null;
    }
  }
,"String_Node_Str");
  builder.append("String_Node_Str");
  boolean canHaveBody=!declaration.hasModifier(CSharpModifier.ABSTRACT);
  if (canHaveBody) {
    builder.append("String_Node_Str");
  }
 else {
    builder.append("String_Node_Str");
  }
  myBlocks.add(new LineStubBlock(builder));
}
Program: 130535
Project: 130535
Buggy source:
@Nullable @Override public Void fun(StringBuilder t,DotNetParameter v){
  processModifierList(t,v);
  t.append(v.toTypeRef(false).getQualifiedText());
  t.append("String_Node_Str");
  t.append(v.getName());
  return null;
}

Fixed version (ground truth):
@Nullable @Override public Void fun(StringBuilder t,DotNetParameter v){
  DotNetTypeRef typeRef=v.toTypeRef(false);
  t.append(typeRef.getQualifiedText());
  t.append("String_Node_Str");
  t.append(v.getName());
  return null;
}
Program: 130536
Project: 130536
Buggy source:
@Nullable @Override public PsiElement resolve(){
  ResolveResult[] resolveResults=CSharpReferenceExpressionImpl.multiResolve0(CSharpReferenceExpressionImpl.ResolveToKind.ARRAY_METHOD,this,this);
  for (  ResolveResult resolveResult : resolveResults) {
    if (resolveResult.isValidResult()) {
      return resolveResult.getElement();
    }
  }
  return null;
}

Fixed version (ground truth):
@Nullable @Override public PsiElement resolve(){
  ResolveResultWithWeight[] resolveResults=CSharpReferenceExpressionImpl.multiResolve0(CSharpReferenceExpressionImpl.ResolveToKind.ARRAY_METHOD,this,this);
  for (  ResolveResultWithWeight resolveResult : resolveResults) {
    if (resolveResult.isGoodResult()) {
      return resolveResult.getElement();
    }
  }
  return null;
}