Program: 64335
Project: 64335
Buggy source:
/** 
 * <p>INTERNAL: Create a Project using OXM metadata.  The given classloader is expected  to successfully load 'META-INF/eclipselink-dbws-ox.xml'.
 */
protected Project loadOXMetadata(ClassLoader xrdecl){
  Project oxProject=null;
  InputStream inStream=null;
  String searchPath=null;
  for (  String prefix : META_INF_PATHS) {
    searchPath=prefix + Util.DBWS_OX_XML;
    inStream=xrdecl.getResourceAsStream(searchPath);
    if (inStream != null) {
      break;
    }
  }
  if (inStream != null) {
    Map<String,DBWSMetadataSource> metadataMap=new HashMap<String,DBWSMetadataSource>();
    StreamSource xml=new StreamSource(inStream);
    try {
      JAXBContext jc=JAXBContext.newInstance(XmlBindingsModel.class);
      Unmarshaller unmarshaller=jc.createUnmarshaller();
      JAXBElement<XmlBindingsModel> jaxbElt=unmarshaller.unmarshal(xml,XmlBindingsModel.class);
      XmlBindingsModel model=jaxbElt.getValue();
      for (      XmlBindings xmlBindings : model.getBindingsList()) {
        metadataMap.put(xmlBindings.getPackageName(),new DBWSMetadataSource(xmlBindings));
      }
    }
 catch (    JAXBException jaxbex) {
      throw new DBWSException(OXM_PROCESSING_EX,jaxbex);
    }
    Map<String,Map<String,DBWSMetadataSource>> properties=new HashMap<String,Map<String,DBWSMetadataSource>>();
    properties.put(JAXBContextProperties.OXM_METADATA_SOURCE,metadataMap);
    try {
      DynamicJAXBContext jCtx=DynamicJAXBContextFactory.createContextFromOXM(xrdecl,properties);
      oxProject=jCtx.getXMLContext().getSession(0).getProject();
      if (oxProject.getAliasDescriptors() != null) {
        Map<String,ClassDescriptor> aliasDescriptors=new HashMap<String,ClassDescriptor>();
        for (        Object key : oxProject.getAliasDescriptors().keySet()) {
          XMLDescriptor xdesc=(XMLDescriptor)oxProject.getAliasDescriptors().get(key.toString());
          String defaultRootElement=xdesc.getDefaultRootElement();
          String proposedAlias=defaultRootElement;
          if (proposedAlias.endsWith(TYPE_STR)) {
            proposedAlias=proposedAlias.substring(0,proposedAlias.lastIndexOf(TYPE_STR));
          }
          xdesc.setAlias(proposedAlias);
          aliasDescriptors.put(proposedAlias,xdesc);
          for (          DatabaseMapping mapping : xdesc.getMappings()) {
            if (mapping instanceof XMLBinaryDataMapping) {
              ((XMLBinaryDataMapping)mapping).setAttributeClassification(APBYTE);
              ((XMLBinaryDataMapping)mapping).setAttributeClassificationName(APBYTE.getName());
            }
          }
        }
        oxProject.setAliasDescriptors(aliasDescriptors);
      }
    }
 catch (    JAXBException e) {
      throw new DBWSException(OXM_PROCESSING_EX,e);
    }
  }
  return oxProject == null ? new SimpleXMLFormatProject() : oxProject;
}

Fixed version (ground truth):
/** 
 * <p>INTERNAL: Create a Project using OXM metadata.  The given classloader is expected  to successfully load 'META-INF/eclipselink-dbws-ox.xml'.
 */
protected Project loadOXMetadata(ClassLoader xrdecl){
  Project oxProject=null;
  InputStream inStream=null;
  String searchPath=null;
  for (  String prefix : META_INF_PATHS) {
    searchPath=prefix + Util.DBWS_OX_XML;
    inStream=xrdecl.getResourceAsStream(searchPath);
    if (inStream != null) {
      break;
    }
  }
  if (inStream != null) {
    Map<String,DBWSMetadataSource> metadataMap=null;
    StreamSource xml=new StreamSource(inStream);
    try {
      JAXBContext jc=JAXBContext.newInstance(XmlBindingsModel.class);
      Unmarshaller unmarshaller=jc.createUnmarshaller();
      JAXBElement<XmlBindingsModel> jaxbElt=unmarshaller.unmarshal(xml,XmlBindingsModel.class);
      XmlBindingsModel model=jaxbElt.getValue();
      if (model.getBindingsList() != null) {
        metadataMap=new HashMap<String,DBWSMetadataSource>();
        for (        XmlBindings xmlBindings : model.getBindingsList()) {
          metadataMap.put(xmlBindings.getPackageName(),new DBWSMetadataSource(xmlBindings));
        }
      }
    }
 catch (    JAXBException jaxbex) {
      throw new DBWSException(OXM_PROCESSING_EX,jaxbex);
    }
    if (metadataMap != null) {
      Map<String,Map<String,DBWSMetadataSource>> properties=new HashMap<String,Map<String,DBWSMetadataSource>>();
      properties.put(JAXBContextProperties.OXM_METADATA_SOURCE,metadataMap);
      try {
        DynamicJAXBContext jCtx=DynamicJAXBContextFactory.createContextFromOXM(xrdecl,properties);
        oxProject=jCtx.getXMLContext().getSession(0).getProject();
        if (oxProject.getAliasDescriptors() != null) {
          Map<String,ClassDescriptor> aliasDescriptors=new HashMap<String,ClassDescriptor>();
          for (          Object key : oxProject.getAliasDescriptors().keySet()) {
            XMLDescriptor xdesc=(XMLDescriptor)oxProject.getAliasDescriptors().get(key.toString());
            String defaultRootElement=xdesc.getDefaultRootElement();
            String proposedAlias=defaultRootElement;
            if (proposedAlias.endsWith(TYPE_STR)) {
              proposedAlias=proposedAlias.substring(0,proposedAlias.lastIndexOf(TYPE_STR));
            }
            xdesc.setAlias(proposedAlias);
            aliasDescriptors.put(proposedAlias,xdesc);
            for (            DatabaseMapping mapping : xdesc.getMappings()) {
              if (mapping instanceof XMLBinaryDataMapping) {
                ((XMLBinaryDataMapping)mapping).setAttributeClassification(APBYTE);
                ((XMLBinaryDataMapping)mapping).setAttributeClassificationName(APBYTE.getName());
              }
            }
          }
          oxProject.setAliasDescriptors(aliasDescriptors);
        }
      }
 catch (      JAXBException e) {
        throw new DBWSException(OXM_PROCESSING_EX,e);
      }
    }
  }
  return oxProject;
}