Program: 13050
Project: 13050
Buggy source:
public void collectAllReferences(XtextResource resource,ReferenceAcceptor acceptor){
  XtendFile xtendFile=getXtendFile(resource);
  TreeIterator<EObject> contents=EcoreUtil.getAllContents(xtendFile,true);
  while (contents.hasNext()) {
    EObject next=contents.next();
    if (next instanceof XtendTypeDeclaration) {
      Set<EObject> elements=associations.getJvmElements(next);
      if (!elements.isEmpty()) {
        EObject type=elements.iterator().next();
        if (type instanceof JvmDeclaredType) {
          acceptor.setThisType((JvmDeclaredType)type);
        }
      }
    }
 else     if (next instanceof JvmTypeReference) {
      acceptor.acceptType((JvmTypeReference)next);
    }
 else     if (next instanceof XAnnotation) {
      acceptor.acceptType(((XAnnotation)next).getAnnotationType());
    }
 else     if (next instanceof XInstanceOfExpression) {
      acceptor.acceptType(((XInstanceOfExpression)next).getType());
    }
 else     if (next instanceof XConstructorCall) {
      acceptor.acceptType(((XConstructorCall)next).getConstructor().getDeclaringType());
    }
 else     if (next instanceof XTypeLiteral) {
      acceptor.acceptType(((XTypeLiteral)next).getType());
    }
 else     if (next instanceof XFeatureCall) {
      final XFeatureCall featureCall=(XFeatureCall)next;
      if (featureCall.getDeclaringType() == null) {
        final JvmIdentifiableElement member=featureCall.getFeature();
        if (member instanceof JvmOperation) {
          JvmOperation operation=(JvmOperation)member;
          if (operation.isStatic()) {
            if (operation.getParameters().size() > featureCall.getExplicitArguments().size()) {
              acceptor.acceptStaticExtensionImport(operation);
            }
 else {
              acceptor.acceptStaticImport(operation);
            }
          }
        }
        if (member instanceof JvmField) {
          if (((JvmField)member).isStatic()) {
            acceptor.acceptStaticImport((JvmMember)member);
          }
        }
      }
 else {
        acceptor.acceptType(featureCall.getDeclaringType());
      }
    }
 else     if (next instanceof XMemberFeatureCall || next instanceof XBinaryOperation || next instanceof XUnaryOperation|| next instanceof XAssignment) {
      final XAbstractFeatureCall featureCall=(XAbstractFeatureCall)next;
      final JvmIdentifiableElement member=featureCall.getFeature();
      if (member instanceof JvmOperation) {
        if (((JvmOperation)member).isStatic())         acceptor.acceptStaticExtensionImport((JvmMember)member);
      }
      if (member instanceof JvmField) {
        if (((JvmField)member).isStatic())         acceptor.acceptStaticExtensionImport((JvmMember)member);
      }
    }
  }
}

Fixed version (ground truth):
public void collectAllReferences(XtextResource resource,ReferenceAcceptor acceptor){
  XtendFile xtendFile=getXtendFile(resource);
  TreeIterator<EObject> contents=EcoreUtil.getAllContents(xtendFile,true);
  while (contents.hasNext()) {
    EObject next=contents.next();
    if (next instanceof XtendTypeDeclaration) {
      Set<EObject> elements=associations.getJvmElements(next);
      if (!elements.isEmpty()) {
        EObject type=elements.iterator().next();
        if (type instanceof JvmDeclaredType) {
          acceptor.setThisType((JvmDeclaredType)type);
        }
      }
    }
 else     if (next instanceof JvmTypeReference) {
      acceptor.acceptType((JvmTypeReference)next);
    }
 else     if (next instanceof XAnnotation) {
      acceptor.acceptType(((XAnnotation)next).getAnnotationType());
    }
 else     if (next instanceof XInstanceOfExpression) {
      acceptor.acceptType(((XInstanceOfExpression)next).getType());
    }
 else     if (next instanceof XConstructorCall) {
      acceptor.acceptType(((XConstructorCall)next).getConstructor().getDeclaringType());
    }
 else     if (next instanceof XTypeLiteral) {
      acceptor.acceptType(((XTypeLiteral)next).getType());
    }
 else     if (next instanceof XFeatureCall) {
      final XFeatureCall featureCall=(XFeatureCall)next;
      if (featureCall.getDeclaringType() == null) {
        final JvmIdentifiableElement member=featureCall.getFeature();
        if (member instanceof JvmOperation) {
          JvmOperation operation=(JvmOperation)member;
          if (operation.isStatic()) {
            if (!operation.isVarArgs() && operation.getParameters().size() > featureCall.getExplicitArguments().size()) {
              acceptor.acceptStaticExtensionImport(operation);
            }
 else {
              acceptor.acceptStaticImport(operation);
            }
          }
        }
        if (member instanceof JvmField) {
          if (((JvmField)member).isStatic()) {
            acceptor.acceptStaticImport((JvmMember)member);
          }
        }
      }
 else {
        acceptor.acceptType(featureCall.getDeclaringType());
      }
    }
 else     if (next instanceof XMemberFeatureCall || next instanceof XBinaryOperation || next instanceof XUnaryOperation|| next instanceof XAssignment) {
      final XAbstractFeatureCall featureCall=(XAbstractFeatureCall)next;
      final JvmIdentifiableElement member=featureCall.getFeature();
      if (member instanceof JvmOperation) {
        if (((JvmOperation)member).isStatic())         acceptor.acceptStaticExtensionImport((JvmMember)member);
      }
      if (member instanceof JvmField) {
        if (((JvmField)member).isStatic())         acceptor.acceptStaticExtensionImport((JvmMember)member);
      }
    }
  }
}