Program: 64062
Project: 64062
Buggy source:
/** 
 * Return the <i>JAXBContext</i> that corresponds to the domain class.  This method does the following: <ol> <li>If an EclipseLink JAXB (MOXy) <i>JAXBContext</i> is available from a <i>ContextResolver</i> then use it.</li> <li>If an existing <i>JAXBContext</i> was not found in step one, then  create a new one on the domain class.</li> </ol>
 * @param domainClass - The domain class we need a <i>JAXBContext</i> for.
 * @param annotations - The annotations corresponding to domain object.
 * @param mediaType - The media type for the HTTP entity.
 * @param httpHeaders - HTTP headers associated with HTTP entity.
 * @return
 * @throws JAXBException
 */
protected JAXBContext getJAXBContext(Class<?> domainClass,Annotation[] annotations,MediaType mediaType,MultivaluedMap<String,?> httpHeaders) throws JAXBException {
  JAXBContext jaxbContext=contextCache.get(domainClass);
  if (null != jaxbContext) {
    return jaxbContext;
  }
  ContextResolver<JAXBContext> resolver=providers.getContextResolver(JAXBContext.class,mediaType);
  if (null == resolver || null == (jaxbContext=resolver.getContext(domainClass))) {
    jaxbContext=JAXBContextFactory.createContext(new Class[]{domainClass},null);
    contextCache.put(domainClass,jaxbContext);
    return jaxbContext;
  }
 else   if (jaxbContext instanceof org.eclipse.persistence.jaxb.JAXBContext) {
    return jaxbContext;
  }
 else {
    jaxbContext=JAXBContextFactory.createContext(new Class[]{domainClass},null);
    contextCache.put(domainClass,jaxbContext);
    return jaxbContext;
  }
}

Fixed version (ground truth):
/** 
 * Return the <i>JAXBContext</i> that corresponds to the domain class.  This method does the following: <ol> <li>If an EclipseLink JAXB (MOXy) <i>JAXBContext</i> is available from a <i>ContextResolver</i> then use it.</li> <li>If an existing <i>JAXBContext</i> was not found in step one, then  create a new one on the domain class.</li> </ol>
 * @param domainClass - The domain class we need a <i>JAXBContext</i> for.
 * @param annotations - The annotations corresponding to domain object.
 * @param mediaType - The media type for the HTTP entity.
 * @param httpHeaders - HTTP headers associated with HTTP entity.
 * @return
 * @throws JAXBException
 */
protected JAXBContext getJAXBContext(Class<?> domainClass,Annotation[] annotations,MediaType mediaType,MultivaluedMap<String,?> httpHeaders) throws JAXBException {
  JAXBContext jaxbContext=contextCache.get(domainClass);
  if (null != jaxbContext) {
    return jaxbContext;
  }
  ContextResolver<JAXBContext> resolver=null;
  if (null != providers) {
    resolver=providers.getContextResolver(JAXBContext.class,mediaType);
  }
  if (null == resolver || null == (jaxbContext=resolver.getContext(domainClass))) {
    jaxbContext=JAXBContextFactory.createContext(new Class[]{domainClass},null);
    contextCache.put(domainClass,jaxbContext);
    return jaxbContext;
  }
 else   if (jaxbContext instanceof org.eclipse.persistence.jaxb.JAXBContext) {
    return jaxbContext;
  }
 else {
    jaxbContext=JAXBContextFactory.createContext(new Class[]{domainClass},null);
    contextCache.put(domainClass,jaxbContext);
    return jaxbContext;
  }
}