Program: 21631
Project: 21631
Buggy source:
public void loadObjects() throws Exception {
  OTXMLElement rootElement=document.getRootElement();
  String dbBase=rootElement.getAttributeValue("String_Node_Str");
  if (System.getProperty("String_Node_Str",null) != null) {
    dbBase=System.getProperty("String_Node_Str");
  }
  if (dbBase != null && dbBase.length() > 0) {
    if (!dbBase.endsWith("String_Node_Str")) {
      dbBase+="String_Node_Str";
    }
    dbBase+="String_Node_Str";
    try {
      contextURL=new URL(dbBase);
    }
 catch (    MalformedURLException e) {
      e.printStackTrace();
    }
  }
  TypeService typeService=new TypeService(contextURL);
  ObjectTypeHandler objectTypeHandler=new ObjectTypeHandler(typeService,this);
  typeService.registerUserType("String_Node_Str",objectTypeHandler);
  String dbId=rootElement.getAttributeValue("String_Node_Str");
  if (dbId != null && dbId.length() > 0) {
    databaseId=OTIDFactory.createOTID(dbId);
  }
  OTXMLElement importsElement=rootElement.getChild("String_Node_Str");
  List imports=importsElement.getChildren();
  for (Iterator iterator=imports.iterator(); iterator.hasNext(); ) {
    OTXMLElement currentImport=(OTXMLElement)iterator.next();
    String className=currentImport.getAttributeValue("String_Node_Str");
    importedOTObjectClasses.add(className);
    Class packageClass=findPackageClass(className);
    if (packageClass != null && !packageClasses.contains(packageClass)) {
      packageClasses.add(packageClass);
    }
  }
  ReflectionTypeDefinitions.registerTypes(importedOTObjectClasses,typeService,this);
  OTXMLElement objects=rootElement.getChild("String_Node_Str");
  List xmlObjects=objects.getChildren();
  if (xmlObjects.size() != 1) {
    throw new Exception("String_Node_Str");
  }
  OTXMLElement rootObjectNode=(OTXMLElement)xmlObjects.get(0);
  String relativePath="String_Node_Str";
  if (databaseId != null) {
    relativePath=databaseId.toExternalForm() + "String_Node_Str";
  }
  XMLDataObject rootDataObject=(XMLDataObject)typeService.handleLiteralElement(rootObjectNode,relativePath);
  statusStream.println("String_Node_Str");
  secondPass();
  setRoot(rootDataObject.getGlobalId());
}

Fixed version (ground truth):
public void loadObjects() throws Exception {
  OTXMLElement rootElement=document.getRootElement();
  String dbCodeBase=rootElement.getAttributeValue("String_Node_Str");
  String systemCodeBase=OTViewerHelper.getStringProp(OTViewerHelper.CODEBASE_PROP);
  if (systemCodeBase != null) {
    dbCodeBase=systemCodeBase;
  }
  if (dbCodeBase != null && dbCodeBase.length() > 0) {
    if (!dbCodeBase.endsWith("String_Node_Str")) {
      dbCodeBase+="String_Node_Str";
    }
    dbCodeBase+="String_Node_Str";
    try {
      contextURL=new URL(dbCodeBase);
    }
 catch (    MalformedURLException e) {
      e.printStackTrace();
    }
  }
  TypeService typeService=new TypeService(contextURL);
  ObjectTypeHandler objectTypeHandler=new ObjectTypeHandler(typeService,this);
  typeService.registerUserType("String_Node_Str",objectTypeHandler);
  String dbId=rootElement.getAttributeValue("String_Node_Str");
  if (dbId != null && dbId.length() > 0) {
    databaseId=OTIDFactory.createOTID(dbId);
  }
  OTXMLElement importsElement=rootElement.getChild("String_Node_Str");
  List imports=importsElement.getChildren();
  for (Iterator iterator=imports.iterator(); iterator.hasNext(); ) {
    OTXMLElement currentImport=(OTXMLElement)iterator.next();
    String className=currentImport.getAttributeValue("String_Node_Str");
    importedOTObjectClasses.add(className);
    Class packageClass=findPackageClass(className);
    if (packageClass != null && !packageClasses.contains(packageClass)) {
      packageClasses.add(packageClass);
    }
  }
  ReflectionTypeDefinitions.registerTypes(importedOTObjectClasses,typeService,this);
  OTXMLElement objects=rootElement.getChild("String_Node_Str");
  List xmlObjects=objects.getChildren();
  if (xmlObjects.size() != 1) {
    throw new Exception("String_Node_Str");
  }
  OTXMLElement rootObjectNode=(OTXMLElement)xmlObjects.get(0);
  String relativePath="String_Node_Str";
  if (databaseId != null) {
    relativePath=databaseId.toExternalForm() + "String_Node_Str";
  }
  XMLDataObject rootDataObject=(XMLDataObject)typeService.handleLiteralElement(rootObjectNode,relativePath);
  statusStream.println("String_Node_Str");
  secondPass();
  setRoot(rootDataObject.getGlobalId());
}