Program: 75139
Project: 75139
Buggy source:
/** 
 * Check if the given name refers to an array class. If so, load the array class.
 * @param name The name of the class to be loaded.
 * @param resolve Whether to resolve the class.
 * @return The class loaded if not <tt>null</tt>. If the name doesnot refer to an array class, the return value is <tt>null</tt>.
 * @throws ClassNotFoundException Thrown when the name refers toan array class but the class cannot be loaded.
 * @see #searchForClass(StringBuffer,boolean,Class)
 */
private Class _checkArrayClass(StringBuffer name,boolean resolve) throws ClassNotFoundException {
  boolean isPrimitiveArray;
  int nameStart=0;
  int nameEnd=name.length() - 1;
  if (name.charAt(nameStart) == '[') {
    while (name.charAt(nameStart) == '[')     nameStart++;
    if (name.charAt(nameStart) == 'L') {
      nameStart++;
      nameEnd--;
      isPrimitiveArray=false;
    }
 else     isPrimitiveArray=true;
  }
 else   if (name.charAt(nameEnd) == ']') {
    while (name.charAt(nameEnd) == ']')     nameEnd-=2;
    isPrimitiveArray=Type.isPrimitive(name.substring(nameStart,nameEnd + 1));
  }
 else   return null;
  if (isPrimitiveArray) {
    String typeName=Type.toArrayType(name.toString());
    Class c=super.loadClass(typeName,resolve);
    _loadedClasses.put(typeName,c);
    return c;
  }
 else {
    Class c=loadClass(name.substring(nameStart,nameEnd + 1));
    name.delete(nameStart,nameEnd + 1);
    name.insert(nameStart,c.getName());
    String typeName=Type.toArrayType(name.toString());
    c=Class.forName(typeName);
    _loadedClasses.put(typeName,c);
    return c;
  }
}

Fixed version (ground truth):
/** 
 * Check if the given name refers to an array class. If so, load the array class.
 * @param name The name of the class to be loaded.
 * @param resolve Whether to resolve the class.
 * @return The class loaded if not <tt>null</tt>. If the name doesnot refer to an array class, the return value is <tt>null</tt>.
 * @throws ClassNotFoundException Thrown when the name refers toan array class but the class cannot be loaded.
 * @see #searchForClass(StringBuffer,boolean,Class)
 */
private Class _checkArrayClass(StringBuffer name,boolean resolve) throws ClassNotFoundException {
  boolean isPrimitiveArray;
  int nameStart=0;
  int nameEnd=name.length() - 1;
  if (name.charAt(nameStart) == '[') {
    while (name.charAt(nameStart) == '[')     nameStart++;
    if (name.charAt(nameStart) == 'L') {
      nameStart++;
      nameEnd--;
      isPrimitiveArray=false;
    }
 else     isPrimitiveArray=true;
  }
 else   if (name.charAt(nameEnd) == ']') {
    while (name.charAt(nameEnd) == ']')     nameEnd-=2;
    isPrimitiveArray=Type.isPrimitive(name.substring(nameStart,nameEnd + 1));
  }
 else   return null;
  if (isPrimitiveArray) {
    String typeName=Type.toArrayType(name.toString());
    Class c=super.loadClass(typeName,resolve);
    _loadedClasses.put(typeName,c);
    return c;
  }
 else {
    Class c=loadClass(name.substring(nameStart,nameEnd + 1));
    name.delete(nameStart,nameEnd + 1);
    name.insert(nameStart,c.getName());
    String typeName=Type.toArrayType(name.toString());
    c=Class.forName(typeName,true,_urlClassLoader);
    _loadedClasses.put(typeName,c);
    return c;
  }
}