Program: 130494
Project: 130494
Buggy source:
private static boolean isEqual(@NotNull PsiElement element,@NotNull PsiElement element2,boolean checkVirtualImpl,@NotNull PsiElement scope){
  if (element == element2) {
    return true;
  }
  if (element instanceof CSharpPropertyDeclaration && element2 instanceof CSharpPropertyDeclaration) {
    if (checkVirtualImpl && !compareVirtualImpl(element,element2,scope)) {
      return false;
    }
    return Comparing.equal(((CSharpPropertyDeclaration)element).getName(),((CSharpPropertyDeclaration)element2).getName());
  }
  if (element instanceof CSharpEventDeclaration && element2 instanceof CSharpEventDeclaration) {
    if (checkVirtualImpl && !compareVirtualImpl(element,element2,scope)) {
      return false;
    }
    return Comparing.equal(((CSharpEventDeclaration)element).getName(),((CSharpEventDeclaration)element2).getName());
  }
  if (element instanceof CSharpFieldDeclaration && element2 instanceof CSharpFieldDeclaration) {
    return Comparing.equal(((CSharpFieldDeclaration)element).getName(),((CSharpFieldDeclaration)element2).getName());
  }
  if (element instanceof CSharpTypeDeclaration && element2 instanceof CSharpTypeDeclaration) {
    if (((CSharpTypeDeclaration)element).getGenericParametersCount() != ((CSharpTypeDeclaration)element2).getGenericParametersCount()) {
      return false;
    }
    return Comparing.equal(((CSharpTypeDeclaration)element).getName(),((CSharpTypeDeclaration)element2).getName());
  }
  if (element instanceof CSharpConstructorDeclaration && element2 instanceof CSharpConstructorDeclaration) {
    if (((CSharpConstructorDeclaration)element).hasModifier(DotNetModifier.STATIC) != ((CSharpConstructorDeclaration)element2).hasModifier(DotNetModifier.STATIC)) {
      return false;
    }
    if (((CSharpConstructorDeclaration)element).isDeConstructor() != ((CSharpConstructorDeclaration)element2).isDeConstructor()) {
      return false;
    }
    return compareParameterList(element,element2,scope);
  }
  if (element instanceof CSharpArrayMethodDeclaration && element2 instanceof CSharpArrayMethodDeclaration) {
    if (checkVirtualImpl && !compareVirtualImpl(element,element2,scope)) {
      return false;
    }
    return compareParameterList(element,element2,scope);
  }
  if (element instanceof CSharpConversionMethodDeclaration && element2 instanceof CSharpConversionMethodDeclaration) {
    if (!CSharpTypeUtil.isTypeEqual(((CSharpConversionMethodDeclaration)element).getConversionTypeRef(),((CSharpConversionMethodDeclaration)element2).getConversionTypeRef(),scope)) {
      return false;
    }
    return compareParameterList(element,element2,scope);
  }
  if (element instanceof CSharpMethodDeclaration && element2 instanceof CSharpMethodDeclaration) {
    if (((CSharpMethodDeclaration)element).getGenericParametersCount() != ((CSharpMethodDeclaration)element2).getGenericParametersCount()) {
      return false;
    }
    if (checkVirtualImpl && !compareVirtualImpl(element,element2,scope)) {
      return false;
    }
    if (!Comparing.equal(((CSharpMethodDeclaration)element).getName(),((CSharpMethodDeclaration)element2).getName())) {
      return false;
    }
    return compareParameterList(element,element2,scope);
  }
  return false;
}

Fixed version (ground truth):
public static boolean isEqual(@NotNull PsiElement element,@NotNull PsiElement element2,int flags,@NotNull PsiElement scope){
  if (element == element2) {
    return true;
  }
  if (element instanceof CSharpPropertyDeclaration && element2 instanceof CSharpPropertyDeclaration) {
    if (!Comparing.equal(((CSharpPropertyDeclaration)element).getName(),((CSharpPropertyDeclaration)element2).getName())) {
      return false;
    }
    if (!compareVirtualImpl(element,element2,flags,scope)) {
      return false;
    }
    if (BitUtil.isSet(flags,CHECK_RETURN_TYPE) && !CSharpTypeUtil.isTypeEqual(((CSharpPropertyDeclaration)element).toTypeRef(false),((CSharpPropertyDeclaration)element2).toTypeRef(false),scope)) {
      return false;
    }
    return true;
  }
  if (element instanceof CSharpEventDeclaration && element2 instanceof CSharpEventDeclaration) {
    if (!Comparing.equal(((CSharpEventDeclaration)element).getName(),((CSharpEventDeclaration)element2).getName())) {
      return false;
    }
    if (!compareVirtualImpl(element,element2,flags,scope)) {
      return false;
    }
    if (BitUtil.isSet(flags,CHECK_RETURN_TYPE) && !CSharpTypeUtil.isTypeEqual(((CSharpEventDeclaration)element).toTypeRef(false),((CSharpEventDeclaration)element2).toTypeRef(false),scope)) {
      return false;
    }
    return true;
  }
  if (element instanceof CSharpFieldDeclaration && element2 instanceof CSharpFieldDeclaration) {
    return Comparing.equal(((CSharpFieldDeclaration)element).getName(),((CSharpFieldDeclaration)element2).getName());
  }
  if (element instanceof CSharpTypeDeclaration && element2 instanceof CSharpTypeDeclaration) {
    if (((CSharpTypeDeclaration)element).getGenericParametersCount() != ((CSharpTypeDeclaration)element2).getGenericParametersCount()) {
      return false;
    }
    return Comparing.equal(((CSharpTypeDeclaration)element).getName(),((CSharpTypeDeclaration)element2).getName());
  }
  if (element instanceof CSharpConstructorDeclaration && element2 instanceof CSharpConstructorDeclaration) {
    if (((CSharpConstructorDeclaration)element).hasModifier(DotNetModifier.STATIC) != ((CSharpConstructorDeclaration)element2).hasModifier(DotNetModifier.STATIC)) {
      return false;
    }
    if (((CSharpConstructorDeclaration)element).isDeConstructor() != ((CSharpConstructorDeclaration)element2).isDeConstructor()) {
      return false;
    }
    return compareParameterList(element,element2,scope);
  }
  if (element instanceof CSharpArrayMethodDeclaration && element2 instanceof CSharpArrayMethodDeclaration) {
    if (!compareVirtualImpl(element,element2,flags,scope)) {
      return false;
    }
    if (!compareReturnTypeRef(element,element2,flags,scope)) {
      return false;
    }
    return compareParameterList(element,element2,scope);
  }
  if (element instanceof CSharpConversionMethodDeclaration && element2 instanceof CSharpConversionMethodDeclaration) {
    if (!CSharpTypeUtil.isTypeEqual(((CSharpConversionMethodDeclaration)element).getConversionTypeRef(),((CSharpConversionMethodDeclaration)element2).getConversionTypeRef(),scope)) {
      return false;
    }
    return compareParameterList(element,element2,scope);
  }
  if (element instanceof CSharpMethodDeclaration && element2 instanceof CSharpMethodDeclaration) {
    if (((CSharpMethodDeclaration)element).getGenericParametersCount() != ((CSharpMethodDeclaration)element2).getGenericParametersCount()) {
      return false;
    }
    if (!compareReturnTypeRef(element,element2,flags,scope)) {
      return false;
    }
    if (!compareVirtualImpl(element,element2,flags,scope)) {
      return false;
    }
    if (!Comparing.equal(((CSharpMethodDeclaration)element).getName(),((CSharpMethodDeclaration)element2).getName())) {
      return false;
    }
    return compareParameterList(element,element2,scope);
  }
  return false;
}