Program: 81588
Project: 81588
Buggy source:
public void load(CCompilationUnit cu,String oldModule) throws SalsaNotFoundException, VariableDeclarationException {
  int i;
  if (cu.getExtendsName() != null) {
    this.superType=SymbolTable.getTypeSymbol(cu.getExtendsName().name);
    if (this.superType.isInterface)     this.isInterface=true;
  }
 else {
    this.superType=SymbolTable.getTypeSymbol("String_Node_Str");
    this.isInterface=true;
  }
  for (  CName implementsName : cu.getImplementsNames()) {
    this.implementsTypes.add(SymbolTable.getTypeSymbol(implementsName.name));
  }
  if (declaredGenericTypes.size() == 0) {
    for (    CGenericType gt : cu.getName().generic_types) {
      declaredGenericTypes.add(gt.toString());
      addGenericType(gt.toString(),"String_Node_Str");
      TypeSymbol ts=SymbolTable.getTypeSymbol(gt.toString());
    }
  }
  if (cu.behavior_declaration != null && cu.behavior_declaration.implements_names != null) {
    for (    CName implementsName : cu.behavior_declaration.implements_names) {
      implementsTypes.add(SymbolTable.getTypeSymbol(implementsName.name));
    }
  }
  for (  CGenericType generic_type : cu.getName().generic_types) {
    ObjectType ot;
    if (generic_type.bound != null) {
      if (generic_type.name.name.equals("String_Node_Str")) {
        CompilerErrors.printErrorMessage("String_Node_Str",generic_type);
      }
      if (generic_type.modifier.equals("String_Node_Str")) {
        ot=new ObjectType(SymbolTable.getCurrentModule() + generic_type.name.name,SymbolTable.getTypeSymbol(generic_type.bound.name));
      }
 else {
        CompilerErrors.printErrorMessage("String_Node_Str",generic_type);
        ot=null;
      }
    }
 else {
      if (generic_type.name.name.equals("String_Node_Str")) {
        CompilerErrors.printErrorMessage("String_Node_Str",generic_type);
        ot=new ObjectType(SymbolTable.getCurrentModule() + generic_type.name.name);
      }
 else {
        ot=new ObjectType(SymbolTable.getCurrentModule() + generic_type.name.name,SymbolTable.getTypeSymbol("String_Node_Str"));
      }
    }
    SymbolTable.knownTypes.put(ot.getLongSignature(),ot);
    SymbolTable.namespace.put(ot.getName(),ot.getLongSignature());
  }
  ArrayList<MessageSymbol> superclassMessageHandlers=null;
  if (getSuperType() instanceof ActorType) {
    ActorType superType=(ActorType)getSuperType();
    superclassMessageHandlers=new ArrayList<MessageSymbol>();
    for (    MessageSymbol ms : superType.message_handlers)     superclassMessageHandlers.add(ms.copy());
    for (    MessageSymbol ms : superType.overloaded_message_handlers) {
      MessageSymbol copy=ms.copy();
      copy.isOverloadedByParent=true;
      superclassMessageHandlers.add(copy);
    }
  }
 else {
    superclassMessageHandlers=new ArrayList<MessageSymbol>();
  }
  Vector<CConstructor> cv=cu.getConstructors();
  if (cv != null) {
    for (i=0; i < cv.size(); i++) {
      ConstructorSymbol cs=new ConstructorSymbol(i,this,cv.get(i));
      constructors.add(cs);
    }
  }
  if (cv == null || cv.size() == 0) {
    if (cv.size() == 0) {
      ConstructorSymbol cs=new ConstructorSymbol(0,this,new TypeSymbol[]{});
      constructors.add(cs);
    }
  }
  ArrayList<MessageSymbol> childMessageHandlers=new ArrayList<MessageSymbol>();
  Vector<CMessageHandler> mv=cu.getMessageHandlers();
  for (i=0; i < mv.size(); i++) {
    MessageSymbol ms=new MessageSymbol(i,this,mv.get(i));
    childMessageHandlers.add(ms);
  }
  for (i=0; i < superclassMessageHandlers.size(); i++) {
    MessageSymbol sms=superclassMessageHandlers.get(i);
    MessageSymbol overloadedMessageHandler=null;
    for (    MessageSymbol cms : childMessageHandlers) {
      if (sms.matches(cms) == 0) {
        if (overloadedMessageHandler != null) {
          System.err.println("String_Node_Str");
          throw new RuntimeException();
        }
 else {
          overloadedMessageHandler=cms;
        }
      }
    }
    if (overloadedMessageHandler == null) {
      message_handlers.add(sms);
    }
 else {
      message_handlers.add(overloadedMessageHandler);
      childMessageHandlers.remove(overloadedMessageHandler);
      if (!sms.is_abstract) {
        overloaded_message_handlers.add(sms.copy());
      }
    }
  }
  for (  MessageSymbol ms : childMessageHandlers)   message_handlers.add(ms);
  int current=0;
  for (  MessageSymbol ms : message_handlers)   ms.id=current++;
  for (  MessageSymbol ms : overloaded_message_handlers)   ms.id=current++;
  Vector<CLocalVariableDeclaration> fv=cu.getFields();
  for (i=0; i < fv.size(); i++) {
    Vector<CVariableInit> vv=fv.get(i).variables;
    for (int j=0; j < vv.size(); j++) {
      FieldSymbol fs=new FieldSymbol(this,fv.get(i),vv.get(j));
      fields.add(fs);
    }
  }
  SymbolTable.setCurrentModule(oldModule);
}

Fixed version (ground truth):
public void load(CCompilationUnit cu,String oldModule) throws SalsaNotFoundException, VariableDeclarationException {
  int i;
  if (cu.getExtendsName() != null) {
    this.superType=SymbolTable.getTypeSymbol(cu.getExtendsName().name);
    if (this.superType.isInterface)     this.isInterface=true;
  }
 else {
    this.superType=SymbolTable.getTypeSymbol("String_Node_Str");
    this.isInterface=true;
  }
  for (  CName implementsName : cu.getImplementsNames()) {
    this.implementsTypes.add(SymbolTable.getTypeSymbol(implementsName.name));
  }
  if (declaredGenericTypes.size() == 0) {
    for (    CGenericType gt : cu.getName().generic_types) {
      declaredGenericTypes.add(gt.toString());
      addGenericType(gt.toString(),"String_Node_Str");
      TypeSymbol ts=SymbolTable.getTypeSymbol(gt.toString());
    }
  }
  if (cu.behavior_declaration != null && cu.behavior_declaration.implements_names != null) {
    for (    CName implementsName : cu.behavior_declaration.implements_names) {
      implementsTypes.add(SymbolTable.getTypeSymbol(implementsName.name));
    }
  }
  for (  CGenericType generic_type : cu.getName().generic_types) {
    ObjectType ot;
    if (generic_type.bound != null) {
      if (generic_type.name.name.equals("String_Node_Str")) {
        CompilerErrors.printErrorMessage("String_Node_Str",generic_type);
      }
      if (generic_type.modifier.equals("String_Node_Str")) {
        ot=new ObjectType(SymbolTable.getCurrentModule() + generic_type.name.name,SymbolTable.getTypeSymbol(generic_type.bound.name));
      }
 else {
        CompilerErrors.printErrorMessage("String_Node_Str",generic_type);
        ot=null;
      }
    }
 else {
      if (generic_type.name.name.equals("String_Node_Str")) {
        CompilerErrors.printErrorMessage("String_Node_Str",generic_type);
        ot=new ObjectType(SymbolTable.getCurrentModule() + generic_type.name.name);
      }
 else {
        ot=new ObjectType(SymbolTable.getCurrentModule() + generic_type.name.name,SymbolTable.getTypeSymbol("String_Node_Str"));
      }
    }
    SymbolTable.knownTypes.put(ot.getLongSignature(),ot);
    SymbolTable.namespace.put(ot.getName(),ot.getLongSignature());
  }
  ArrayList<MessageSymbol> superclassMessageHandlers=null;
  if (getSuperType() instanceof ActorType) {
    ActorType superType=(ActorType)getSuperType();
    superclassMessageHandlers=new ArrayList<MessageSymbol>();
    for (    MessageSymbol ms : superType.message_handlers)     superclassMessageHandlers.add(ms.copy());
    for (    MessageSymbol ms : superType.overloaded_message_handlers) {
      MessageSymbol copy=ms.copy();
      copy.isOverloadedByParent=true;
      superclassMessageHandlers.add(copy);
    }
  }
 else {
    superclassMessageHandlers=new ArrayList<MessageSymbol>();
  }
  Vector<CConstructor> cv=cu.getConstructors();
  if (cv != null) {
    for (i=0; i < cv.size(); i++) {
      ConstructorSymbol cs=new ConstructorSymbol(i,this,cv.get(i));
      constructors.add(cs);
    }
  }
  if (cv == null || cv.size() == 0) {
    if (cv.size() == 0) {
      ConstructorSymbol cs=new ConstructorSymbol(0,this,new TypeSymbol[]{});
      constructors.add(cs);
    }
  }
  ArrayList<MessageSymbol> childMessageHandlers=new ArrayList<MessageSymbol>();
  Vector<CMessageHandler> mv=cu.getMessageHandlers();
  for (i=0; i < mv.size(); i++) {
    MessageSymbol ms=new MessageSymbol(i,this,mv.get(i));
    childMessageHandlers.add(ms);
  }
  for (i=0; i < superclassMessageHandlers.size(); i++) {
    MessageSymbol sms=superclassMessageHandlers.get(i);
    MessageSymbol overloadedMessageHandler=null;
    for (    MessageSymbol cms : childMessageHandlers) {
      if (sms.matches(cms) == 0) {
        if (overloadedMessageHandler != null) {
          System.err.println("String_Node_Str");
          throw new RuntimeException();
        }
 else {
          overloadedMessageHandler=cms;
        }
      }
    }
    if (overloadedMessageHandler == null) {
      message_handlers.add(sms);
    }
 else {
      message_handlers.add(overloadedMessageHandler);
      childMessageHandlers.remove(overloadedMessageHandler);
      if (!sms.is_abstract) {
        overloaded_message_handlers.add(sms.copy());
      }
    }
  }
  for (  MessageSymbol ms : childMessageHandlers)   message_handlers.add(ms);
  int current=0;
  for (  MessageSymbol ms : message_handlers)   ms.id=current++;
  for (  MessageSymbol ms : overloaded_message_handlers)   ms.id=current++;
  for (  MessageSymbol ms : message_handlers) {
  }
  for (  MessageSymbol ms : overloaded_message_handlers) {
  }
  Vector<CLocalVariableDeclaration> fv=cu.getFields();
  for (i=0; i < fv.size(); i++) {
    Vector<CVariableInit> vv=fv.get(i).variables;
    for (int j=0; j < vv.size(); j++) {
      FieldSymbol fs=new FieldSymbol(this,fv.get(i),vv.get(j));
      fields.add(fs);
    }
  }
  SymbolTable.setCurrentModule(oldModule);
}