Program: 185409
Project: 185409
Buggy source:
/** 
 * Add any groovy specific method bindings to the set determined by the compiler. These
 */
@Override protected MethodBinding[] augmentMethodBindings(MethodBinding[] methodBindings){
  SourceTypeBinding binding=this.referenceContext.binding;
  if (binding != null && (binding.isAnnotationType() || binding.isInterface())) {
    return methodBindings;
  }
  boolean implementsGroovyLangObject=false;
  ReferenceBinding[] superInterfaces=binding.superInterfaces;
  if (superInterfaces != null) {
    for (int i=0, max=superInterfaces.length; i < max; i++) {
      char[][] interfaceName=superInterfaces[i].compoundName;
      if (CharOperation.equals(interfaceName,GROOVY_LANG_GROOVYOBJECT)) {
        implementsGroovyLangObject=true;
        break;
      }
    }
  }
  List<MethodBinding> groovyMethods=new ArrayList<>();
  if (implementsGroovyLangObject) {
    if (debugListener != null) {
      debugListener.record("String_Node_Str" + new String(referenceContext.name) + "String_Node_Str");
    }
    TypeBinding bindingJLO=getJavaLangObject();
    TypeBinding bindingJLS=getJavaLangString();
    TypeBinding bindingGLM=getGroovyLangMetaClassBinding();
    createMethod("String_Node_Str",false,"String_Node_Str",new TypeBinding[]{bindingJLS,bindingJLO},bindingJLO,groovyMethods,methodBindings,null);
    createMethod("String_Node_Str",false,"String_Node_Str",new TypeBinding[]{bindingJLS},bindingJLO,groovyMethods,methodBindings,null);
    createMethod("String_Node_Str",false,"String_Node_Str",new TypeBinding[]{bindingJLS,bindingJLO},TypeBinding.VOID,groovyMethods,methodBindings,null);
    createMethod("String_Node_Str",false,"String_Node_Str",null,bindingGLM,groovyMethods,methodBindings,null);
    createMethod("String_Node_Str",false,"String_Node_Str",new TypeBinding[]{bindingGLM},TypeBinding.VOID,groovyMethods,methodBindings,null);
  }
  if (this.referenceContext instanceof GroovyTypeDeclaration) {
    GroovyTypeDeclaration typeDeclaration=(GroovyTypeDeclaration)this.referenceContext;
    boolean useOldWay=false;
    if (useOldWay) {
      List<PropertyNode> properties=typeDeclaration.properties;
      for (      PropertyNode property : properties) {
        String name=property.getName();
        FieldBinding fBinding=typeDeclaration.binding.getField(name.toCharArray(),false);
        if (fBinding != null && !(fBinding.type instanceof MissingTypeBinding)) {
          String getterName="String_Node_Str" + MetaClassHelper.capitalize(name);
          createMethod(getterName,property.isStatic(),"String_Node_Str",null,fBinding.type,groovyMethods,methodBindings,typeDeclaration);
          if (!fBinding.isFinal()) {
            String setterName="String_Node_Str" + MetaClassHelper.capitalize(name);
            createMethod(setterName,property.isStatic(),"String_Node_Str",new TypeBinding[]{fBinding.type},TypeBinding.VOID,groovyMethods,methodBindings,typeDeclaration);
          }
          if (fBinding.type == TypeBinding.BOOLEAN) {
            createMethod("String_Node_Str" + MetaClassHelper.capitalize(name),property.isStatic(),"String_Node_Str",null,fBinding.type,groovyMethods,methodBindings,typeDeclaration);
          }
        }
      }
    }
 else {
      List<PropertyNode> properties=typeDeclaration.properties;
      for (      PropertyNode property : properties) {
        String name=property.getName();
        String capitalizedName=MetaClassHelper.capitalize(name);
        createGetterMethod(name,"String_Node_Str" + capitalizedName,property.isStatic(),groovyMethods,methodBindings,typeDeclaration);
        if (!Modifier.isFinal(property.getModifiers())) {
          createSetterMethod(name,"String_Node_Str" + capitalizedName,property.isStatic(),groovyMethods,methodBindings,typeDeclaration,property.getType().getName());
        }
        String propertyType=property.getType().getName();
        if (propertyType.equals("String_Node_Str")) {
          createGetterMethod(name,"String_Node_Str" + capitalizedName,property.isStatic(),groovyMethods,methodBindings,typeDeclaration);
        }
      }
    }
  }
  Map<String,MethodBinding> methodsMap=new HashMap<>();
  for (  ReferenceBinding i : superInterfaces) {
    if (traitHelper.isTrait(i)) {
      ReferenceBinding helperBinding=traitHelper.getHelperBinding(i);
      for (      MethodBinding method : i.availableMethods()) {
        if (method.isPrivate() || method.isStatic()) {
          continue;
        }
        if (isNotActuallyAbstract(method,helperBinding)) {
          methodsMap.put(getMethodAsString(method),method);
        }
      }
    }
  }
  if (!methodsMap.isEmpty()) {
    Set<String> canBeOverridden=new HashSet<>();
    ReferenceBinding superclass=binding.superclass();
    while (superclass != null) {
      for (      MethodBinding method : superclass.availableMethods()) {
        if (method.isPrivate() || method.isPublic() || method.isStatic()) {
          continue;
        }
        canBeOverridden.add(getMethodAsString(method));
      }
      superclass=superclass.superclass();
    }
    for (    MethodBinding method : methodBindings) {
      canBeOverridden.remove(getMethodAsString(method));
    }
    for (    String key : canBeOverridden) {
      MethodBinding method=methodsMap.get(key);
      if (method != null) {
        method=new MethodBinding(method,binding);
        method.modifiers&=~Modifier.ABSTRACT;
        groovyMethods.add(method);
      }
    }
  }
  MethodBinding[] newMethodBindings=groovyMethods.toArray(new MethodBinding[methodBindings.length + groovyMethods.size()]);
  System.arraycopy(methodBindings,0,newMethodBindings,groovyMethods.size(),methodBindings.length);
  return newMethodBindings;
}

Fixed version (ground truth):
/** 
 * Adds any Groovy-specific method bindings to the set determined by the compiler.
 */
@Override protected MethodBinding[] augmentMethodBindings(MethodBinding[] methodBindings){
  SourceTypeBinding binding=referenceContext.binding;
  if (binding != null && (binding.isAnnotationType() || binding.isInterface())) {
    return methodBindings;
  }
  boolean implementsGroovyLangObject=false;
  ReferenceBinding[] superInterfaces=binding.superInterfaces != null ? binding.superInterfaces : new ReferenceBinding[0];
  for (int i=0, n=superInterfaces.length; i < n; i+=1) {
    char[][] interfaceName=superInterfaces[i].compoundName;
    if (CharOperation.equals(interfaceName,GroovyCompilationUnitScope.GROOVY_LANG_GROOVYOBJECT)) {
      implementsGroovyLangObject=true;
      break;
    }
  }
  List<MethodBinding> groovyMethods=new ArrayList<>();
  if (implementsGroovyLangObject) {
    if (debugListener != null) {
      debugListener.record("String_Node_Str" + String.valueOf(referenceContext.name) + "String_Node_Str");
    }
    TypeBinding bindingJLO=getJavaLangObject();
    TypeBinding bindingJLS=getJavaLangString();
    TypeBinding bindingGLM=getGroovyLangMetaClassBinding();
    createMethod("String_Node_Str",false,"String_Node_Str",new TypeBinding[]{bindingJLS,bindingJLO},bindingJLO,groovyMethods,methodBindings,null);
    createMethod("String_Node_Str",false,"String_Node_Str",new TypeBinding[]{bindingJLS},bindingJLO,groovyMethods,methodBindings,null);
    createMethod("String_Node_Str",false,"String_Node_Str",new TypeBinding[]{bindingJLS,bindingJLO},TypeBinding.VOID,groovyMethods,methodBindings,null);
    createMethod("String_Node_Str",false,"String_Node_Str",null,bindingGLM,groovyMethods,methodBindings,null);
    createMethod("String_Node_Str",false,"String_Node_Str",new TypeBinding[]{bindingGLM},TypeBinding.VOID,groovyMethods,methodBindings,null);
  }
  if (this.referenceContext instanceof GroovyTypeDeclaration) {
    GroovyTypeDeclaration typeDeclaration=(GroovyTypeDeclaration)this.referenceContext;
    boolean useOldWay=false;
    if (useOldWay) {
      List<PropertyNode> properties=typeDeclaration.properties;
      for (      PropertyNode property : properties) {
        String name=property.getName();
        FieldBinding fBinding=typeDeclaration.binding.getField(name.toCharArray(),false);
        if (fBinding != null && !(fBinding.type instanceof MissingTypeBinding)) {
          String getterName="String_Node_Str" + MetaClassHelper.capitalize(name);
          createMethod(getterName,property.isStatic(),"String_Node_Str",null,fBinding.type,groovyMethods,methodBindings,typeDeclaration);
          if (!fBinding.isFinal()) {
            String setterName="String_Node_Str" + MetaClassHelper.capitalize(name);
            createMethod(setterName,property.isStatic(),"String_Node_Str",new TypeBinding[]{fBinding.type},TypeBinding.VOID,groovyMethods,methodBindings,typeDeclaration);
          }
          if (fBinding.type == TypeBinding.BOOLEAN) {
            createMethod("String_Node_Str" + MetaClassHelper.capitalize(name),property.isStatic(),"String_Node_Str",null,fBinding.type,groovyMethods,methodBindings,typeDeclaration);
          }
        }
      }
    }
 else {
      List<PropertyNode> properties=typeDeclaration.properties;
      for (      PropertyNode property : properties) {
        String name=property.getName();
        String capitalizedName=MetaClassHelper.capitalize(name);
        createGetterMethod(name,"String_Node_Str" + capitalizedName,property.isStatic(),groovyMethods,methodBindings,typeDeclaration);
        if (!Modifier.isFinal(property.getModifiers())) {
          createSetterMethod(name,"String_Node_Str" + capitalizedName,property.isStatic(),groovyMethods,methodBindings,typeDeclaration,property.getType().getName());
        }
        String propertyType=property.getType().getName();
        if (propertyType.equals("String_Node_Str")) {
          createGetterMethod(name,"String_Node_Str" + capitalizedName,property.isStatic(),groovyMethods,methodBindings,typeDeclaration);
        }
      }
    }
  }
  Map<String,MethodBinding> methodsMap=new HashMap<>();
  for (  ReferenceBinding face : superInterfaces) {
    if (traitHelper.isTrait(face)) {
      ReferenceBinding helperBinding=traitHelper.getHelperBinding(face);
      for (      MethodBinding method : face.availableMethods()) {
        if (method.isPrivate() || method.isStatic()) {
          continue;
        }
        if (isNotActuallyAbstract(method,helperBinding)) {
          methodsMap.put(getMethodAsString(method),method);
        }
      }
    }
  }
  if (!methodsMap.isEmpty()) {
    Set<String> canBeOverridden=new HashSet<>();
    ReferenceBinding superclass=binding.superclass();
    while (superclass != null) {
      for (      MethodBinding method : superclass.availableMethods()) {
        if (method.isPrivate() || method.isPublic() || method.isStatic()) {
          continue;
        }
        canBeOverridden.add(getMethodAsString(method));
      }
      superclass=superclass.superclass();
    }
    for (    MethodBinding method : methodBindings) {
      canBeOverridden.remove(getMethodAsString(method));
    }
    for (    String key : canBeOverridden) {
      MethodBinding method=methodsMap.get(key);
      if (method != null) {
        method=new MethodBinding(method,binding);
        method.modifiers&=~Modifier.ABSTRACT;
        groovyMethods.add(method);
      }
    }
  }
  MethodBinding[] newMethodBindings=groovyMethods.toArray(new MethodBinding[methodBindings.length + groovyMethods.size()]);
  System.arraycopy(methodBindings,0,newMethodBindings,groovyMethods.size(),methodBindings.length);
  return newMethodBindings;
}