Program: 64921
Project: 64921
Buggy source:
private void generateManyValueClass(ClassWriter cw,TypeMappingInfo typeMappingInfo,String namespace,Class superType,String classNameSeparatedBySlash,JavaClass componentType,JavaClass containerType){
  String componentClassNameSeparatedBySlash=getObjectType(componentType).getQualifiedName().replace(DOT_CHR,SLASH_CHR);
  String containerClassNameSeperatedBySlash=containerType.getQualifiedName().replace(DOT_CHR,SLASH_CHR);
  if ("String_Node_Str".equals(componentClassNameSeparatedBySlash)) {
    cw.visit(Opcodes.V1_5,Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,classNameSeparatedBySlash,"String_Node_Str" + Type.getInternalName(superType) + "String_Node_Str"+ componentClassNameSeparatedBySlash+ "String_Node_Str",Type.getInternalName(superType),null);
  }
 else {
    cw.visit(Opcodes.V1_5,Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,classNameSeparatedBySlash,"String_Node_Str" + Type.getInternalName(superType) + "String_Node_Str"+ componentClassNameSeparatedBySlash+ "String_Node_Str",Type.getInternalName(superType),null);
  }
  AnnotationVisitor av=cw.visitAnnotation("String_Node_Str",true);
  if (null != namespace) {
    av.visit("String_Node_Str",namespace);
  }
  if (classNameSeparatedBySlash.startsWith(ARRAY_PACKAGE_NAME.replace('.','/')) && classNameSeparatedBySlash.contains("String_Node_Str")) {
    av.visit("String_Node_Str",classNameSeparatedBySlash.substring(classNameSeparatedBySlash.lastIndexOf('/') + 1));
  }
  av.visitEnd();
  MethodVisitor mv=cw.visitMethod(Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  mv.visitCode();
  mv.visitVarInsn(Opcodes.ALOAD,0);
  mv.visitMethodInsn(Opcodes.INVOKESPECIAL,Type.getInternalName(superType),"String_Node_Str","String_Node_Str");
  mv.visitInsn(Opcodes.RETURN);
  mv.visitMaxs(1,1);
  mv.visitEnd();
  if ("String_Node_Str".equals(componentClassNameSeparatedBySlash)) {
    mv=cw.visitMethod(Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str","String_Node_Str" + componentClassNameSeparatedBySlash + "String_Node_Str",null);
  }
 else {
    mv=cw.visitMethod(Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str","String_Node_Str" + componentClassNameSeparatedBySlash + "String_Node_Str",null);
  }
  boolean hasXmlList=false;
  Annotation[] annotations;
  if (typeMappingInfo != null && ((annotations=getAnnotations(typeMappingInfo)) != null)) {
    for (    Annotation annotation : annotations) {
      if (!(annotation instanceof XmlElement || annotation instanceof XmlJavaTypeAdapter)) {
        Class<? extends Annotation> annotationType=annotation.annotationType();
        if (annotation instanceof XmlList) {
          hasXmlList=true;
        }
        av=mv.visitAnnotation(L + annotationType.getName().replace(DOT_CHR,SLASH_CHR) + SEMI_COLON,true);
        for (        Method next : annotation.annotationType().getDeclaredMethods()) {
          try {
            Object nextValue=next.invoke(annotation,new Object[]{});
            if (nextValue instanceof Class) {
              nextValue=Type.getType(L + ((Class)nextValue).getName().replace(DOT_CHR,SLASH_CHR) + SEMI_COLON);
            }
            av.visit(next.getName(),nextValue);
          }
 catch (          InvocationTargetException ex) {
          }
catch (          IllegalAccessException ex) {
          }
        }
        av.visitEnd();
      }
    }
  }
  if (hasXmlList) {
    av=mv.visitAnnotation("String_Node_Str",true);
    av.visitEnd();
  }
 else {
    av=mv.visitAnnotation("String_Node_Str",true);
    av.visit("String_Node_Str",ITEM);
    av.visit("String_Node_Str",true);
    av.visitEnd();
  }
  mv.visitCode();
  mv.visitVarInsn(Opcodes.ALOAD,0);
  mv.visitMethodInsn(Opcodes.INVOKESPECIAL,Type.getInternalName(superType),"String_Node_Str","String_Node_Str");
  mv.visitInsn(Opcodes.ARETURN);
  mv.visitMaxs(1,1);
  mv.visitEnd();
  mv=cw.visitMethod(Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str","String_Node_Str" + componentClassNameSeparatedBySlash + "String_Node_Str",null);
  mv.visitCode();
  mv.visitVarInsn(Opcodes.ALOAD,0);
  mv.visitVarInsn(Opcodes.ALOAD,1);
  mv.visitMethodInsn(Opcodes.INVOKESPECIAL,Type.getInternalName(superType),"String_Node_Str","String_Node_Str");
  mv.visitInsn(Opcodes.RETURN);
  mv.visitMaxs(2,2);
  mv.visitEnd();
  mv=cw.visitMethod(Opcodes.ACC_PROTECTED,"String_Node_Str","String_Node_Str","String_Node_Str",null);
  mv.visitCode();
  if (componentType.isPrimitive()) {
    mv.visitFieldInsn(Opcodes.GETSTATIC,getObjectType(componentType).getQualifiedName().replace(DOT_CHR,SLASH_CHR),"String_Node_Str","String_Node_Str");
  }
 else {
    if (containerClassNameSeperatedBySlash.contains("String_Node_Str")) {
      mv.visitLdcInsn(Type.getType(containerClassNameSeperatedBySlash));
    }
 else {
      mv.visitLdcInsn(Type.getType("String_Node_Str" + containerClassNameSeperatedBySlash + "String_Node_Str"));
    }
  }
  mv.visitInsn(Opcodes.ARETURN);
  mv.visitMaxs(1,1);
  mv.visitEnd();
}

Fixed version (ground truth):
private void generateManyValueClass(ClassWriter cw,TypeMappingInfo typeMappingInfo,String namespace,Class superType,String classNameSeparatedBySlash,JavaClass componentType,JavaClass containerType){
  String componentClassNameSeparatedBySlash=getObjectType(componentType).getQualifiedName().replace(DOT_CHR,SLASH_CHR);
  String containerClassNameSeperatedBySlash=containerType.getQualifiedName().replace(DOT_CHR,SLASH_CHR);
  if ("String_Node_Str".equals(componentClassNameSeparatedBySlash)) {
    cw.visit(Opcodes.V1_5,Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,classNameSeparatedBySlash,"String_Node_Str" + Type.getInternalName(superType) + "String_Node_Str"+ componentClassNameSeparatedBySlash+ "String_Node_Str",Type.getInternalName(superType),null);
  }
 else {
    cw.visit(Opcodes.V1_5,Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER,classNameSeparatedBySlash,"String_Node_Str" + Type.getInternalName(superType) + "String_Node_Str"+ componentClassNameSeparatedBySlash+ "String_Node_Str",Type.getInternalName(superType),null);
  }
  AnnotationVisitor av=cw.visitAnnotation("String_Node_Str",true);
  if (null != namespace) {
    av.visit("String_Node_Str",namespace);
  }
  if (classNameSeparatedBySlash.startsWith(ARRAY_PACKAGE_NAME.replace('.','/')) && classNameSeparatedBySlash.contains("String_Node_Str")) {
    av.visit("String_Node_Str",classNameSeparatedBySlash.substring(classNameSeparatedBySlash.lastIndexOf('/') + 1));
  }
  av.visitEnd();
  MethodVisitor mv=cw.visitMethod(Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  mv.visitCode();
  mv.visitVarInsn(Opcodes.ALOAD,0);
  mv.visitMethodInsn(Opcodes.INVOKESPECIAL,Type.getInternalName(superType),"String_Node_Str","String_Node_Str");
  mv.visitInsn(Opcodes.RETURN);
  mv.visitMaxs(1,1);
  mv.visitEnd();
  if (!componentType.isPrimitive() && ArrayValue.class.isAssignableFrom(superType)) {
    mv=cw.visitMethod(Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
    mv.visitCode();
    mv.visitVarInsn(Opcodes.ALOAD,0);
    mv.visitFieldInsn(Opcodes.GETFIELD,classNameSeparatedBySlash,"String_Node_Str","String_Node_Str");
    Label l0=new Label();
    mv.visitJumpInsn(Opcodes.IFNONNULL,l0);
    mv.visitInsn(Opcodes.ACONST_NULL);
    mv.visitInsn(Opcodes.ARETURN);
    mv.visitLabel(l0);
    mv.visitFrame(Opcodes.F_SAME,0,null,0,null);
    mv.visitVarInsn(Opcodes.ALOAD,0);
    mv.visitFieldInsn(Opcodes.GETFIELD,classNameSeparatedBySlash,"String_Node_Str","String_Node_Str");
    mv.visitMethodInsn(Opcodes.INVOKEINTERFACE,"String_Node_Str","String_Node_Str","String_Node_Str");
    mv.visitVarInsn(Opcodes.ISTORE,1);
    mv.visitVarInsn(Opcodes.ILOAD,1);
    mv.visitTypeInsn(Opcodes.ANEWARRAY,componentClassNameSeparatedBySlash);
    mv.visitVarInsn(Opcodes.ASTORE,2);
    mv.visitVarInsn(Opcodes.ALOAD,0);
    mv.visitFieldInsn(Opcodes.GETFIELD,classNameSeparatedBySlash,"String_Node_Str","String_Node_Str");
    mv.visitVarInsn(Opcodes.ALOAD,2);
    mv.visitMethodInsn(Opcodes.INVOKEINTERFACE,"String_Node_Str","String_Node_Str","String_Node_Str");
    mv.visitInsn(Opcodes.POP);
    mv.visitVarInsn(Opcodes.ALOAD,2);
    mv.visitInsn(Opcodes.ARETURN);
    mv.visitMaxs(2,3);
    mv.visitEnd();
    mv=cw.visitMethod(Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
    mv.visitCode();
    mv.visitVarInsn(Opcodes.ALOAD,1);
    mv.visitTypeInsn(Opcodes.CHECKCAST,"String_Node_Str" + componentClassNameSeparatedBySlash + "String_Node_Str");
    mv.visitVarInsn(Opcodes.ASTORE,2);
    mv.visitVarInsn(Opcodes.ALOAD,0);
    mv.visitVarInsn(Opcodes.ALOAD,2);
    mv.visitMethodInsn(Opcodes.INVOKESTATIC,"String_Node_Str","String_Node_Str","String_Node_Str");
    mv.visitFieldInsn(Opcodes.PUTFIELD,classNameSeparatedBySlash,"String_Node_Str","String_Node_Str");
    mv.visitInsn(Opcodes.RETURN);
    mv.visitMaxs(2,3);
    mv.visitEnd();
  }
  if ("String_Node_Str".equals(componentClassNameSeparatedBySlash)) {
    mv=cw.visitMethod(Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str","String_Node_Str" + componentClassNameSeparatedBySlash + "String_Node_Str",null);
  }
 else {
    mv=cw.visitMethod(Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str","String_Node_Str" + componentClassNameSeparatedBySlash + "String_Node_Str",null);
  }
  boolean hasXmlList=false;
  Annotation[] annotations;
  if (typeMappingInfo != null && ((annotations=getAnnotations(typeMappingInfo)) != null)) {
    for (    Annotation annotation : annotations) {
      if (!(annotation instanceof XmlElement || annotation instanceof XmlJavaTypeAdapter)) {
        Class<? extends Annotation> annotationType=annotation.annotationType();
        if (annotation instanceof XmlList) {
          hasXmlList=true;
        }
        av=mv.visitAnnotation(L + annotationType.getName().replace(DOT_CHR,SLASH_CHR) + SEMI_COLON,true);
        for (        Method next : annotation.annotationType().getDeclaredMethods()) {
          try {
            Object nextValue=next.invoke(annotation,new Object[]{});
            if (nextValue instanceof Class) {
              nextValue=Type.getType(L + ((Class)nextValue).getName().replace(DOT_CHR,SLASH_CHR) + SEMI_COLON);
            }
            av.visit(next.getName(),nextValue);
          }
 catch (          InvocationTargetException ex) {
          }
catch (          IllegalAccessException ex) {
          }
        }
        av.visitEnd();
      }
    }
  }
  if (hasXmlList) {
    av=mv.visitAnnotation("String_Node_Str",true);
    av.visitEnd();
  }
 else {
    av=mv.visitAnnotation("String_Node_Str",true);
    av.visit("String_Node_Str",ITEM);
    av.visit("String_Node_Str",true);
    av.visitEnd();
  }
  mv.visitCode();
  mv.visitVarInsn(Opcodes.ALOAD,0);
  mv.visitMethodInsn(Opcodes.INVOKESPECIAL,Type.getInternalName(superType),"String_Node_Str","String_Node_Str");
  mv.visitInsn(Opcodes.ARETURN);
  mv.visitMaxs(1,1);
  mv.visitEnd();
  mv=cw.visitMethod(Opcodes.ACC_PUBLIC,"String_Node_Str","String_Node_Str","String_Node_Str" + componentClassNameSeparatedBySlash + "String_Node_Str",null);
  mv.visitCode();
  mv.visitVarInsn(Opcodes.ALOAD,0);
  mv.visitVarInsn(Opcodes.ALOAD,1);
  mv.visitMethodInsn(Opcodes.INVOKESPECIAL,Type.getInternalName(superType),"String_Node_Str","String_Node_Str");
  mv.visitInsn(Opcodes.RETURN);
  mv.visitMaxs(2,2);
  mv.visitEnd();
  mv=cw.visitMethod(Opcodes.ACC_PROTECTED,"String_Node_Str","String_Node_Str","String_Node_Str",null);
  mv.visitCode();
  if (componentType.isPrimitive()) {
    mv.visitFieldInsn(Opcodes.GETSTATIC,getObjectType(componentType).getQualifiedName().replace(DOT_CHR,SLASH_CHR),"String_Node_Str","String_Node_Str");
  }
 else {
    if (containerClassNameSeperatedBySlash.contains("String_Node_Str")) {
      mv.visitLdcInsn(Type.getType(containerClassNameSeperatedBySlash));
    }
 else {
      mv.visitLdcInsn(Type.getType("String_Node_Str" + containerClassNameSeperatedBySlash + "String_Node_Str"));
    }
  }
  mv.visitInsn(Opcodes.ARETURN);
  mv.visitMaxs(1,1);
  mv.visitEnd();
}