Program: 75147
Project: 75147
Buggy source:
/** 
 * Resolve a name within the scope of the given class. The name can be a field name, a method name, or a class relative to that class. If the name is a method name, arguments of the method must be given.
 * @param owner The class from which the name is resolved.
 * @param name The name to be resolved.
 * @param args Not <tt>null</tt> if a method is to be resolved, inwhich case it is the array of formal argument types for that method.
 * @return The type of that name if found.
 * @see #resolveName(ASTName,Type,ASTArguments)
 */
private Type resolveNameFromClass(Class owner,String name,Type[] args){
  if (owner.isArray()) {
    if (name.equals("String_Node_Str") && args == null)     return Type.INT;
 else     if (name.equals("String_Node_Str") && args != null && args.length == 0)     return Type.createType("String_Node_Str");
  }
  if (args == null) {
    Type fieldType=getFieldType(owner,name);
    if (fieldType != null)     return fieldType;
  }
 else {
    Type methodType=getMethodType(owner,name,args);
    if (methodType != null)     return methodType;
  }
  try {
    Class c=_loader.loadClass(name,owner);
    return Type.createType(c.getName());
  }
 catch (  ClassNotFoundException e) {
  }
  Class superclass=owner.getSuperclass();
  if (superclass == null && !owner.getName().equals("String_Node_Str"))   superclass=Object.class;
  if (superclass != null) {
    Type result=resolveNameFromClass(superclass,name,args);
    if (result != null)     return result;
  }
  Type t=null;
  if (previousClassCount < 0) {
    previousClassCount=_previousClasses.size() - 1;
    Class previous=(Class)_previousClasses.get(previousClassCount);
    if (previous != null)     t=resolveNameFromClass(previous,name,args);
  }
 else   if (previousClassCount > 0) {
    previousClassCount--;
    Class previous=(Class)_previousClasses.get(previousClassCount);
    if (previous != null)     t=resolveNameFromClass(previous,name,args);
  }
  previousClassCount=-1;
  return t;
}

Fixed version (ground truth):
/** 
 * Resolve a name within the scope of the given class. The name can be a field name, a method name, or a class relative to that class. If the name is a method name, arguments of the method must be given.
 * @param owner The class from which the name is resolved.
 * @param name The name to be resolved.
 * @param args Not <tt>null</tt> if a method is to be resolved, inwhich case it is the array of formal argument types for that method.
 * @return The type of that name if found.
 * @see #resolveName(ASTName,Type,ASTArguments)
 */
private Type resolveNameFromClass(Class owner,String name,Type[] args){
  if (owner.isArray()) {
    if (name.equals("String_Node_Str") && args == null)     return Type.INT;
 else     if (name.equals("String_Node_Str") && args != null && args.length == 0)     return Type.createType("String_Node_Str");
  }
  if (args == null) {
    Type fieldType=getFieldType(owner,name);
    if (fieldType != null)     return fieldType;
  }
 else {
    Type methodType=getMethodType(owner,name,args);
    if (methodType != null)     return methodType;
  }
  try {
    Class c=_loader.loadClass(name,owner);
    return Type.createType(c.getName());
  }
 catch (  ClassNotFoundException e) {
  }
  Class superclass=owner.getSuperclass();
  if (superclass == null && !owner.getName().equals("String_Node_Str"))   superclass=Object.class;
  if (superclass != null) {
    Type result=resolveNameFromClass(superclass,name,args);
    if (result != null)     return result;
  }
  return null;
}