Program: 61631
Project: 61631
Buggy source:
public void generateTraitsPhase3(int methodInitScope,boolean isInterface,String className,String superName,boolean generateStatic,SourceGeneratorLocalData localData,List<GraphTargetItem> items,Traits ts,Trait[] traits,Map<Trait,Integer> initScopes,Reference<Integer> class_index) throws AVM2ParseException, CompilationException {
  for (int k=0; k < items.size(); k++) {
    GraphTargetItem item=items.get(k);
    if (traits[k] == null) {
      continue;
    }
    if (item instanceof InterfaceAVM2Item) {
      generateClass(((InterfaceAVM2Item)item).namespace,abc.class_info.get(((TraitClass)traits[k]).class_info),abc.instance_info.get(((TraitClass)traits[k]).class_info),initScopes.get(traits[k]),((InterfaceAVM2Item)item).pkg,localData,(InterfaceAVM2Item)item,class_index);
    }
    if (item instanceof ClassAVM2Item) {
      generateClass(((ClassAVM2Item)item).namespace,abc.class_info.get(((TraitClass)traits[k]).class_info),abc.instance_info.get(((TraitClass)traits[k]).class_info),initScopes.get(traits[k]),((ClassAVM2Item)item).pkg,localData,(ClassAVM2Item)item,class_index);
    }
    if ((item instanceof MethodAVM2Item) || (item instanceof GetterAVM2Item) || (item instanceof SetterAVM2Item)) {
      MethodAVM2Item mai=(MethodAVM2Item)item;
      if (mai.isStatic() != generateStatic) {
        continue;
      }
      ((TraitMethodGetterSetter)traits[k]).method_info=method(isInterface,new ArrayList<MethodBody>(),mai.pkg,mai.needsActivation,mai.subvariables,methodInitScope + (mai.isStatic() ? 0 : 1),mai.hasRest,mai.line,className,superName,false,localData,mai.paramTypes,mai.paramNames,mai.paramValues,mai.body,mai.retType);
    }
 else     if (item instanceof FunctionAVM2Item) {
      FunctionAVM2Item fai=(FunctionAVM2Item)item;
      ((TraitFunction)traits[k]).method_info=method(isInterface,new ArrayList<MethodBody>(),fai.pkg,fai.needsActivation,fai.subvariables,methodInitScope,fai.hasRest,fai.line,className,superName,false,localData,fai.paramTypes,fai.paramNames,fai.paramValues,fai.body,fai.retType);
    }
  }
}

Fixed version (ground truth):
public void generateTraitsPhase3(int methodInitScope,boolean isInterface,String className,String superName,boolean generateStatic,SourceGeneratorLocalData localData,List<GraphTargetItem> items,Traits ts,Trait[] traits,Map<Trait,Integer> initScopes,Reference<Integer> class_index) throws AVM2ParseException, CompilationException {
  for (int k=0; k < items.size(); k++) {
    GraphTargetItem item=items.get(k);
    if (traits[k] == null) {
      continue;
    }
    if (item instanceof InterfaceAVM2Item) {
      generateClass(((InterfaceAVM2Item)item).namespace,abc.class_info.get(((TraitClass)traits[k]).class_info),abc.instance_info.get(((TraitClass)traits[k]).class_info),initScopes.get(traits[k]),((InterfaceAVM2Item)item).pkg,localData,(InterfaceAVM2Item)item,class_index);
    }
    if (item instanceof ClassAVM2Item) {
      generateClass(((ClassAVM2Item)item).namespace,abc.class_info.get(((TraitClass)traits[k]).class_info),abc.instance_info.get(((TraitClass)traits[k]).class_info),initScopes.get(traits[k]),((ClassAVM2Item)item).pkg,localData,(ClassAVM2Item)item,class_index);
    }
    if ((item instanceof MethodAVM2Item) || (item instanceof GetterAVM2Item) || (item instanceof SetterAVM2Item)) {
      MethodAVM2Item mai=(MethodAVM2Item)item;
      if (mai.isStatic() != generateStatic) {
        continue;
      }
      ((TraitMethodGetterSetter)traits[k]).method_info=method(false,isInterface,new ArrayList<MethodBody>(),mai.pkg,mai.needsActivation,mai.subvariables,methodInitScope + (mai.isStatic() ? 0 : 1),mai.hasRest,mai.line,className,superName,false,localData,mai.paramTypes,mai.paramNames,mai.paramValues,mai.body,mai.retType);
    }
 else     if (item instanceof FunctionAVM2Item) {
      FunctionAVM2Item fai=(FunctionAVM2Item)item;
      ((TraitFunction)traits[k]).method_info=method(false,isInterface,new ArrayList<MethodBody>(),fai.pkg,fai.needsActivation,fai.subvariables,methodInitScope,fai.hasRest,fai.line,className,superName,false,localData,fai.paramTypes,fai.paramNames,fai.paramValues,fai.body,fai.retType);
    }
  }
}