nus-yam/ex-repair huggingface dataset:
Program: 64545
Project: 64545
Buggy source:
public XMLCollectionReferenceMappingMarshalNodeValue(CollectionReferenceMapping xmlCollectionReferenceMapping){
  this.xmlCollectionReferenceMapping=xmlCollectionReferenceMapping;
  branchNode=new XPathNode();
  NamespaceResolver namespaceResolver=((XMLDescriptor)xmlCollectionReferenceMapping.getDescriptor()).getNamespaceResolver();
  List fkFields=xmlCollectionReferenceMapping.getFields();
  for (int x=0, fkFieldsSize=fkFields.size(); x < fkFieldsSize; x++) {
    XMLField fkField=(XMLField)fkFields.get(x);
    branchNode.addChild(fkField.getXPathFragment(),new XMLCollectionReferenceMappingFKMarshalNodeValue(xmlCollectionReferenceMapping,fkField),namespaceResolver);
  }
}

Fixed version (ground truth):
public XMLCollectionReferenceMappingMarshalNodeValue(CollectionReferenceMapping xmlCollectionReferenceMapping){
  this.xmlCollectionReferenceMapping=xmlCollectionReferenceMapping;
  branchNode=new XPathNode();
  NamespaceResolver namespaceResolver=((Descriptor)xmlCollectionReferenceMapping.getDescriptor()).getNamespaceResolver();
  List fkFields=xmlCollectionReferenceMapping.getFields();
  for (int x=0, fkFieldsSize=fkFields.size(); x < fkFieldsSize; x++) {
    XMLField fkField=(XMLField)fkFields.get(x);
    branchNode.addChild(fkField.getXPathFragment(),new XMLCollectionReferenceMappingFKMarshalNodeValue(xmlCollectionReferenceMapping,fkField),namespaceResolver);
  }
}
Program: 64546
Project: 64546
Buggy source:
protected ClassDescriptor buildDatabaseTypeWrapperDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(DatabaseTypeWrapper.class);
  descriptor.getInheritancePolicy().setClassIndicatorField(new XMLField("String_Node_Str"));
  descriptor.getInheritancePolicy().addClassIndicator(JDBCTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(SimplePLSQLTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLRecordWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLCollectionWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(OracleArrayTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(OracleObjectTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLCursorWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  return descriptor;
}

Fixed version (ground truth):
protected ClassDescriptor buildDatabaseTypeWrapperDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(DatabaseTypeWrapper.class);
  descriptor.getInheritancePolicy().setClassIndicatorField(new XMLField("String_Node_Str"));
  descriptor.getInheritancePolicy().addClassIndicator(JDBCTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(SimplePLSQLTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLRecordWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLCollectionWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(OracleArrayTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(OracleObjectTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(PLSQLCursorWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  descriptor.getInheritancePolicy().addClassIndicator(XMLTypeWrapper.class,getPrimaryNamespaceXPath() + "String_Node_Str");
  return descriptor;
}
Program: 64547
Project: 64547
Buggy source:
/** 
 * Wrap the type in a type wrapper to handle XML conversion.
 */
public static DatabaseTypeWrapper wrapType(DatabaseType databaseType){
  if (databaseType.isComplexDatabaseType()) {
    ComplexDatabaseType complexType=(ComplexDatabaseType)databaseType;
    if (complexType.isJDBCType()) {
      if (complexType.isCollection()) {
        return new OracleArrayTypeWrapper(databaseType);
      }
      return new OracleObjectTypeWrapper(databaseType);
    }
    if (complexType.isRecord()) {
      return new PLSQLRecordWrapper(databaseType);
    }
    if (complexType.isCollection()) {
      return new PLSQLCollectionWrapper(databaseType);
    }
    if (complexType.isCursor()) {
      return new PLSQLCursorWrapper(databaseType);
    }
  }
 else   if (databaseType.isJDBCType()) {
    return new JDBCTypeWrapper(databaseType);
  }
 else {
    return new SimplePLSQLTypeWrapper(databaseType);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Wrap the type in a type wrapper to handle XML conversion.
 */
public static DatabaseTypeWrapper wrapType(DatabaseType databaseType){
  if (databaseType.isComplexDatabaseType()) {
    ComplexDatabaseType complexType=(ComplexDatabaseType)databaseType;
    if (complexType.isJDBCType()) {
      if (complexType.isCollection()) {
        return new OracleArrayTypeWrapper(databaseType);
      }
      return new OracleObjectTypeWrapper(databaseType);
    }
    if (complexType.isRecord()) {
      return new PLSQLRecordWrapper(databaseType);
    }
    if (complexType.isCollection()) {
      return new PLSQLCollectionWrapper(databaseType);
    }
    if (complexType.isCursor()) {
      return new PLSQLCursorWrapper(databaseType);
    }
  }
 else   if (databaseType.isJDBCType()) {
    return new JDBCTypeWrapper(databaseType);
  }
 else   if (isXMLType(databaseType.getTypeName())) {
    return new XMLTypeWrapper(databaseType);
  }
 else {
    return new SimplePLSQLTypeWrapper(databaseType);
  }
  return null;
}
Program: 64550
Project: 64550
Buggy source:
/** 
 * INTERNAL: Set the descriptor.
 */
public abstract void setDescriptor(ClassDescriptor descriptor);

Fixed version (ground truth):
/** 
 * INTERNAL: Set the descriptor.
 */
public abstract void setDescriptor(DESCRIPTOR descriptor);
Program: 64551
Project: 64551
Buggy source:
public static DescriptorException missingClassIndicatorField(AbstractRecord row,ClassDescriptor descriptor){
  Object[] args={row};
  DescriptorException descriptorException=new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class,MISSING_CLASS_INDICATOR_FIELD,args),descriptor);
  descriptorException.setErrorCode(MISSING_CLASS_INDICATOR_FIELD);
  return descriptorException;
}

Fixed version (ground truth):
/** 
 * @since EclipseLink 2.5.0
 */
public static DescriptorException missingClassIndicatorField(XMLRecord row,ClassDescriptor descriptor){
  Object[] args={row};
  DescriptorException descriptorException=new DescriptorException(ExceptionMessageGenerator.buildMessage(DescriptorException.class,MISSING_CLASS_INDICATOR_FIELD,args),descriptor);
  descriptorException.setErrorCode(MISSING_CLASS_INDICATOR_FIELD);
  return descriptorException;
}
Program: 64555
Project: 64555
Buggy source:
/** 
 * INTERNAL: Process the accessType for a MappedSuperclass. This function is referenced by MetadataProject.addMetamodelMappedSuperclass(). The overridden function on the subclass must be used in all other cases.
 * @since EclipseLink 1.2 for the JPA 2.0 Reference Implementation
 */
@Override public void processAccessType(){
  String explicitAccessType=getAccess();
  String defaultAccessType=null;
  if (hasObjectRelationalFieldMappingAnnotationsDefined()) {
    defaultAccessType=JPA_ACCESS_FIELD;
  }
 else   if (hasObjectRelationalMethodMappingAnnotationsDefined()) {
    defaultAccessType=JPA_ACCESS_PROPERTY;
  }
 else {
    if (getDescriptor().getDefaultAccess() != null) {
      defaultAccessType=getDescriptor().getDefaultAccess();
    }
 else {
      defaultAccessType=JPA_ACCESS_FIELD;
    }
  }
  getDescriptor().setDefaultAccess(defaultAccessType);
  if (explicitAccessType == null) {
    getLogger().logConfigMessage(MetadataLogger.ACCESS_TYPE,defaultAccessType,getJavaClass());
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Process the accessType for a MappedSuperclass. This function is referenced by MetadataProject.addMetamodelMappedSuperclass(). The overridden function on the subclass must be used in all other cases.
 * @since EclipseLink 1.2 for the JPA 2.0 Reference Implementation
 */
@Override public void processAccessType(){
  String explicitAccessType=getAccess();
  String defaultAccessType=null;
  if (hasObjectRelationalFieldMappingAnnotationsDefined()) {
    defaultAccessType=JPA_ACCESS_FIELD;
  }
 else   if (hasObjectRelationalMethodMappingAnnotationsDefined()) {
    defaultAccessType=JPA_ACCESS_PROPERTY;
  }
 else {
    if (getDescriptor().getDefaultAccess() != null) {
      defaultAccessType=getDescriptor().getDefaultAccess();
    }
 else {
      defaultAccessType=JPA_ACCESS_FIELD;
    }
  }
  getDescriptor().setDefaultAccess(defaultAccessType);
  if (explicitAccessType == null) {
    getLogger().logConfigMessage(MetadataLogger.ACCESS_TYPE,defaultAccessType,getJavaClass());
  }
  getDescriptor().setAccessTypeOnClassDescriptor(getAccessType());
}
Program: 64557
Project: 64557
Buggy source:
private void processReferencePropertyTypes(Property property,TypeInfo info,JavaClass theClass){
  for (  org.eclipse.persistence.jaxb.xmlmodel.XmlElementRef nextRef : property.getXmlElementRefs()) {
    JavaClass type=property.getType();
    String typeName=type.getQualifiedName();
    if (isCollectionType(property)) {
      if (type.hasActualTypeArguments()) {
        type=property.getGenericType();
        typeName=type.getQualifiedName();
      }
    }
    if (JAVAX_XML_BIND_JAXBELEMENT.equals(typeName)) {
      Collection args=type.getActualTypeArguments();
      if (args.size() > 0) {
        JavaClass theType=(JavaClass)args.iterator().next();
        TypeInfo refTypeInfo=typeInfo.get(theType.getQualifiedName());
        if (refTypeInfo == null && shouldGenerateTypeInfo(theType)) {
          JavaClass[] jClassArray=new JavaClass[]{theType};
          buildNewTypeInfo(jClassArray);
        }
      }
    }
    if (!(nextRef.getType().equals("String_Node_Str") || nextRef.getType().equals("String_Node_Str"))) {
      typeName=nextRef.getType();
      type=helper.getJavaClass(typeName);
    }
    TypeInfo refTypeInfo=typeInfo.get(type.getQualifiedName());
    if (refTypeInfo == null && shouldGenerateTypeInfo(type)) {
      JavaClass[] jClassArray=new JavaClass[]{type};
      buildNewTypeInfo(jClassArray);
    }
  }
}

Fixed version (ground truth):
private void processReferencePropertyTypes(Property property,TypeInfo info,JavaClass theClass){
  for (  org.eclipse.persistence.jaxb.xmlmodel.XmlElementRef nextRef : property.getXmlElementRefs()) {
    JavaClass type=property.getType();
    String typeName=type.getQualifiedName();
    if (helper.isCollectionType(property.getType())) {
      if (type.hasActualTypeArguments()) {
        type=property.getGenericType();
        typeName=type.getQualifiedName();
      }
    }
    if (JAVAX_XML_BIND_JAXBELEMENT.equals(typeName)) {
      Collection args=type.getActualTypeArguments();
      if (args.size() > 0) {
        JavaClass theType=(JavaClass)args.iterator().next();
        TypeInfo refTypeInfo=typeInfo.get(theType.getQualifiedName());
        if (refTypeInfo == null && shouldGenerateTypeInfo(theType)) {
          JavaClass[] jClassArray=new JavaClass[]{theType};
          buildNewTypeInfo(jClassArray);
        }
      }
    }
    if (!(nextRef.getType().equals("String_Node_Str") || nextRef.getType().equals("String_Node_Str"))) {
      typeName=nextRef.getType();
      type=helper.getJavaClass(typeName);
    }
    TypeInfo refTypeInfo=typeInfo.get(type.getQualifiedName());
    if (refTypeInfo == null && shouldGenerateTypeInfo(type)) {
      JavaClass[] jClassArray=new JavaClass[]{type};
      buildNewTypeInfo(jClassArray);
    }
  }
}
Program: 64559
Project: 64559
Buggy source:
/** 
 * Process @XmlElement annotation on a given property.
 * @param property
 */
private void processXmlElement(Property property,TypeInfo info){
  if (helper.isAnnotationPresent(property.getElement(),XmlElement.class)) {
    XmlElement element=(XmlElement)helper.getAnnotation(property.getElement(),XmlElement.class);
    property.setIsRequired(element.required());
    property.setNillable(element.nillable());
    if (element.type() != XmlElement.DEFAULT.class && !(property.isSwaAttachmentRef())) {
      property.setOriginalType(property.getType());
      if (isCollectionType(property.getType())) {
        property.setGenericType(helper.getJavaClass(element.type()));
      }
 else {
        property.setType(helper.getJavaClass(element.type()));
      }
      property.setHasXmlElementType(true);
    }
    if (!element.defaultValue().equals(ELEMENT_DECL_DEFAULT)) {
      property.setDefaultValue(element.defaultValue());
    }
  }
}

Fixed version (ground truth):
/** 
 * Process @XmlElement annotation on a given property.
 * @param property
 */
private void processXmlElement(Property property,TypeInfo info){
  if (helper.isAnnotationPresent(property.getElement(),XmlElement.class)) {
    XmlElement element=(XmlElement)helper.getAnnotation(property.getElement(),XmlElement.class);
    property.setIsRequired(element.required());
    property.setNillable(element.nillable());
    if (element.type() != XmlElement.DEFAULT.class && !(property.isSwaAttachmentRef())) {
      property.setOriginalType(property.getType());
      if (helper.isCollectionType(property.getType())) {
        property.setGenericType(helper.getJavaClass(element.type()));
      }
 else {
        property.setType(helper.getJavaClass(element.type()));
      }
      property.setHasXmlElementType(true);
    }
    if (!element.defaultValue().equals(ELEMENT_DECL_DEFAULT)) {
      property.setDefaultValue(element.defaultValue());
    }
  }
}
Program: 64564
Project: 64564
Buggy source:
public boolean shouldGenerateTypeInfo(JavaClass javaClass){
  if (javaClass == null || javaClass.isPrimitive() || javaClass.isAnnotation() || ORG_W3C_DOM.equals(javaClass.getPackageName())) {
    return false;
  }
  if (userDefinedSchemaTypes.get(javaClass.getQualifiedName()) != null) {
    return false;
  }
  if (javaClass.isArray()) {
    String javaClassName=javaClass.getName();
    if (!(javaClassName.equals(ClassConstants.APBYTE.getName())) && !(javaClassName.equals(ClassConstants.ABYTE.getName()))) {
      return true;
    }
  }
  if (helper.isBuiltInJavaType(javaClass)) {
    return false;
  }
  if (isCollectionType(javaClass) || isMapType(javaClass)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean shouldGenerateTypeInfo(JavaClass javaClass){
  if (javaClass == null || javaClass.isPrimitive() || javaClass.isAnnotation() || ORG_W3C_DOM.equals(javaClass.getPackageName())) {
    return false;
  }
  if (userDefinedSchemaTypes.get(javaClass.getQualifiedName()) != null) {
    return false;
  }
  if (javaClass.isArray()) {
    String javaClassName=javaClass.getName();
    if (!(javaClassName.equals(ClassConstants.APBYTE.getName())) && !(javaClassName.equals(ClassConstants.ABYTE.getName()))) {
      return true;
    }
  }
  if (helper.isBuiltInJavaType(javaClass)) {
    return false;
  }
  if (helper.isCollectionType(javaClass) || helper.isMapType(javaClass)) {
    return false;
  }
  return true;
}
Program: 64566
Project: 64566
Buggy source:
private XMLInverseReferenceMapping generateInverseReferenceMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespace){
  XMLInverseReferenceMapping invMapping=new XMLInverseReferenceMapping();
  if (isCollectionType(property.getType())) {
    invMapping.setReferenceClassName(property.getGenericType().getQualifiedName());
  }
 else {
    invMapping.setReferenceClassName(property.getType().getQualifiedName());
  }
  invMapping.setAttributeName(property.getPropertyName());
  String setMethodName=property.getInverseReferencePropertySetMethodName();
  String getMethodName=property.getInverseReferencePropertyGetMethodName();
  if (setMethodName != null && !setMethodName.equals(XMLConstants.EMPTY_STRING)) {
    invMapping.setSetMethodName(setMethodName);
  }
  if (getMethodName != null && !getMethodName.equals(XMLConstants.EMPTY_STRING)) {
    invMapping.setGetMethodName(getMethodName);
  }
  invMapping.setMappedBy(property.getInverseReferencePropertyName());
  if (isCollectionType(property.getType())) {
    JavaClass collectionType=property.getType();
    collectionType=containerClassImpl(collectionType);
    invMapping.useCollectionClass(helper.getClassForJavaClass(collectionType));
  }
  return invMapping;
}

Fixed version (ground truth):
private XMLInverseReferenceMapping generateInverseReferenceMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespace){
  XMLInverseReferenceMapping invMapping=new XMLInverseReferenceMapping();
  boolean isCollection=helper.isCollectionType(property.getType());
  if (isCollection) {
    invMapping.setReferenceClassName(property.getGenericType().getQualifiedName());
  }
 else {
    invMapping.setReferenceClassName(property.getType().getQualifiedName());
  }
  invMapping.setAttributeName(property.getPropertyName());
  String setMethodName=property.getInverseReferencePropertySetMethodName();
  String getMethodName=property.getInverseReferencePropertyGetMethodName();
  if (setMethodName != null && !setMethodName.equals(XMLConstants.EMPTY_STRING)) {
    invMapping.setSetMethodName(setMethodName);
  }
  if (getMethodName != null && !getMethodName.equals(XMLConstants.EMPTY_STRING)) {
    invMapping.setGetMethodName(getMethodName);
  }
  invMapping.setMappedBy(property.getInverseReferencePropertyName());
  if (isCollection) {
    JavaClass collectionType=property.getType();
    collectionType=containerClassImpl(collectionType);
    invMapping.useCollectionClass(helper.getClassForJavaClass(collectionType));
  }
  return invMapping;
}
Program: 64576
Project: 64576
Buggy source:
@AfterClass public static void tearDown(){
  if (ddlDrop) {
    runDdl(conn,DROP_ADD_PERSONTYPE_TO_TABLE2_FUNC,ddlDebug);
    runDdl(conn,DROP_ADD_PERSONTYPE_TO_TABLE_PROC,ddlDebug);
    runDdl(conn,DROP_GET_PERSONTYPE2_FUNC,ddlDebug);
    runDdl(conn,DROP_GET_PERSONTYPE_TABLE,ddlDebug);
    runDdl(conn,DROP_GROUPTYPE_PROC,ddlDebug);
    runDdl(conn,DROP_GROUPTYPE,ddlDebug);
    runDdl(conn,DROP_MYEMPOBJECT_TABLE,ddlDebug);
    runDdl(conn,DROP_MYEMPOBJECT,ddlDebug);
    runDdl(conn,DROP_PERSONTYPE_TABLE,ddlDebug);
    runDdl(conn,DROP_PERSONTYPE,ddlDebug);
  }
}

Fixed version (ground truth):
@AfterClass public static void tearDown(){
  if (ddlDrop) {
    runDdl(conn,DROP_ADD_PERSONTYPE_TO_TABLE2_FUNC,ddlDebug);
    runDdl(conn,DROP_ADD_PERSONTYPE_TO_TABLE_PROC,ddlDebug);
    runDdl(conn,DROP_GET_PERSONTYPE2_FUNC,ddlDebug);
    runDdl(conn,DROP_GET_PERSONTYPE_TABLE,ddlDebug);
    runDdl(conn,DROP_GROUPTYPE_PROC,ddlDebug);
    runDdl(conn,DROP_GROUPTYPE,ddlDebug);
    runDdl(conn,DROP_MYEMPOBJECT_TABLE,ddlDebug);
    runDdl(conn,DROP_MYEMPOBJECT,ddlDebug);
    runDdl(conn,DROP_PERSONTYPE_TABLE,ddlDebug);
    runDdl(conn,DROP_PERSONTYPE,ddlDebug);
    runDdl(conn,DROP_TEST_CUSTOM_TYPE_RECORD_PKG_BODY,ddlDebug);
    runDdl(conn,DROP_TEST_CUSTOM_TYPE_RECORD_PKG,ddlDebug);
    runDdl(conn,DROP_TJOBS_TABLE,ddlDebug);
    runDdl(conn,DROP_TJOBS_BODY,ddlDebug);
    runDdl(conn,DROP_TJOBS,ddlDebug);
    runDdl(conn,DROP_EMP_TABLE,ddlDebug);
  }
}
Program: 64577
Project: 64577
Buggy source:
/** 
 * INTERNAL: This is used only in initialization.
 */
public DatabaseField buildField(DatabaseField field){
  try {
    Map<DatabaseField,DatabaseField> builtFields=getObjectBuilder().getFieldsMap();
    DatabaseField builtField=builtFields.get(field);
    if (builtField == null) {
      XMLField xmlField=(XMLField)field;
      xmlField.setNamespaceResolver(this.getNamespaceResolver());
      xmlField.initialize();
      builtFields.put(xmlField,xmlField);
      return xmlField;
    }
    return builtField;
  }
 catch (  ClassCastException e) {
  }
  return super.buildField(field);
}

Fixed version (ground truth):
/** 
 * INTERNAL: This is used only in initialization.
 */
public DatabaseField buildField(DatabaseField field){
  try {
    XMLField xmlField=(XMLField)field;
    xmlField.setNamespaceResolver(this.getNamespaceResolver());
    xmlField.initialize();
  }
 catch (  ClassCastException e) {
  }
  return super.buildField(field);
}
Program: 64580
Project: 64580
Buggy source:
public boolean equals(Object object){
  if (null == object) {
    return false;
  }
 else   if (this == object) {
    return true;
  }
  try {
    XPathFragment xPathFragment=(XPathFragment)object;
    if (nameIsText && xPathFragment.nameIsText) {
      return true;
    }
    if (nameIsText != xPathFragment.nameIsText) {
      return false;
    }
    if ((null == localName && null != xPathFragment.localName) || (null != localName && null == xPathFragment.localName)) {
      return false;
    }
    if (null != localName && !localName.equals(xPathFragment.localName)) {
      return false;
    }
    if (namespaceAware && xPathFragment.isNamespaceAware()) {
      if ((null == namespaceURI && null != xPathFragment.namespaceURI) || (null != namespaceURI && null == xPathFragment.namespaceURI)) {
        return false;
      }
      if (null != namespaceURI && !namespaceURI.equals(xPathFragment.namespaceURI)) {
        return false;
      }
    }
    if (indexValue != xPathFragment.indexValue) {
      return false;
    }
    if (null == predicate && null != xPathFragment.predicate) {
      return false;
    }
    if (null != predicate && !predicate.equals(xPathFragment.predicate)) {
      return false;
    }
  }
 catch (  ClassCastException e) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean equals(Object object,boolean ignorePredicate){
  if (null == object) {
    return false;
  }
 else   if (this == object) {
    return true;
  }
  try {
    XPathFragment xPathFragment=(XPathFragment)object;
    if (nameIsText && xPathFragment.nameIsText) {
      return true;
    }
    if (nameIsText != xPathFragment.nameIsText) {
      return false;
    }
    if ((null == localName && null != xPathFragment.localName) || (null != localName && null == xPathFragment.localName)) {
      return false;
    }
    if (null != localName && !localName.equals(xPathFragment.localName)) {
      return false;
    }
    if (namespaceAware && xPathFragment.isNamespaceAware()) {
      if ((null == namespaceURI && null != xPathFragment.namespaceURI) || (null != namespaceURI && null == xPathFragment.namespaceURI)) {
        return false;
      }
      if (null != namespaceURI && !namespaceURI.equals(xPathFragment.namespaceURI)) {
        return false;
      }
    }
    if (indexValue != xPathFragment.indexValue) {
      return false;
    }
    if (!ignorePredicate) {
      if (null == predicate && null != xPathFragment.predicate) {
        return false;
      }
      if (null != predicate && !predicate.equals(xPathFragment.predicate)) {
        return false;
      }
    }
  }
 catch (  ClassCastException e) {
    return false;
  }
  return true;
}
Program: 64583
Project: 64583
Buggy source:
public Object unmarshalEntity(Class type,MediaType acceptedMedia,InputStream in) throws JAXBException {
  Unmarshaller unmarshaller=getJAXBContext().createUnmarshaller();
  unmarshaller.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT,Boolean.FALSE);
  unmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,acceptedMedia.toString());
  unmarshaller.setAdapter(new LinkAdapter(getBaseURI().toString(),this));
  unmarshaller.setEventHandler(new ValidationEventHandler(){
    @Override public boolean handleEvent(    ValidationEvent event){
      if (event.getSeverity() != ValidationEvent.WARNING) {
        return false;
      }
      return true;
    }
  }
);
  for (  XmlAdapter adapter : getAdapters()) {
    unmarshaller.setAdapter(adapter);
  }
  JAXBElement<?> element=unmarshaller.unmarshal(new StreamSource(in),type);
  if (element.getValue() instanceof List<?>) {
    for (    Object object : (List<?>)element.getValue()) {
      wrap(object);
    }
    return element.getValue();
  }
 else {
    wrap(element.getValue());
  }
  return element.getValue();
}

Fixed version (ground truth):
public Object unmarshalEntity(Class type,MediaType acceptedMedia,InputStream in) throws JAXBException {
  Unmarshaller unmarshaller=getJAXBContext().createUnmarshaller();
  unmarshaller.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT,Boolean.FALSE);
  unmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,acceptedMedia.toString());
  unmarshaller.setAdapter(new LinkAdapter(getBaseURI().toString(),this));
  unmarshaller.setEventHandler(new ValidationEventHandler(){
    @Override public boolean handleEvent(    ValidationEvent event){
      if (event.getSeverity() != ValidationEvent.WARNING) {
        return false;
      }
      return true;
    }
  }
);
  for (  XmlAdapter adapter : getAdapters()) {
    unmarshaller.setAdapter(adapter);
  }
  if (acceptedMedia == MediaType.APPLICATION_JSON_TYPE) {
    JAXBElement<?> element=unmarshaller.unmarshal(new StreamSource(in),type);
    if (element.getValue() instanceof List<?>) {
      for (      Object object : (List<?>)element.getValue()) {
        wrap(object);
      }
      return element.getValue();
    }
 else {
      wrap(element.getValue());
    }
    return element.getValue();
  }
  Object domainObject=unmarshaller.unmarshal(new StreamSource(in));
  if (domainObject instanceof List<?>) {
    for (    Object object : (List<?>)domainObject) {
      wrap(object);
    }
    return domainObject;
  }
 else {
    wrap(domainObject);
  }
  return domainObject;
}
Program: 64588
Project: 64588
Buggy source:
@Test public void noargsTest(){
  Invocation invocation=new Invocation("String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(SIMPLE_XML_RESULT));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@Test public void noargsTest(){
  Invocation invocation=new Invocation("String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(VALUE_1_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}
Program: 64589
Project: 64589
Buggy source:
@Test public void varcharTest(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str","String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(SIMPLE_XML_RESULT));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@Test public void varcharTest(){
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str","String_Node_Str");
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  Document doc=xmlPlatform.createDocument();
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(VALUE_1_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}
Program: 64592
Project: 64592
Buggy source:
protected Response findAttribute(String persistenceUnit,String type,String key,String attribute,HttpHeaders hh,UriInfo ui,URI baseURI){
  PersistenceContext app=getPersistenceFactory().get(persistenceUnit,baseURI,null);
  if (app == null || app.getClass(type) == null) {
    if (app == null) {
      JPARSLogger.fine("String_Node_Str",new Object[]{persistenceUnit});
    }
 else {
      JPARSLogger.fine("String_Node_Str",new Object[]{type,persistenceUnit});
    }
    return Response.status(Status.NOT_FOUND).build();
  }
  Map<String,String> discriminators=getParameterMap(ui,persistenceUnit);
  Object id=IdHelper.buildId(app,type,key,discriminators);
  Object entity=app.findAttribute(discriminators,type,id,getHintMap(ui),attribute);
  if (entity == null) {
    JPARSLogger.fine("String_Node_Str",new Object[]{type,key,attribute,persistenceUnit});
    return Response.status(Status.NOT_FOUND).build();
  }
 else {
    return Response.ok(new StreamingOutputMarshaller(app,entity,hh.getAcceptableMediaTypes())).build();
  }
}

Fixed version (ground truth):
protected Response findAttribute(String persistenceUnit,String type,String key,String attribute,HttpHeaders hh,UriInfo ui,URI baseURI){
  PersistenceContext app=getPersistenceFactory().get(persistenceUnit,baseURI,null);
  if (app == null || app.getClass(type) == null) {
    if (app == null) {
      JPARSLogger.fine("String_Node_Str",new Object[]{persistenceUnit});
    }
 else {
      JPARSLogger.fine("String_Node_Str",new Object[]{type,persistenceUnit});
    }
    return Response.status(Status.NOT_FOUND).build();
  }
  Map<String,String> discriminators=getParameterMap(ui,persistenceUnit);
  Object id=IdHelper.buildId(app,type,key);
  Object entity=app.findAttribute(discriminators,type,id,getHintMap(ui),attribute);
  if (entity == null) {
    JPARSLogger.fine("String_Node_Str",new Object[]{type,key,attribute,persistenceUnit});
    return Response.status(Status.NOT_FOUND).build();
  }
 else {
    return Response.ok(new StreamingOutputMarshaller(app,entity,hh.getAcceptableMediaTypes())).build();
  }
}
Program: 64593
Project: 64593
Buggy source:
protected Response find(String persistenceUnit,String type,String key,HttpHeaders hh,UriInfo ui,URI baseURI){
  PersistenceContext app=getPersistenceFactory().get(persistenceUnit,baseURI,null);
  if (app == null || app.getClass(type) == null) {
    if (app == null) {
      JPARSLogger.fine("String_Node_Str",new Object[]{persistenceUnit});
    }
 else {
      JPARSLogger.fine("String_Node_Str",new Object[]{type,persistenceUnit});
    }
    return Response.status(Status.NOT_FOUND).build();
  }
  Map<String,String> discriminators=getParameterMap(ui,persistenceUnit);
  Object id=IdHelper.buildId(app,type,key,discriminators);
  Object entity=app.find(discriminators,type,id,getHintMap(ui));
  if (entity == null) {
    JPARSLogger.fine("String_Node_Str",new Object[]{type,key,persistenceUnit});
    return Response.status(Status.NOT_FOUND).build();
  }
 else {
    return Response.ok(new StreamingOutputMarshaller(app,entity,hh.getAcceptableMediaTypes())).build();
  }
}

Fixed version (ground truth):
protected Response find(String persistenceUnit,String type,String key,HttpHeaders hh,UriInfo ui,URI baseURI){
  PersistenceContext app=getPersistenceFactory().get(persistenceUnit,baseURI,null);
  if (app == null || app.getClass(type) == null) {
    if (app == null) {
      JPARSLogger.fine("String_Node_Str",new Object[]{persistenceUnit});
    }
 else {
      JPARSLogger.fine("String_Node_Str",new Object[]{type,persistenceUnit});
    }
    return Response.status(Status.NOT_FOUND).build();
  }
  Map<String,String> discriminators=getParameterMap(ui,persistenceUnit);
  Object id=IdHelper.buildId(app,type,key);
  Object entity=app.find(discriminators,type,id,getHintMap(ui));
  if (entity == null) {
    JPARSLogger.fine("String_Node_Str",new Object[]{type,key,persistenceUnit});
    return Response.status(Status.NOT_FOUND).build();
  }
 else {
    return Response.ok(new StreamingOutputMarshaller(app,entity,hh.getAcceptableMediaTypes())).build();
  }
}
Program: 64596
Project: 64596
Buggy source:
protected Response delete(String persistenceUnit,String type,String key,UriInfo ui,URI baseURI){
  PersistenceContext app=getPersistenceFactory().get(persistenceUnit,baseURI,null);
  if (app == null || app.getClass(type) == null) {
    if (app == null) {
      JPARSLogger.fine("String_Node_Str",new Object[]{persistenceUnit});
    }
 else {
      JPARSLogger.fine("String_Node_Str",new Object[]{type,persistenceUnit});
    }
    return Response.status(Status.NOT_FOUND).build();
  }
  Map<String,String> discriminators=getParameterMap(ui,persistenceUnit);
  Object id=IdHelper.buildId(app,type,key,discriminators);
  app.delete(discriminators,type,id);
  return Response.ok().build();
}

Fixed version (ground truth):
protected Response delete(String persistenceUnit,String type,String key,UriInfo ui,URI baseURI){
  PersistenceContext app=getPersistenceFactory().get(persistenceUnit,baseURI,null);
  if (app == null || app.getClass(type) == null) {
    if (app == null) {
      JPARSLogger.fine("String_Node_Str",new Object[]{persistenceUnit});
    }
 else {
      JPARSLogger.fine("String_Node_Str",new Object[]{type,persistenceUnit});
    }
    return Response.status(Status.NOT_FOUND).build();
  }
  Map<String,String> discriminators=getParameterMap(ui,persistenceUnit);
  Object id=IdHelper.buildId(app,type,key);
  app.delete(discriminators,type,id);
  return Response.ok().build();
}
Program: 64597
Project: 64597
Buggy source:
/** 
 * Lookup the descriptor for the given entity name. This method will look first in the EntityManagerFactory wrapped by this persistence context and return that descriptor.  If one does not exist, it search the JAXBContext and return a descriptor from there.
 * @param entityName
 * @return
 */
public ClassDescriptor getDescriptor(String entityName){
  Server session=getJpaSession();
  ClassDescriptor descriptor=session.getDescriptorForAlias(entityName);
  if (descriptor == null) {
    for (    Object ajaxBSession : ((JAXBContext)getJAXBContext()).getXMLContext().getSessions()) {
      descriptor=((Session)ajaxBSession).getClassDescriptorForAlias(entityName);
      if (descriptor != null) {
        break;
      }
    }
  }
  return descriptor;
}

Fixed version (ground truth):
/** 
 * Lookup the descriptor for the given entity name. This method will look first in the EntityManagerFactory wrapped by this persistence context and return that descriptor.  If one does not exist, it search the JAXBContext and return a descriptor from there.
 * @param entityName
 * @return
 */
public ClassDescriptor getDescriptor(String entityName){
  DatabaseSession session=getJpaSession();
  ClassDescriptor descriptor=session.getDescriptorForAlias(entityName);
  if (descriptor == null) {
    for (    Object ajaxBSession : ((JAXBContext)getJAXBContext()).getXMLContext().getSessions()) {
      descriptor=((Session)ajaxBSession).getClassDescriptorForAlias(entityName);
      if (descriptor != null) {
        break;
      }
    }
  }
  return descriptor;
}
Program: 64598
Project: 64598
Buggy source:
public ServerSession getJpaSession(){
  return (ServerSession)JpaHelper.getServerSession(emf);
}

Fixed version (ground truth):
public DatabaseSession getJpaSession(){
  DatabaseSession dbSession=JpaHelper.getDatabaseSession(emf);
  return dbSession;
}
Program: 64599
Project: 64599
Buggy source:
public PersistenceContext(String emfName,EntityManagerFactoryImpl emf,URI defaultURI){
  super();
  this.emf=emf;
  this.name=emfName;
  if (getJpaSession().hasExternalTransactionController()) {
    transaction=new JTATransactionWrapper();
  }
 else {
    transaction=new ResourceLocalTransactionWrapper();
  }
  try {
    this.context=createDynamicJAXBContext(emf.getServerSession());
  }
 catch (  JAXBException jaxbe) {
    JPARSLogger.exception("String_Node_Str",new Object[]{emfName,jaxbe.toString()},jaxbe);
    emf.close();
  }
catch (  IOException e) {
    JPARSLogger.exception("String_Node_Str",new Object[]{emfName,e.toString()},e);
    emf.close();
  }
  setBaseURI(defaultURI);
}

Fixed version (ground truth):
public PersistenceContext(String emfName,EntityManagerFactoryImpl emf,URI defaultURI){
  super();
  this.emf=emf;
  this.name=emfName;
  if (getJpaSession().hasExternalTransactionController()) {
    transaction=new JTATransactionWrapper();
  }
 else {
    transaction=new ResourceLocalTransactionWrapper();
  }
  try {
    this.context=createDynamicJAXBContext(emf.getDatabaseSession());
  }
 catch (  JAXBException jaxbe) {
    JPARSLogger.exception("String_Node_Str",new Object[]{emfName,jaxbe.toString()},jaxbe);
    emf.close();
  }
catch (  IOException e) {
    JPARSLogger.exception("String_Node_Str",new Object[]{emfName,e.toString()},e);
    emf.close();
  }
  setBaseURI(defaultURI);
}
Program: 64600
Project: 64600
Buggy source:
@SuppressWarnings("String_Node_Str") public ClassDescriptor getDescriptorForClass(Class clazz){
  Server session=getJpaSession();
  ClassDescriptor descriptor=session.getDescriptor(clazz);
  if (descriptor == null) {
    return getJAXBDescriptorForClass(clazz);
  }
  return descriptor;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public ClassDescriptor getDescriptorForClass(Class clazz){
  DatabaseSession session=getJpaSession();
  ClassDescriptor descriptor=session.getDescriptor(clazz);
  if (descriptor == null) {
    return getJAXBDescriptorForClass(clazz);
  }
  return descriptor;
}
Program: 64601
Project: 64601
Buggy source:
/** 
 * This method is used to help construct a JAXBContext from an existing EntityManagerFactory. For each package in the EntityManagerFactory, a MetadataSource that is capable of building a JAXBContext that creates the same mappings in JAXB is created.  These MetadataSources are used to constuct the JAXContext that is used for JSON and XML translation
 * @param metadataSources
 * @param persistenceUnitName
 * @param session
 */
protected void addDynamicXMLMetadataSources(List<Object> metadataSources,Server session){
  Set<String> packages=new HashSet<String>();
  Iterator<Class> i=session.getDescriptors().keySet().iterator();
  while (i.hasNext()) {
    Class<?> descriptorClass=i.next();
    String packageName="String_Node_Str";
    if (descriptorClass.getName().lastIndexOf('.') > 0) {
      packageName=descriptorClass.getName().substring(0,descriptorClass.getName().lastIndexOf('.'));
    }
    if (!packages.contains(packageName)) {
      packages.add(packageName);
    }
  }
  for (  String packageName : packages) {
    metadataSources.add(new DynamicXMLMetadataSource(session,packageName));
  }
}

Fixed version (ground truth):
/** 
 * This method is used to help construct a JAXBContext from an existing EntityManagerFactory. For each package in the EntityManagerFactory, a MetadataSource that is capable of building a JAXBContext that creates the same mappings in JAXB is created.  These MetadataSources are used to constuct the JAXContext that is used for JSON and XML translation
 * @param metadataSources
 * @param persistenceUnitName
 * @param session
 */
protected void addDynamicXMLMetadataSources(List<Object> metadataSources,DatabaseSession session){
  Set<String> packages=new HashSet<String>();
  Iterator<Class> i=session.getDescriptors().keySet().iterator();
  while (i.hasNext()) {
    Class<?> descriptorClass=i.next();
    String packageName="String_Node_Str";
    if (descriptorClass.getName().lastIndexOf('.') > 0) {
      packageName=descriptorClass.getName().substring(0,descriptorClass.getName().lastIndexOf('.'));
    }
    if (!packages.contains(packageName)) {
      packages.add(packageName);
    }
  }
  for (  String packageName : packages) {
    metadataSources.add(new DynamicXMLMetadataSource(session,packageName));
  }
}
Program: 64602
Project: 64602
Buggy source:
/** 
 * Build the set of properties used to create the JAXBContext based on the EntityManagerFactory that this PersistenceContext wraps
 * @param persistenceUnitName
 * @param session
 * @return
 * @throws IOException
 */
protected Map<String,Object> createJAXBProperties(Server session) throws IOException {
  Map<String,Object> properties=new HashMap<String,Object>(1);
  List<Object> metadataLocations=new ArrayList<Object>();
  addDynamicXMLMetadataSources(metadataLocations,session);
  String oxmLocation=(String)emf.getProperties().get("String_Node_Str");
  if (oxmLocation != null) {
    metadataLocations.add(oxmLocation);
  }
  Object passedOXMLocations=emf.getProperties().get(JAXBContextProperties.OXM_METADATA_SOURCE);
  if (passedOXMLocations != null) {
    if (passedOXMLocations instanceof Collection) {
      metadataLocations.addAll((Collection)passedOXMLocations);
    }
 else {
      metadataLocations.add(passedOXMLocations);
    }
  }
  metadataLocations.add(new LinkMetadataSource());
  properties.put(JAXBContextProperties.OXM_METADATA_SOURCE,metadataLocations);
  properties.put("String_Node_Str",new PreLoginMappingAdapter((AbstractSession)session));
  return properties;
}

Fixed version (ground truth):
/** 
 * Build the set of properties used to create the JAXBContext based on the EntityManagerFactory that this PersistenceContext wraps
 * @param persistenceUnitName
 * @param session
 * @return
 * @throws IOException
 */
protected Map<String,Object> createJAXBProperties(DatabaseSession session) throws IOException {
  Map<String,Object> properties=new HashMap<String,Object>(1);
  List<Object> metadataLocations=new ArrayList<Object>();
  addDynamicXMLMetadataSources(metadataLocations,session);
  String oxmLocation=(String)emf.getProperties().get("String_Node_Str");
  if (oxmLocation != null) {
    metadataLocations.add(oxmLocation);
  }
  Object passedOXMLocations=emf.getProperties().get(JAXBContextProperties.OXM_METADATA_SOURCE);
  if (passedOXMLocations != null) {
    if (passedOXMLocations instanceof Collection) {
      metadataLocations.addAll((Collection)passedOXMLocations);
    }
 else {
      metadataLocations.add(passedOXMLocations);
    }
  }
  metadataLocations.add(new LinkMetadataSource());
  properties.put(JAXBContextProperties.OXM_METADATA_SOURCE,metadataLocations);
  properties.put("String_Node_Str",new PreLoginMappingAdapter((AbstractSession)session));
  return properties;
}
Program: 64603
Project: 64603
Buggy source:
public Object findAttribute(Map<String,String> tenantId,String entityName,Object id,Map<String,Object> properties,String attribute){
  EntityManager em=getEmf().createEntityManager(tenantId);
  try {
    Object object=em.find(getClass(entityName),id,properties);
    ClassDescriptor descriptor=getJpaSession().getClassDescriptor(getClass(entityName));
    DatabaseMapping mapping=descriptor.getMappingForAttributeName(attribute);
    if (mapping == null) {
      return null;
    }
    return mapping.getRealAttributeValueFromAttribute(mapping.getAttributeValueFromObject(object),object,getJpaSession());
  }
  finally {
    em.close();
  }
}

Fixed version (ground truth):
public Object findAttribute(Map<String,String> tenantId,String entityName,Object id,Map<String,Object> properties,String attribute){
  EntityManager em=getEmf().createEntityManager(tenantId);
  try {
    Object object=em.find(getClass(entityName),id,properties);
    ClassDescriptor descriptor=getJpaSession().getClassDescriptor(getClass(entityName));
    DatabaseMapping mapping=descriptor.getMappingForAttributeName(attribute);
    if (mapping == null) {
      return null;
    }
    return mapping.getRealAttributeValueFromAttribute(mapping.getAttributeValueFromObject(object),object,(AbstractSession)getJpaSession());
  }
  finally {
    em.close();
  }
}
Program: 64604
Project: 64604
Buggy source:
protected void removeMappingValueFromObject(Object object,Object attributeValue,DatabaseMapping mapping,DatabaseMapping partner){
  if (mapping.isObjectReferenceMapping()) {
    Object currentValue=mapping.getRealAttributeValueFromObject(object,getJpaSession());
    if (currentValue.equals(attributeValue)) {
      ((ObjectReferenceMapping)mapping).getIndirectionPolicy().setRealAttributeValueInObject(object,null,true);
      if (partner != null) {
        removeMappingValueFromObject(attributeValue,object,partner,null);
      }
    }
  }
 else   if (mapping.isCollectionMapping()) {
    boolean removed=((Collection)mapping.getRealAttributeValueFromObject(object,getJpaSession())).remove(attributeValue);
    if (removed && partner != null) {
      removeMappingValueFromObject(attributeValue,object,partner,null);
    }
  }
}

Fixed version (ground truth):
protected void removeMappingValueFromObject(Object object,Object attributeValue,DatabaseMapping mapping,DatabaseMapping partner){
  if (mapping.isObjectReferenceMapping()) {
    Object currentValue=mapping.getRealAttributeValueFromObject(object,(AbstractSession)getJpaSession());
    if (currentValue.equals(attributeValue)) {
      ((ObjectReferenceMapping)mapping).getIndirectionPolicy().setRealAttributeValueInObject(object,null,true);
      if (partner != null) {
        removeMappingValueFromObject(attributeValue,object,partner,null);
      }
    }
  }
 else   if (mapping.isCollectionMapping()) {
    boolean removed=((Collection)mapping.getRealAttributeValueFromObject(object,(AbstractSession)getJpaSession())).remove(attributeValue);
    if (removed && partner != null) {
      removeMappingValueFromObject(attributeValue,object,partner,null);
    }
  }
}
Program: 64605
Project: 64605
Buggy source:
/** 
 * Create a JAXBConext based on the EntityManagerFactory for this PersistenceContext
 * @param session
 * @return
 */
protected JAXBContext createDynamicJAXBContext(Server session) throws JAXBException, IOException {
  JAXBContext jaxbContext=(JAXBContext)session.getProperty(JAXBContext.class.getName());
  if (jaxbContext != null) {
    return jaxbContext;
  }
  Map<String,Object> properties=createJAXBProperties(session);
  ClassLoader cl=session.getPlatform().getConversionManager().getLoader();
  jaxbContext=DynamicJAXBContextFactory.createContextFromOXM(cl,properties);
  session.setProperty(JAXBContext.class.getName(),jaxbContext);
  return jaxbContext;
}

Fixed version (ground truth):
/** 
 * Create a JAXBConext based on the EntityManagerFactory for this PersistenceContext
 * @param session
 * @return
 */
protected JAXBContext createDynamicJAXBContext(DatabaseSession session) throws JAXBException, IOException {
  JAXBContext jaxbContext=(JAXBContext)session.getProperty(JAXBContext.class.getName());
  if (jaxbContext != null) {
    return jaxbContext;
  }
  Map<String,Object> properties=createJAXBProperties(session);
  ClassLoader cl=session.getPlatform().getConversionManager().getLoader();
  jaxbContext=DynamicJAXBContextFactory.createContextFromOXM(cl,properties);
  session.setProperty(JAXBContext.class.getName(),jaxbContext);
  return jaxbContext;
}