Program: 149820
Project: 149820
Buggy source:
/** 
 * Utility to create a java.lang.Class for the given type using the given type reference
 */
protected static Class<?> createClassForType(VM_Type type,VM_TypeReference typeRef){
  if (VM.runningVM) {
    return java.lang.JikesRVMSupport.createClass(type);
  }
 else {
    Exception x;
    try {
      VM_Atom className=typeRef.getName();
      if (className.isAnnotationClass()) {
        return Class.forName(className.annotationClassToAnnotationInterface(),false,VM_Type.class.getClassLoader());
      }
 else       if (className.isClassDescriptor()) {
        return Class.forName(className.classNameFromDescriptor(),false,VM_Type.class.getClassLoader());
      }
 else {
        String classNameString=className.toString();
        if (classNameString.equals("String_Node_Str")) {
          return void.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return int.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return long.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return float.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return double.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return char.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return short.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return boolean.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return byte.class;
        }
 else {
          return Class.forName(classNameString.replace('/','.'),false,VM_Type.class.getClassLoader());
        }
      }
    }
 catch (    ClassNotFoundException e) {
      x=e;
    }
catch (    SecurityException e) {
      x=e;
    }
    if (typeRef.isArrayType() && typeRef.getArrayElementType().isCodeType()) {
      return null;
    }
 else     if (!VM.runningVM) {
      VM.sysWriteln("String_Node_Str");
      x.printStackTrace();
      return null;
    }
 else {
      throw new Error("String_Node_Str",x);
    }
  }
}

Fixed version (ground truth):
/** 
 * Utility to create a java.lang.Class for the given type using the given type reference
 */
protected static Class<?> createClassForType(VM_Type type,VM_TypeReference typeRef){
  if (VM.runningVM) {
    return java.lang.JikesRVMSupport.createClass(type);
  }
 else {
    Exception x;
    try {
      VM_Atom className=typeRef.getName();
      if (className.isAnnotationClass()) {
        return Class.forName(className.annotationClassToAnnotationInterface(),false,VM_Type.class.getClassLoader());
      }
 else       if (className.isClassDescriptor()) {
        return Class.forName(className.classNameFromDescriptor(),false,VM_Type.class.getClassLoader());
      }
 else {
        String classNameString=className.toString();
        if (classNameString.equals("String_Node_Str")) {
          return void.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return int.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return long.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return float.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return double.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return char.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return short.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return boolean.class;
        }
 else         if (classNameString.equals("String_Node_Str")) {
          return byte.class;
        }
 else {
          return Class.forName(classNameString.replace('/','.'),false,VM_Type.class.getClassLoader());
        }
      }
    }
 catch (    ClassNotFoundException e) {
      x=e;
    }
catch (    SecurityException e) {
      x=e;
    }
    if (typeRef.isArrayType() && typeRef.getArrayElementType().isCodeType()) {
      return VM_CodeArray.class;
    }
 else     if (!VM.runningVM) {
      VM.sysWriteln("String_Node_Str");
      x.printStackTrace();
      return null;
    }
 else {
      throw new Error("String_Node_Str",x);
    }
  }
}