Program: 62067
Project: 62067
Buggy source:
@Override public String convert(String path,List<ABCContainerTag> abcTags,ABC abc,boolean isStatic,boolean pcode,int scriptIndex,int classIndex,boolean highlight,List<String> fullyQualifiedNames,boolean paralel){
  if (!highlight) {
  }
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  PrintStream out=null;
  try {
    out=new PrintStream(baos,true,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException ex) {
    Logger.getLogger(TraitClass.class.getName()).log(Level.SEVERE,null,ex);
    return "String_Node_Str";
  }
  String packageName=abc.instance_info[class_info].getName(abc.constants).getNamespace(abc.constants).getName(abc.constants);
  List<String> namesInThisPackage=new ArrayList<>();
  for (  ABCContainerTag tag : abcTags) {
    for (    ScriptInfo si : tag.getABC().script_info) {
      for (      Trait t : si.traits.traits) {
        String spath=t.getPath(tag.getABC());
        String pkg="String_Node_Str";
        String name=spath;
        if (spath.contains("String_Node_Str")) {
          pkg=spath.substring(0,spath.lastIndexOf("String_Node_Str"));
          name=spath.substring(spath.lastIndexOf("String_Node_Str") + 1);
        }
        if (pkg.equals(packageName)) {
          namesInThisPackage.add(name);
        }
      }
    }
  }
  List<String> imports=new ArrayList<>();
  List<String> uses=new ArrayList<>();
  getImportsUsages(abcTags,abc,imports,uses,new ArrayList<String>());
  fullyQualifiedNames=new ArrayList<>();
  List<String> importnames=new ArrayList<>();
  importnames.addAll(namesInThisPackage);
  for (  String ipath : imports) {
    String name=ipath;
    String pkg="String_Node_Str";
    if (name.contains("String_Node_Str")) {
      pkg=name.substring(0,name.lastIndexOf("String_Node_Str"));
      name=name.substring(name.lastIndexOf("String_Node_Str") + 1);
    }
    if (importnames.contains(name) || ((!pkg.equals("String_Node_Str")) && isBuiltInClass(name))) {
      fullyQualifiedNames.add(name);
    }
 else {
      importnames.add(name);
    }
  }
  for (int i=0; i < imports.size(); i++) {
    String imp=imports.get(i);
    String pkg=imp.substring(0,imp.lastIndexOf("String_Node_Str"));
    String name=imp.substring(imp.lastIndexOf("String_Node_Str") + 1);
    if (name.equals("String_Node_Str")) {
      continue;
    }
    if (imports.contains(pkg + "String_Node_Str")) {
      imports.remove(i);
      i--;
    }
  }
  for (  String imp : imports) {
    if (!imp.startsWith("String_Node_Str")) {
      out.println(ABC.IDENT_STRING + "String_Node_Str" + imp+ "String_Node_Str");
    }
  }
  out.println();
  for (  String us : uses) {
    out.println(ABC.IDENT_STRING + "String_Node_Str" + us+ "String_Node_Str");
  }
  out.println();
  String classHeader=abc.instance_info[class_info].getClassHeaderStr(abc,fullyQualifiedNames);
  if (classHeader.startsWith("String_Node_Str")) {
    classHeader=classHeader.substring("String_Node_Str".length());
  }
  out.println(ABC.IDENT_STRING + classHeader);
  out.println(ABC.IDENT_STRING + "String_Node_Str");
  String toPrint;
  List<String> outTraits=new LinkedList<>();
  int bodyIndex;
  String bodyStr="String_Node_Str";
  bodyIndex=abc.findBodyIndex(abc.class_info[class_info].cinit_index);
  if (bodyIndex != -1) {
    bodyStr=abc.bodies[bodyIndex].toString(path + "String_Node_Str" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants,fullyQualifiedNames)+ "String_Node_Str",pcode,true,scriptIndex,class_info,abc,abc.constants,abc.method_info,new Stack<GraphTargetItem>(),true,highlight,fullyQualifiedNames,abc.class_info[class_info].static_traits);
    if (!highlight) {
      bodyStr=Highlighting.stripHilights(bodyStr);
    }
  }
  if (Highlighting.stripHilights(bodyStr).equals("String_Node_Str")) {
    toPrint=ABC.addTabs(bodyStr,3);
  }
 else {
    toPrint=ABC.IDENT_STRING + ABC.IDENT_STRING + "String_Node_Str"+ ABC.addTabs(bodyStr,3)+ "String_Node_Str"+ ABC.IDENT_STRING+ ABC.IDENT_STRING+ "String_Node_Str";
  }
  if (highlight) {
    toPrint=Highlighting.hilighTrait(toPrint,abc.class_info[class_info].static_traits.traits.length + abc.instance_info[class_info].instance_traits.traits.length + 1);
  }
  outTraits.add(toPrint);
  if (!abc.instance_info[class_info].isInterface()) {
    String modifier="String_Node_Str";
    Multiname m=abc.constants.constant_multiname[abc.instance_info[class_info].name_index];
    if (m != null) {
      Namespace ns=m.getNamespace(abc.constants);
      if (ns != null) {
        modifier=ns.getPrefix(abc) + "String_Node_Str";
        if (modifier.equals("String_Node_Str")) {
          modifier="String_Node_Str";
        }
        if (modifier.startsWith("String_Node_Str")) {
          modifier="String_Node_Str";
        }
      }
    }
    String constructorParams;
    bodyStr="String_Node_Str";
    bodyIndex=abc.findBodyIndex(abc.instance_info[class_info].iinit_index);
    if (bodyIndex != -1) {
      bodyStr=ABC.addTabs(abc.bodies[bodyIndex].toString(path + "String_Node_Str" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants,fullyQualifiedNames)+ "String_Node_Str",pcode,false,scriptIndex,class_info,abc,abc.constants,abc.method_info,new Stack<GraphTargetItem>(),false,highlight,fullyQualifiedNames,abc.instance_info[class_info].instance_traits),3);
      if (!highlight) {
        bodyStr=Highlighting.stripHilights(bodyStr);
      }
      constructorParams=abc.method_info[abc.instance_info[class_info].iinit_index].getParamStr(abc.constants,abc.bodies[bodyIndex],abc,fullyQualifiedNames);
    }
 else {
      constructorParams=abc.method_info[abc.instance_info[class_info].iinit_index].getParamStr(abc.constants,null,abc,fullyQualifiedNames);
    }
    toPrint=ABC.IDENT_STRING + ABC.IDENT_STRING + modifier+ "String_Node_Str"+ abc.constants.constant_multiname[abc.instance_info[class_info].name_index].getName(abc.constants,new ArrayList<String>())+ "String_Node_Str"+ constructorParams+ "String_Node_Str"+ bodyStr+ "String_Node_Str"+ ABC.IDENT_STRING+ ABC.IDENT_STRING+ "String_Node_Str";
    if (highlight) {
      toPrint=Highlighting.hilighTrait(toPrint,abc.class_info[class_info].static_traits.traits.length + abc.instance_info[class_info].instance_traits.traits.length);
    }
    outTraits.add(toPrint);
  }
  outTraits.add(abc.class_info[class_info].static_traits.convert(path + "String_Node_Str" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants,fullyQualifiedNames),abcTags,abc,true,pcode,false,scriptIndex,class_info,highlight,fullyQualifiedNames,paralel));
  outTraits.add(abc.instance_info[class_info].instance_traits.convert(path + "String_Node_Str" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants,fullyQualifiedNames),abcTags,abc,false,pcode,false,scriptIndex,class_info,highlight,fullyQualifiedNames,paralel));
  StringBuilder bui=new StringBuilder();
  boolean first=true;
  String glue="String_Node_Str";
  for (  String s : outTraits) {
    if (!Highlighting.stripHilights(s).trim().equals("String_Node_Str")) {
      if (!first) {
        bui.append(glue);
      }
 else {
        first=false;
      }
    }
 else {
      s=s.replace(ABC.IDENT_STRING,"String_Node_Str");
    }
    bui.append(s);
  }
  out.println(bui.toString());
  out.println(ABC.IDENT_STRING + "String_Node_Str");
  out.flush();
  try {
    if (highlight) {
      return Highlighting.hilighClass(new String(baos.toByteArray(),"String_Node_Str"),class_info);
    }
 else {
      return new String(baos.toByteArray(),"String_Node_Str");
    }
  }
 catch (  UnsupportedEncodingException ex) {
    Logger.getLogger(TraitClass.class.getName()).log(Level.SEVERE,null,ex);
    return "String_Node_Str";
  }
}

Fixed version (ground truth):
@Override public String convert(String path,List<ABCContainerTag> abcTags,ABC abc,boolean isStatic,boolean pcode,int scriptIndex,int classIndex,boolean highlight,List<String> fullyQualifiedNames,boolean paralel){
  if (!highlight) {
  }
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  PrintStream out=null;
  try {
    out=new PrintStream(baos,true,"String_Node_Str");
  }
 catch (  UnsupportedEncodingException ex) {
    Logger.getLogger(TraitClass.class.getName()).log(Level.SEVERE,null,ex);
    return "String_Node_Str";
  }
  String packageName=abc.instance_info[class_info].getName(abc.constants).getNamespace(abc.constants).getName(abc.constants);
  List<String> namesInThisPackage=new ArrayList<>();
  for (  ABCContainerTag tag : abcTags) {
    for (    ScriptInfo si : tag.getABC().script_info) {
      for (      Trait t : si.traits.traits) {
        String spath=t.getPath(tag.getABC());
        String pkg="String_Node_Str";
        String name=spath;
        if (spath.contains("String_Node_Str")) {
          pkg=spath.substring(0,spath.lastIndexOf("String_Node_Str"));
          name=spath.substring(spath.lastIndexOf("String_Node_Str") + 1);
        }
        if (pkg.equals(packageName)) {
          namesInThisPackage.add(name);
        }
      }
    }
  }
  List<String> imports=new ArrayList<>();
  List<String> uses=new ArrayList<>();
  getImportsUsages(abcTags,abc,imports,uses,new ArrayList<String>());
  fullyQualifiedNames=new ArrayList<>();
  List<String> importnames=new ArrayList<>();
  importnames.addAll(namesInThisPackage);
  for (  String ipath : imports) {
    String name=ipath;
    String pkg="String_Node_Str";
    if (name.contains("String_Node_Str")) {
      pkg=name.substring(0,name.lastIndexOf("String_Node_Str"));
      name=name.substring(name.lastIndexOf("String_Node_Str") + 1);
    }
    if (importnames.contains(name) || ((!pkg.equals("String_Node_Str")) && isBuiltInClass(name))) {
      fullyQualifiedNames.add(name);
    }
 else {
      importnames.add(name);
    }
  }
  for (int i=0; i < imports.size(); i++) {
    String imp=imports.get(i);
    String pkg=imp.substring(0,imp.lastIndexOf("String_Node_Str"));
    String name=imp.substring(imp.lastIndexOf("String_Node_Str") + 1);
    if (name.equals("String_Node_Str")) {
      continue;
    }
    if (imports.contains(pkg + "String_Node_Str")) {
      imports.remove(i);
      i--;
    }
  }
  for (  String imp : imports) {
    if (!imp.startsWith("String_Node_Str")) {
      out.println(ABC.IDENT_STRING + "String_Node_Str" + imp+ "String_Node_Str");
    }
  }
  out.println();
  for (  String us : uses) {
    out.println(ABC.IDENT_STRING + "String_Node_Str" + us+ "String_Node_Str");
  }
  out.println();
  String classHeader=abc.instance_info[class_info].getClassHeaderStr(abc,fullyQualifiedNames);
  if (classHeader.startsWith("String_Node_Str")) {
    classHeader=classHeader.substring("String_Node_Str".length());
  }
  out.println(ABC.IDENT_STRING + classHeader);
  out.println(ABC.IDENT_STRING + "String_Node_Str");
  String toPrint;
  List<String> outTraits=new LinkedList<>();
  int bodyIndex;
  String bodyStr="String_Node_Str";
  bodyIndex=abc.findBodyIndex(abc.class_info[class_info].cinit_index);
  if (bodyIndex != -1) {
    bodyStr=abc.bodies[bodyIndex].toString(path + "String_Node_Str" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants,fullyQualifiedNames)+ "String_Node_Str",pcode,true,scriptIndex,class_info,abc,abc.constants,abc.method_info,new Stack<GraphTargetItem>(),true,highlight,fullyQualifiedNames,abc.class_info[class_info].static_traits);
    if (!highlight) {
      bodyStr=Highlighting.stripHilights(bodyStr);
    }
  }
  if (Highlighting.stripHilights(bodyStr).trim().equals("String_Node_Str")) {
    toPrint=ABC.addTabs(bodyStr + "String_Node_Str",3);
  }
 else {
    toPrint=ABC.IDENT_STRING + ABC.IDENT_STRING + "String_Node_Str"+ ABC.addTabs(bodyStr,3)+ "String_Node_Str"+ ABC.IDENT_STRING+ ABC.IDENT_STRING+ "String_Node_Str";
  }
  if (highlight) {
    toPrint=Highlighting.hilighTrait(toPrint,abc.class_info[class_info].static_traits.traits.length + abc.instance_info[class_info].instance_traits.traits.length + 1);
  }
  outTraits.add(toPrint);
  if (!abc.instance_info[class_info].isInterface()) {
    String modifier="String_Node_Str";
    Multiname m=abc.constants.constant_multiname[abc.instance_info[class_info].name_index];
    if (m != null) {
      Namespace ns=m.getNamespace(abc.constants);
      if (ns != null) {
        modifier=ns.getPrefix(abc) + "String_Node_Str";
        if (modifier.equals("String_Node_Str")) {
          modifier="String_Node_Str";
        }
        if (modifier.startsWith("String_Node_Str")) {
          modifier="String_Node_Str";
        }
      }
    }
    String constructorParams;
    bodyStr="String_Node_Str";
    bodyIndex=abc.findBodyIndex(abc.instance_info[class_info].iinit_index);
    if (bodyIndex != -1) {
      bodyStr=ABC.addTabs(abc.bodies[bodyIndex].toString(path + "String_Node_Str" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants,fullyQualifiedNames)+ "String_Node_Str",pcode,false,scriptIndex,class_info,abc,abc.constants,abc.method_info,new Stack<GraphTargetItem>(),false,highlight,fullyQualifiedNames,abc.instance_info[class_info].instance_traits),3);
      if (!highlight) {
        bodyStr=Highlighting.stripHilights(bodyStr);
      }
      constructorParams=abc.method_info[abc.instance_info[class_info].iinit_index].getParamStr(abc.constants,abc.bodies[bodyIndex],abc,fullyQualifiedNames);
    }
 else {
      constructorParams=abc.method_info[abc.instance_info[class_info].iinit_index].getParamStr(abc.constants,null,abc,fullyQualifiedNames);
    }
    toPrint=ABC.IDENT_STRING + ABC.IDENT_STRING + modifier+ "String_Node_Str"+ abc.constants.constant_multiname[abc.instance_info[class_info].name_index].getName(abc.constants,new ArrayList<String>())+ "String_Node_Str"+ constructorParams+ "String_Node_Str"+ bodyStr+ "String_Node_Str"+ ABC.IDENT_STRING+ ABC.IDENT_STRING+ "String_Node_Str";
    if (highlight) {
      toPrint=Highlighting.hilighTrait(toPrint,abc.class_info[class_info].static_traits.traits.length + abc.instance_info[class_info].instance_traits.traits.length);
    }
    outTraits.add(toPrint);
  }
  outTraits.add(abc.class_info[class_info].static_traits.convert(path + "String_Node_Str" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants,fullyQualifiedNames),abcTags,abc,true,pcode,false,scriptIndex,class_info,highlight,fullyQualifiedNames,paralel));
  outTraits.add(abc.instance_info[class_info].instance_traits.convert(path + "String_Node_Str" + abc.instance_info[class_info].getName(abc.constants).getName(abc.constants,fullyQualifiedNames),abcTags,abc,false,pcode,false,scriptIndex,class_info,highlight,fullyQualifiedNames,paralel));
  StringBuilder bui=new StringBuilder();
  boolean first=true;
  String glue="String_Node_Str";
  for (  String s : outTraits) {
    if (!Highlighting.stripHilights(s).trim().equals("String_Node_Str")) {
      if (s.contains("String_Node_Str")) {
        s=s.replace("String_Node_Str","String_Node_Str");
        s=s + "String_Node_Str";
      }
 else {
        if (!first) {
          bui.append(glue);
        }
 else {
          first=false;
        }
      }
    }
 else {
      s=s.replace(ABC.IDENT_STRING,"String_Node_Str");
    }
    bui.append(s);
  }
  out.println(bui.toString());
  out.println(ABC.IDENT_STRING + "String_Node_Str");
  out.flush();
  try {
    if (highlight) {
      return Highlighting.hilighClass(new String(baos.toByteArray(),"String_Node_Str"),class_info);
    }
 else {
      return new String(baos.toByteArray(),"String_Node_Str");
    }
  }
 catch (  UnsupportedEncodingException ex) {
    Logger.getLogger(TraitClass.class.getName()).log(Level.SEVERE,null,ex);
    return "String_Node_Str";
  }
}