Program: 67587
Project: 67587
Buggy source:
public Class generateWrapperClass(String className,String attributeType,boolean isList,QName theQName){
  org.eclipse.persistence.internal.libraries.asm.ClassWriter cw=new org.eclipse.persistence.internal.libraries.asm.ClassWriter(false);
  CodeVisitor cv;
  cw.visit(Constants.V1_5,Constants.ACC_PUBLIC,className.replace("String_Node_Str","String_Node_Str"),org.eclipse.persistence.internal.libraries.asm.Type.getType(Object.class).getInternalName(),new String[]{Type.getType(WrappedValue.class).getInternalName()},null);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str",Type.getMethodDescriptor(Type.VOID_TYPE,new Type[0]),null,null);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitMethodInsn(Constants.INVOKESPECIAL,Type.getType(Object.class).getInternalName(),"String_Node_Str",Type.getMethodDescriptor(Type.VOID_TYPE,new Type[0]));
  cv.visitInsn(Constants.RETURN);
  cv.visitMaxs(1,1);
  String fieldType=null;
  if (isList) {
    fieldType="String_Node_Str";
  }
 else {
    fieldType=attributeType.replace("String_Node_Str","String_Node_Str");
    if (!(fieldType.startsWith("String_Node_Str"))) {
      fieldType="String_Node_Str" + fieldType + "String_Node_Str";
    }
  }
  cw.visitField(Constants.ACC_PUBLIC,"String_Node_Str",fieldType,null,null);
  cw.visitField(Constants.ACC_PRIVATE + Constants.ACC_STATIC,"String_Node_Str","String_Node_Str",null,null);
  cv=cw.visitMethod(Constants.ACC_STATIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitTypeInsn(Constants.NEW,"String_Node_Str");
  cv.visitInsn(Constants.DUP);
  cv.visitLdcInsn(theQName.getNamespaceURI());
  cv.visitLdcInsn(theQName.getLocalPart());
  cv.visitMethodInsn(Constants.INVOKESPECIAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  cv.visitFieldInsn(Constants.PUTSTATIC,className.replace("String_Node_Str","String_Node_Str"),"String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.RETURN);
  cv.visitMaxs(4,0);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str",Type.getMethodDescriptor(Type.getType(Object.class),new Type[]{}),null,null);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitFieldInsn(Constants.GETFIELD,className.replace("String_Node_Str","String_Node_Str"),"String_Node_Str",fieldType);
  cv.visitInsn(Type.getType(Object.class).getOpcode(Constants.IRETURN));
  cv.visitMaxs(1,1);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitVarInsn(Constants.ALOAD,1);
  String castType=fieldType;
  if (castType.endsWith("String_Node_Str") && !castType.startsWith("String_Node_Str")) {
    castType=castType.substring(0,castType.length() - 1);
  }
  if (castType.startsWith("String_Node_Str")) {
    castType=castType.substring(1,castType.length());
  }
  cv.visitTypeInsn(Constants.CHECKCAST,castType);
  cv.visitFieldInsn(Constants.PUTFIELD,className.replace("String_Node_Str","String_Node_Str"),"String_Node_Str",fieldType);
  cv.visitInsn(Constants.RETURN);
  cv.visitMaxs(2,2);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitFieldInsn(Constants.GETSTATIC,className.replace("String_Node_Str","String_Node_Str"),"String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.ARETURN);
  cv.visitMaxs(1,1);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitLdcInsn(Type.getType(fieldType));
  cv.visitInsn(Constants.ARETURN);
  cv.visitMaxs(1,1);
  cw.visitEnd();
  byte[] classBytes=cw.toByteArray();
  JaxbClassLoader loader=(JaxbClassLoader)helper.getClassLoader();
  Class generatedClass=loader.generateClass(className,classBytes);
  return generatedClass;
}

Fixed version (ground truth):
public Class generateWrapperClass(String className,String attributeType,boolean isList,QName theQName){
  org.eclipse.persistence.internal.libraries.asm.ClassWriter cw=new org.eclipse.persistence.internal.libraries.asm.ClassWriter(false);
  CodeVisitor cv;
  cw.visit(Constants.V1_5,Constants.ACC_PUBLIC,className.replace("String_Node_Str","String_Node_Str"),org.eclipse.persistence.internal.libraries.asm.Type.getType(Object.class).getInternalName(),new String[]{Type.getType(WrappedValue.class).getInternalName()},null);
  String fieldType=null;
  if (isList) {
    fieldType="String_Node_Str";
  }
 else {
    fieldType=attributeType.replace("String_Node_Str","String_Node_Str");
    if (!(fieldType.startsWith("String_Node_Str"))) {
      fieldType="String_Node_Str" + fieldType + "String_Node_Str";
    }
  }
  cw.visitField(Constants.ACC_PRIVATE,"String_Node_Str",fieldType,null,null);
  cw.visitField(Constants.ACC_PRIVATE,"String_Node_Str","String_Node_Str",null,null);
  cw.visitField(Constants.ACC_PRIVATE + Constants.ACC_STATIC,"String_Node_Str","String_Node_Str",null,null);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitMethodInsn(Constants.INVOKESPECIAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.RETURN);
  cv.visitMaxs(1,1);
  cv=cw.visitMethod(Constants.ACC_STATIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitTypeInsn(Constants.NEW,"String_Node_Str");
  cv.visitInsn(Constants.DUP);
  cv.visitLdcInsn(theQName.getNamespaceURI());
  cv.visitLdcInsn(theQName.getLocalPart());
  cv.visitMethodInsn(Constants.INVOKESPECIAL,"String_Node_Str","String_Node_Str","String_Node_Str");
  cv.visitFieldInsn(Constants.PUTSTATIC,className.replace("String_Node_Str","String_Node_Str"),"String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.RETURN);
  cv.visitMaxs(4,0);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str",Type.getMethodDescriptor(Type.getType(Object.class),new Type[]{}),null,null);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitFieldInsn(Constants.GETFIELD,className.replace("String_Node_Str","String_Node_Str"),"String_Node_Str",fieldType);
  cv.visitInsn(Type.getType(Object.class).getOpcode(Constants.IRETURN));
  cv.visitMaxs(1,1);
  String castType=fieldType;
  if (castType.endsWith("String_Node_Str") && !castType.startsWith("String_Node_Str")) {
    castType=castType.substring(0,castType.length() - 1);
  }
  if (castType.startsWith("String_Node_Str")) {
    castType=castType.substring(1,castType.length());
  }
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitVarInsn(Constants.ALOAD,1);
  cv.visitTypeInsn(Constants.CHECKCAST,castType);
  cv.visitFieldInsn(Constants.PUTFIELD,className.replace("String_Node_Str","String_Node_Str"),"String_Node_Str",fieldType);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitInsn(Constants.ICONST_1);
  cv.visitFieldInsn(Constants.PUTFIELD,className.replace("String_Node_Str","String_Node_Str"),"String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.RETURN);
  cv.visitMaxs(2,2);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitVarInsn(Constants.ALOAD,0);
  cv.visitFieldInsn(Constants.GETFIELD,className.replace("String_Node_Str","String_Node_Str"),"String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.IRETURN);
  cv.visitMaxs(1,1);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitFieldInsn(Constants.GETSTATIC,className.replace("String_Node_Str","String_Node_Str"),"String_Node_Str","String_Node_Str");
  cv.visitInsn(Constants.ARETURN);
  cv.visitMaxs(1,1);
  cv=cw.visitMethod(Constants.ACC_PUBLIC,"String_Node_Str","String_Node_Str",null,null);
  cv.visitLdcInsn(Type.getType(fieldType));
  cv.visitInsn(Constants.ARETURN);
  cv.visitMaxs(1,1);
  cw.visitEnd();
  byte[] classBytes=cw.toByteArray();
  JaxbClassLoader loader=(JaxbClassLoader)helper.getClassLoader();
  Class generatedClass=loader.generateClass(className,classBytes);
  return generatedClass;
}