Program: 65773
Project: 65773
Buggy source:
public void testNewInstanceXSDImportError() throws Exception {
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  InputStream inputStream=classLoader.getSystemResourceAsStream(EXAMPLE_XSD);
  DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
  docFactory.setNamespaceAware(true);
  DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
  Document xsdDocument=docBuilder.parse(inputStream);
  Element xsdElement=xsdDocument.getDocumentElement();
  Map<String,Object> properties=new HashMap<String,Object>();
  properties.put(DynamicJAXBContextFactory.XML_SCHEMA_KEY,xsdElement);
  NoExtensionEntityResolver re=new NoExtensionEntityResolver();
  properties.put(DynamicJAXBContextFactory.ENTITY_RESOLVER_KEY,re);
  JAXBException caughtEx=null;
  try {
    DynamicJAXBContext jaxbContext=(DynamicJAXBContext)JAXBContext.newInstance("String_Node_Str",classLoader,properties);
    DynamicEntity person=jaxbContext.newDynamicEntity("String_Node_Str");
    assertNotNull("String_Node_Str",person);
    DynamicEntity salary=jaxbContext.newDynamicEntity("String_Node_Str");
    assertNotNull("String_Node_Str",salary);
  }
 catch (  JAXBException e) {
    caughtEx=e;
  }
catch (  Exception e) {
    fail("String_Node_Str" + e);
  }
  org.eclipse.persistence.exceptions.JAXBException jEx=(org.eclipse.persistence.exceptions.JAXBException)caughtEx.getLinkedException();
  assertEquals("String_Node_Str",org.eclipse.persistence.exceptions.JAXBException.XSD_IMPORT_NOT_SOURCE,jEx.getErrorCode());
}

Fixed version (ground truth):
public void testNewInstanceXSDImportError() throws Exception {
  ClassLoader classLoader=Thread.currentThread().getContextClassLoader();
  InputStream inputStream=classLoader.getSystemResourceAsStream(EXAMPLE_XSD);
  DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
  docFactory.setNamespaceAware(true);
  DocumentBuilder docBuilder=docFactory.newDocumentBuilder();
  Document xsdDocument=docBuilder.parse(inputStream);
  Element xsdElement=xsdDocument.getDocumentElement();
  Map<String,Object> properties=new HashMap<String,Object>();
  properties.put(DynamicJAXBContextFactory.XML_SCHEMA_KEY,xsdElement);
  NoExtensionEntityResolver re=new NoExtensionEntityResolver();
  properties.put(DynamicJAXBContextFactory.ENTITY_RESOLVER_KEY,re);
  JAXBException caughtEx=null;
  try {
    DynamicJAXBContext jaxbContext=(DynamicJAXBContext)JAXBContext.newInstance("String_Node_Str",classLoader,properties);
    DynamicEntity person=jaxbContext.newDynamicEntity("String_Node_Str");
    assertNotNull("String_Node_Str",person);
    DynamicEntity salary=jaxbContext.newDynamicEntity("String_Node_Str");
    assertNotNull("String_Node_Str",salary);
  }
 catch (  JAXBException e) {
    caughtEx=e;
  }
catch (  Exception e) {
    fail("String_Node_Str" + e);
  }
  org.eclipse.persistence.exceptions.JAXBException jEx=null;
  Exception currentException=caughtEx;
  while (true) {
    if (currentException instanceof JAXBException) {
      Exception linkedEx=(Exception)((JAXBException)currentException).getLinkedException();
      if (linkedEx instanceof org.eclipse.persistence.exceptions.JAXBException) {
        jEx=(org.eclipse.persistence.exceptions.JAXBException)linkedEx;
        break;
      }
 else {
        currentException=linkedEx;
      }
    }
 else {
      break;
    }
  }
  if (jEx == null) {
    fail("String_Node_Str" + caughtEx);
  }
  assertEquals("String_Node_Str",org.eclipse.persistence.exceptions.JAXBException.XSD_IMPORT_NOT_SOURCE,jEx.getErrorCode());
}