Program: 75082
Project: 75082
Buggy source:
/** 
 * Visit an type declaration and set the current class to be the  {@link Class} object loaded with the same (internal) name. Ascope is opened for field declarations in it.
 * @param node The node to be visited.
 * @return The return value of the overriden function.
 */
public boolean visit(TypeDeclaration node){
  String typeName=node.getName().getIdentifier();
  Class currentClass=_state.getCurrentClass();
  try {
    if (currentClass != null) {
      typeName=currentClass.getName() + "String_Node_Str" + typeName;
      currentClass=_state.getClassLoader().searchForClass(typeName);
    }
 else     currentClass=_state.getClassLoader().searchForClass(typeName);
    _state.enterClass(currentClass);
  }
 catch (  ClassNotFoundException e) {
    throw new ASTClassNotFoundException(typeName);
  }
  addCrossAnalyzedType(currentClass.getName());
  _openScope();
  _state.setClassScope();
  _recordFields();
  _sortBodyDeclarations(node);
  if (_handlers.hasClassHandler()) {
    List handlerList=_handlers.getClassHandlers();
    Iterator handlersIter=handlerList.iterator();
    while (handlersIter.hasNext()) {
      ClassHandler handler=(ClassHandler)handlersIter.next();
      handler.enter(node,_state);
    }
  }
  return super.visit(node);
}

Fixed version (ground truth):
/** 
 * Visit an type declaration and set the current class to be the  {@link Class} object loaded with the same (internal) name. Ascope is opened for field declarations in it.
 * @param node The node to be visited.
 * @return The return value of the overriden function.
 */
public boolean visit(TypeDeclaration node){
  String typeName=node.getName().getIdentifier();
  Class currentClass=_state.getCurrentClass();
  if (currentClass == null) {
    try {
      currentClass=_state.getClassLoader().searchForClass(typeName);
    }
 catch (    ClassNotFoundException e) {
      throw new ASTClassNotFoundException(typeName);
    }
  }
 else {
    if (!_eclipse_anonymous_scheme) {
      try {
        if (!(node.getParent() instanceof CompilationUnit) && !(node.getParent() instanceof TypeDeclaration))         currentClass=_state.getClassLoader().searchForClass(currentClass.getName() + "String_Node_Str" + typeName);
 else         currentClass=_state.getClassLoader().searchForClass(currentClass.getName() + "String_Node_Str" + typeName);
        typeName=currentClass.getName();
      }
 catch (      ClassNotFoundException e) {
        _eclipse_anonymous_scheme=true;
      }
    }
    if (_eclipse_anonymous_scheme) {
      try {
        typeName=currentClass.getName() + "String_Node_Str" + typeName;
        currentClass=_state.getClassLoader().searchForClass(typeName);
      }
 catch (      ClassNotFoundException e) {
        throw new ASTClassNotFoundException(typeName);
      }
    }
  }
  _state.enterClass(currentClass);
  addCrossAnalyzedType(currentClass.getName());
  _openScope();
  _state.setClassScope();
  _recordFields();
  _sortBodyDeclarations(node);
  if (_handlers.hasClassHandler()) {
    List handlerList=_handlers.getClassHandlers();
    Iterator handlersIter=handlerList.iterator();
    while (handlersIter.hasNext()) {
      ClassHandler handler=(ClassHandler)handlersIter.next();
      handler.enter(node,_state);
    }
  }
  return super.visit(node);
}