Program: 66175
Project: 66175
Buggy source:
private Class generateArrayValue(JavaClass arrayClass,JavaClass componentClass,JavaClass nestedClass,TypeMappingInfo typeMappingInfo){
  String packageName;
  String qualifiedClassName;
  if (componentClass.isArray()) {
    packageName=componentClass.getPackageName();
    qualifiedClassName=nestedClass.getQualifiedName() + ARRAY_CLASS_NAME_SUFFIX;
  }
 else {
    if (componentClass.isPrimitive()) {
      packageName=ARRAY_PACKAGE_NAME;
      qualifiedClassName=packageName + "String_Node_Str" + componentClass.getName()+ ARRAY_CLASS_NAME_SUFFIX;
    }
 else {
      packageName=ARRAY_PACKAGE_NAME + "String_Node_Str" + componentClass.getPackageName();
      if (componentClass.isMemberClass()) {
        qualifiedClassName=componentClass.getName();
        qualifiedClassName=qualifiedClassName.substring(qualifiedClassName.indexOf('$') + 1);
        qualifiedClassName=ARRAY_PACKAGE_NAME + "String_Node_Str" + componentClass.getPackageName()+ "String_Node_Str"+ qualifiedClassName+ ARRAY_CLASS_NAME_SUFFIX;
      }
 else {
        qualifiedClassName=ARRAY_PACKAGE_NAME + "String_Node_Str" + componentClass.getQualifiedName()+ ARRAY_CLASS_NAME_SUFFIX;
      }
    }
    if (componentClass.isPrimitive() || helper.isBuiltInJavaType(componentClass)) {
      NamespaceInfo namespaceInfo=getPackageToNamespaceMappings().get(packageName);
      if (namespaceInfo == null) {
        namespaceInfo=new NamespaceInfo();
        namespaceInfo.setNamespace(ARRAY_NAMESPACE);
        namespaceInfo.setNamespaceResolver(new NamespaceResolver());
        getPackageToNamespaceMappings().put(packageName,namespaceInfo);
      }
    }
 else {
      NamespaceInfo namespaceInfo=getNamespaceInfoForPackage(componentClass.getPackage());
      getPackageToNamespaceMappings().put(packageName,namespaceInfo);
    }
  }
  String qualifiedInternalClassName=qualifiedClassName.replace('.','/');
  String superClassName;
  if (componentClass.isArray()) {
    superClassName="String_Node_Str";
  }
 else {
    superClassName="String_Node_Str";
  }
  ClassWriter cw=new ClassWriter(false);
  cw.visit(Constants.V1_5,Constants.ACC_PUBLIC + Constants.ACC_SUPER,qualifiedInternalClassName,superClassName,null,null);
  CodeVisitor cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitMethodInsn(Constants.INVOKESPECIAL,superClassName,"String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.RETURN);
  cv.visitMaxs(1,1);
  if (componentClass.isArray()) {
    cv=cw.visitMethod(Constants.ACC_PROTECTED,"String_Node_Str","String_Node_Str",null,null);
    cv.visitLdcInsn(Type.getType("String_Node_Str" + nestedClass.getQualifiedName().replace('.','/') + "String_Node_Str"));
    cv.visitInsn(Constants.ARETURN);
    cv.visitMaxs(1,1);
  }
  cv=cw.visitMethod(Constants.ACC_PROTECTED,"String_Node_Str","String_Node_Str",null,null);
  JavaClass baseComponentClass=getBaseComponentType(componentClass);
  if (baseComponentClass.isPrimitive()) {
    cv.visitFieldInsn(Constants.GETSTATIC,getObjectType(baseComponentClass).getQualifiedName().replace('.','/'),"String_Node_Str","String_Node_Str");
  }
 else {
    cv.visitLdcInsn(Type.getType("String_Node_Str" + baseComponentClass.getQualifiedName().replace('.','/') + "String_Node_Str"));
  }
  cv.visitInsn(Constants.ARETURN);
  cv.visitMaxs(1,1);
  RuntimeVisibleAnnotations getAdaptedValueMethodAnnotations=new RuntimeVisibleAnnotations();
  Annotation xmlElementAnnotation=new Annotation("String_Node_Str");
  xmlElementAnnotation.add("String_Node_Str","String_Node_Str");
  xmlElementAnnotation.add("String_Node_Str",Type.getType("String_Node_Str" + getObjectType(nestedClass).getName().replace('.','/') + "String_Node_Str"));
  getAdaptedValueMethodAnnotations.annotations.add(xmlElementAnnotation);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,getAdaptedValueMethodAnnotations);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitFieldInsn(Constants.GETFIELD,qualifiedInternalClassName,"String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.ARETURN);
  cv.visitMaxs(1,1);
  return generateClassFromBytes(qualifiedClassName,cw.toByteArray());
}

Fixed version (ground truth):
private Class generateArrayValue(JavaClass arrayClass,JavaClass componentClass,JavaClass nestedClass,TypeMappingInfo typeMappingInfo){
  String packageName;
  String qualifiedClassName;
  if (componentClass.isArray()) {
    packageName=componentClass.getPackageName();
    qualifiedClassName=nestedClass.getQualifiedName() + ARRAY_CLASS_NAME_SUFFIX;
  }
 else {
    if (componentClass.isPrimitive()) {
      packageName=ARRAY_PACKAGE_NAME;
      qualifiedClassName=packageName + "String_Node_Str" + componentClass.getName()+ ARRAY_CLASS_NAME_SUFFIX;
    }
 else {
      packageName=ARRAY_PACKAGE_NAME + "String_Node_Str" + componentClass.getPackageName();
      if (componentClass.isMemberClass()) {
        qualifiedClassName=componentClass.getName();
        qualifiedClassName=qualifiedClassName.substring(qualifiedClassName.indexOf('$') + 1);
        qualifiedClassName=ARRAY_PACKAGE_NAME + "String_Node_Str" + componentClass.getPackageName()+ "String_Node_Str"+ qualifiedClassName+ ARRAY_CLASS_NAME_SUFFIX;
      }
 else {
        qualifiedClassName=ARRAY_PACKAGE_NAME + "String_Node_Str" + componentClass.getQualifiedName()+ ARRAY_CLASS_NAME_SUFFIX;
      }
    }
    if (componentClass.isPrimitive() || helper.isBuiltInJavaType(componentClass)) {
      NamespaceInfo namespaceInfo=getPackageToNamespaceMappings().get(packageName);
      if (namespaceInfo == null) {
        namespaceInfo=new NamespaceInfo();
        namespaceInfo.setNamespace(ARRAY_NAMESPACE);
        namespaceInfo.setNamespaceResolver(new NamespaceResolver());
        getPackageToNamespaceMappings().put(packageName,namespaceInfo);
      }
    }
 else {
      NamespaceInfo namespaceInfo=getNamespaceInfoForPackage(componentClass.getPackage(),componentClass.getPackageName());
      getPackageToNamespaceMappings().put(packageName,namespaceInfo);
    }
  }
  String qualifiedInternalClassName=qualifiedClassName.replace('.','/');
  String superClassName;
  if (componentClass.isArray()) {
    superClassName="String_Node_Str";
  }
 else {
    superClassName="String_Node_Str";
  }
  ClassWriter cw=new ClassWriter(false);
  cw.visit(Constants.V1_5,Constants.ACC_PUBLIC + Constants.ACC_SUPER,qualifiedInternalClassName,superClassName,null,null);
  CodeVisitor cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitMethodInsn(Constants.INVOKESPECIAL,superClassName,"String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.RETURN);
  cv.visitMaxs(1,1);
  if (componentClass.isArray()) {
    cv=cw.visitMethod(Constants.ACC_PROTECTED,"String_Node_Str","String_Node_Str",null,null);
    cv.visitLdcInsn(Type.getType("String_Node_Str" + nestedClass.getQualifiedName().replace('.','/') + "String_Node_Str"));
    cv.visitInsn(Constants.ARETURN);
    cv.visitMaxs(1,1);
  }
  cv=cw.visitMethod(Constants.ACC_PROTECTED,"String_Node_Str","String_Node_Str",null,null);
  JavaClass baseComponentClass=getBaseComponentType(componentClass);
  if (baseComponentClass.isPrimitive()) {
    cv.visitFieldInsn(Constants.GETSTATIC,getObjectType(baseComponentClass).getQualifiedName().replace('.','/'),"String_Node_Str","String_Node_Str");
  }
 else {
    cv.visitLdcInsn(Type.getType("String_Node_Str" + baseComponentClass.getQualifiedName().replace('.','/') + "String_Node_Str"));
  }
  cv.visitInsn(Constants.ARETURN);
  cv.visitMaxs(1,1);
  RuntimeVisibleAnnotations getAdaptedValueMethodAnnotations=new RuntimeVisibleAnnotations();
  Annotation xmlElementAnnotation=new Annotation("String_Node_Str");
  xmlElementAnnotation.add("String_Node_Str","String_Node_Str");
  xmlElementAnnotation.add("String_Node_Str",Type.getType("String_Node_Str" + getObjectType(nestedClass).getName().replace('.','/') + "String_Node_Str"));
  getAdaptedValueMethodAnnotations.annotations.add(xmlElementAnnotation);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,getAdaptedValueMethodAnnotations);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitFieldInsn(Constants.GETFIELD,qualifiedInternalClassName,"String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.ARETURN);
  cv.visitMaxs(1,1);
  return generateClassFromBytes(qualifiedClassName,cw.toByteArray());
}