Program: 61605
Project: 61605
Buggy source:
private int genNs(List<String> importedClasses,String pkg,String custom,int namespace,List<Integer> openedNamespaces,SourceGeneratorLocalData localData,int line) throws CompilationException {
  if (custom != null) {
    PropertyAVM2Item prop=new PropertyAVM2Item(null,custom,abc,allABCs,openedNamespaces,new ArrayList<MethodBody>());
    Reference<ValueKind> value=new Reference<>(null);
    prop.resolve(localData,new Reference<GraphTargetItem>(null),new Reference<GraphTargetItem>(null),new Reference<>(0),value);
    boolean resolved=true;
    if (value.getVal() == null) {
      resolved=false;
    }
    if (!resolved) {
      String customPkg="String_Node_Str";
      String fullCustom="String_Node_Str";
      for (      String imp : importedClasses) {
        if (imp.endsWith("String_Node_Str" + custom)) {
          customPkg=imp.substring(0,imp.lastIndexOf('.'));
          fullCustom=imp;
          break;
        }
      }
      List<ABC> aas=new ArrayList<>();
      aas.add(abc);
      aas.addAll(allABCs);
      for (      ABC a : aas) {
        for (        ScriptInfo si : a.script_info) {
          for (          Trait t : si.traits.traits) {
            Multiname m=t.getName(a);
            if (fullCustom.equals(m.getNameWithNamespace(a.constants,true))) {
              if (t instanceof TraitSlotConst) {
                if (((TraitSlotConst)t).isNamespace()) {
                  return ((TraitSlotConst)t).value_index;
                }
              }
            }
          }
        }
      }
      throw new CompilationException("String_Node_Str",line);
    }
    namespace=value.getVal().value_index;
  }
  return namespace;
}

Fixed version (ground truth):
private int genNs(List<String> importedClasses,String pkg,String custom,int namespace,List<Integer> openedNamespaces,SourceGeneratorLocalData localData,int line) throws CompilationException {
  if (custom != null) {
    PropertyAVM2Item prop=new PropertyAVM2Item(null,custom,abc,allABCs,openedNamespaces,new ArrayList<MethodBody>());
    Reference<ValueKind> value=new Reference<>(null);
    prop.resolve(localData,new Reference<GraphTargetItem>(null),new Reference<GraphTargetItem>(null),new Reference<>(0),value);
    boolean resolved=true;
    if (value.getVal() == null) {
      resolved=false;
    }
    if (!resolved) {
      String customPkg="String_Node_Str";
      String fullCustom="String_Node_Str";
      for (      String imp : importedClasses) {
        if (imp.endsWith("String_Node_Str" + custom)) {
          customPkg=imp.substring(0,imp.lastIndexOf('.'));
          fullCustom=imp;
          break;
        }
      }
      List<ABC> aas=new ArrayList<>();
      aas.add(abc);
      aas.addAll(allABCs);
      for (      ABC a : aas) {
        for (        ScriptInfo si : a.script_info) {
          for (          Trait t : si.traits.traits) {
            Multiname m=t.getName(a);
            if (fullCustom.equals(m.getNameWithNamespace(a.constants,true))) {
              if (t instanceof TraitSlotConst) {
                if (((TraitSlotConst)t).isNamespace()) {
                  Namespace ns=a.constants.getNamespace(((TraitSlotConst)t).value_index);
                  return abc.constants.getNamespaceId(new Namespace(ns.kind,abc.constants.getStringId(ns.getName(a.constants,true),true)),0,true);
                }
              }
            }
          }
        }
      }
      throw new CompilationException("String_Node_Str",line);
    }
    namespace=value.getVal().value_index;
  }
  return namespace;
}