nus-yam/ex-repair huggingface dataset:
Program: 67634
Project: 67634
Buggy source:
public NamespaceInfo processNamespaceInformation(XmlSchema xmlSchema){
  NamespaceInfo info=new NamespaceInfo();
  info.setNamespaceResolver(new NamespaceResolver());
  String packageNamespace=null;
  if (xmlSchema != null) {
    String namespaceMapping=xmlSchema.namespace();
    if (!(namespaceMapping.equals("String_Node_Str") || namespaceMapping.equals("String_Node_Str"))) {
      packageNamespace=namespaceMapping;
    }
    info.setNamespace(packageNamespace);
    XmlNs[] xmlns=xmlSchema.xmlns();
    for (int i=0; i < xmlns.length; i++) {
      XmlNs next=xmlns[i];
      info.getNamespaceResolver().put(next.prefix(),next.namespaceURI());
    }
    info.setAttributeFormQualified(xmlSchema.attributeFormDefault() == XmlNsForm.QUALIFIED);
    info.setElementFormQualified(xmlSchema.elementFormDefault() == XmlNsForm.QUALIFIED);
    String location=xmlSchema.location();
    if (location != null) {
      if (location.equals("String_Node_Str")) {
        location=null;
      }
 else       if (location.equals("String_Node_Str")) {
        location=null;
      }
    }
    info.setLocation(location);
  }
  return info;
}

Fixed version (ground truth):
public NamespaceInfo processNamespaceInformation(XmlSchema xmlSchema){
  NamespaceInfo info=new NamespaceInfo();
  info.setNamespaceResolver(new NamespaceResolver());
  String packageNamespace=null;
  if (xmlSchema != null) {
    String namespaceMapping=xmlSchema.namespace();
    if (!(namespaceMapping.equals("String_Node_Str") || namespaceMapping.equals("String_Node_Str"))) {
      packageNamespace=namespaceMapping;
    }
    info.setNamespace(packageNamespace);
    XmlNs[] xmlns=xmlSchema.xmlns();
    for (int i=0; i < xmlns.length; i++) {
      XmlNs next=xmlns[i];
      info.getNamespaceResolver().put(next.prefix(),next.namespaceURI());
    }
    info.setAttributeFormQualified(xmlSchema.attributeFormDefault() == XmlNsForm.QUALIFIED);
    info.setElementFormQualified(xmlSchema.elementFormDefault() == XmlNsForm.QUALIFIED);
    try {
      Method locationMethod=PrivilegedAccessHelper.getDeclaredMethod(XmlSchema.class,"String_Node_Str",new Class[]{});
      String location=(String)PrivilegedAccessHelper.invokeMethod(locationMethod,xmlSchema,new Object[]{});
      if (location != null) {
        if (location.equals("String_Node_Str")) {
          location=null;
        }
 else         if (location.equals("String_Node_Str")) {
          location=null;
        }
      }
      info.setLocation(location);
    }
 catch (    Exception ex) {
    }
  }
  return info;
}
Program: 67635
Project: 67635
Buggy source:
/** 
 * INTERNAL: Return the message for the given exception class and error number. Based on the state of the translate flag - look up translation for the key:value message
 * @param localizationClassName
 * @param key
 * @param arguments
 * @param translate
 * @return
 */
public static String buildMessage(String localizationClassName,String key,Object[] arguments,boolean translate){
  String message=key;
  ResourceBundle bundle=null;
  String append="String_Node_Str";
  if (arguments != null) {
    for (int i=0; i < arguments.length; i++) {
      if (arguments[i] == null) {
        arguments[i]="String_Node_Str";
      }
    }
  }
  bundle=ResourceBundle.getBundle("String_Node_Str" + localizationClassName + "String_Node_Str",Locale.getDefault());
  try {
    message=bundle.getString(key);
  }
 catch (  java.util.MissingResourceException mre) {
    bundle=ResourceBundle.getBundle("String_Node_Str",Locale.getDefault());
    if (translate && !Locale.getDefault().getLanguage().equals(Locale.ENGLISH.getLanguage())) {
      append=bundle.getString("String_Node_Str");
    }
  }
  return MessageFormat.format(message,arguments) + append;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the message for the given exception class and error number. Based on the state of the translate flag - look up translation for the key:value message
 * @param localizationClassName
 * @param key
 * @param arguments
 * @param translate
 * @return
 */
public static String buildMessage(String localizationClassName,String key,Object[] arguments,boolean translate){
  String message=key;
  ResourceBundle bundle=null;
  if (arguments != null) {
    for (int i=0; i < arguments.length; i++) {
      if (arguments[i] == null) {
        arguments[i]="String_Node_Str";
      }
    }
  }
  bundle=ResourceBundle.getBundle("String_Node_Str" + localizationClassName + "String_Node_Str",Locale.getDefault());
  try {
    message=bundle.getString(key);
  }
 catch (  java.util.MissingResourceException mre) {
    bundle=ResourceBundle.getBundle("String_Node_Str",Locale.getDefault());
    String noTranslationMessage=bundle.getString("String_Node_Str");
    if (translate) {
      return MessageFormat.format(message,arguments) + noTranslationMessage;
    }
 else {
      return MessageFormat.format(message,arguments);
    }
  }
  return MessageFormat.format(message,arguments);
}
Program: 67639
Project: 67639
Buggy source:
protected Map createMap(int size){
  if (this.referenceMode != null && this.referenceMode != ReferenceMode.HARD)   return new IdentityWeakHashMap(size);
  return new IdentityHashMap(size);
}

Fixed version (ground truth):
/** 
 * This method is used internally to create a map to hold the persistenceContexts.  A weak map is returned if ReferenceMode is weak.  
 * @param size
 */
protected Map createMap(int size){
  if (this.referenceMode != null && this.referenceMode != ReferenceMode.HARD)   return new IdentityWeakHashMap(size);
  return new IdentityHashMap(size);
}
Program: 67640
Project: 67640
Buggy source:
/** 
 * Convert the object to an instance of Double.
 * @param sourceObject Object of type String or Number.
 * @caught exception    The Double(String) constructor throws aNumberFormatException if the String does not contain a parsable double.
 */
protected Double convertObjectToDouble(Object sourceObject) throws ConversionException {
  try {
    if (sourceObject instanceof String) {
      if (XMLConstants.POSITIVE_INFINITY.equals(sourceObject)) {
        return new Double(Double.POSITIVE_INFINITY);
      }
 else       if (XMLConstants.NEGATIVE_INFINITY.equals(sourceObject)) {
        return new Double(Double.NEGATIVE_INFINITY);
      }
      return new Double((String)sourceObject);
    }
    if (sourceObject instanceof Number) {
      return new Double(((Number)sourceObject).doubleValue());
    }
  }
 catch (  NumberFormatException exception) {
    throw ConversionException.couldNotBeConverted(sourceObject,ClassConstants.DOUBLE,exception);
  }
  throw ConversionException.couldNotBeConverted(sourceObject,ClassConstants.DOUBLE);
}

Fixed version (ground truth):
/** 
 * Convert the object to an instance of Double.
 * @param sourceObject Object of type String or Number.
 * @caught exception    The Double(String) constructor throws aNumberFormatException if the String does not contain a parsable double.
 */
protected Double convertObjectToDouble(Object sourceObject) throws ConversionException {
  if (sourceObject instanceof String) {
    if (XMLConstants.POSITIVE_INFINITY.equals(sourceObject)) {
      return new Double(Double.POSITIVE_INFINITY);
    }
 else     if (XMLConstants.NEGATIVE_INFINITY.equals(sourceObject)) {
      return new Double(Double.NEGATIVE_INFINITY);
    }
 else {
      return super.convertObjectToDouble(sourceObject);
    }
  }
 else {
    return super.convertObjectToDouble(sourceObject);
  }
}
Program: 67641
Project: 67641
Buggy source:
/** 
 * Build a valid Float instance from a String or another Number instance.
 * @caught exception    The Float(String) constructor throws aNumberFormatException if the String does not contain a parsable Float.
 */
protected Float convertObjectToFloat(Object sourceObject) throws ConversionException {
  try {
    if (sourceObject instanceof String) {
      if (XMLConstants.POSITIVE_INFINITY.equals(sourceObject)) {
        return new Float(Float.POSITIVE_INFINITY);
      }
 else       if (XMLConstants.NEGATIVE_INFINITY.equals(sourceObject)) {
        return new Float(Float.NEGATIVE_INFINITY);
      }
      return new Float((String)sourceObject);
    }
    if (sourceObject instanceof Number) {
      return new Float(((Number)sourceObject).floatValue());
    }
  }
 catch (  NumberFormatException exception) {
    throw ConversionException.couldNotBeConverted(sourceObject,ClassConstants.FLOAT,exception);
  }
  throw ConversionException.couldNotBeConverted(sourceObject,ClassConstants.FLOAT);
}

Fixed version (ground truth):
/** 
 * Build a valid Float instance from a String or another Number instance.
 * @caught exception    The Float(String) constructor throws aNumberFormatException if the String does not contain a parsable Float.
 */
protected Float convertObjectToFloat(Object sourceObject) throws ConversionException {
  if (sourceObject instanceof String) {
    if (XMLConstants.POSITIVE_INFINITY.equals(sourceObject)) {
      return new Float(Float.POSITIVE_INFINITY);
    }
 else     if (XMLConstants.NEGATIVE_INFINITY.equals(sourceObject)) {
      return new Float(Float.NEGATIVE_INFINITY);
    }
    return super.convertObjectToFloat(sourceObject);
  }
 else {
    return super.convertObjectToFloat(sourceObject);
  }
}
Program: 67642
Project: 67642
Buggy source:
public XMLCompositeDirectCollectionMapping generateDirectCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  JavaClass collectionType=property.getType();
  if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  XMLField xmlField=getXPathForField(property,namespaceInfo,true);
  mapping.setField(xmlField);
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  if (helper.isAnnotationPresent(property.getElement(),XmlList.class)) {
    mapping.setUsesSingleNode(true);
  }
  descriptor.addMapping(mapping);
  return mapping;
}

Fixed version (ground truth):
public XMLCompositeDirectCollectionMapping generateDirectCollectionMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLCompositeDirectCollectionMapping mapping=new XMLCompositeDirectCollectionMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  JavaClass collectionType=property.getType();
  if (areEquals(collectionType,Collection.class) || areEquals(collectionType,List.class)) {
    collectionType=jotArrayList;
  }
 else   if (areEquals(collectionType,Set.class)) {
    collectionType=jotHashSet;
  }
  mapping.useCollectionClassName(collectionType.getRawName());
  XMLField xmlField=getXPathForField(property,namespaceInfo,true);
  mapping.setField(xmlField);
  if (XMLConstants.QNAME_QNAME.equals(property.getSchemaType())) {
    ((XMLField)mapping.getField()).setSchemaType(XMLConstants.QNAME_QNAME);
  }
  if (xmlField.getXPathFragment().isAttribute()) {
    mapping.setUsesSingleNode(true);
  }
  if (helper.isAnnotationPresent(property.getElement(),XmlList.class)) {
    mapping.setUsesSingleNode(true);
  }
  descriptor.addMapping(mapping);
  return mapping;
}
Program: 67643
Project: 67643
Buggy source:
/** 
 * INTERNAL: 
 */
public EntityClassListenerMetadata(EntityAccessor accessor){
  super(null,null,accessor.getAccessibleObject());
  m_accessor=accessor;
  setPostLoad(accessor.getPostLoad());
  setPostPersist(accessor.getPostPersist());
  setPostRemove(accessor.getPostRemove());
  setPostUpdate(accessor.getPostUpdate());
  setPrePersist(accessor.getPrePersist());
  setPreRemove(accessor.getPreRemove());
  setPreUpdate(accessor.getPreUpdate());
}

Fixed version (ground truth):
/** 
 * INTERNAL: 
 */
public EntityClassListenerMetadata(EntityAccessor accessor){
  super(null,null,accessor.getAccessibleObject());
  m_accessor=accessor;
  m_descriptor=accessor.getDescriptor();
  setPostLoad(accessor.getPostLoad());
  setPostPersist(accessor.getPostPersist());
  setPostRemove(accessor.getPostRemove());
  setPostUpdate(accessor.getPostUpdate());
  setPrePersist(accessor.getPrePersist());
  setPreRemove(accessor.getPreRemove());
  setPreUpdate(accessor.getPreUpdate());
}
Program: 67644
Project: 67644
Buggy source:
/** 
 * INTERNAL: 
 */
public void process(List<MappedSuperclassAccessor> mappedSuperclasses){
  m_listener=new EntityClassListener(m_accessor.getJavaClass());
  processCallbackMethods(getDeclaredMethods(m_accessor.getJavaClass()),m_accessor.getLogger());
  if (!m_accessor.getDescriptor().excludeSuperclassListeners()) {
    for (    MappedSuperclassAccessor mappedSuperclass : mappedSuperclasses) {
      processCallbackMethods(getDeclaredMethods(mappedSuperclass.getJavaClass()),m_accessor.getLogger());
    }
  }
  if (m_listener.hasCallbackMethods()) {
    m_accessor.getDescriptor().setEntityEventListener(m_listener);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: 
 */
public void process(List<MappedSuperclassAccessor> mappedSuperclasses){
  m_listener=new EntityClassListener(m_accessor.getJavaClass());
  processCallbackMethods(getDeclaredMethods(m_accessor.getJavaClass()),m_descriptor);
  if (!m_descriptor.excludeSuperclassListeners()) {
    for (    MappedSuperclassAccessor mappedSuperclass : mappedSuperclasses) {
      processCallbackMethods(getDeclaredMethods(mappedSuperclass.getJavaClass()),m_descriptor);
    }
  }
  if (m_listener.hasCallbackMethods()) {
    m_descriptor.setEntityEventListener(m_listener);
  }
}
Program: 67646
Project: 67646
Buggy source:
/** 
 * INTERNAL: 
 */
public void process(MetadataDescriptor descriptor,ClassLoader loader,boolean isDefaultListener){
  if (m_entityListenerClass == null) {
    m_entityListenerClass=getClassForName(m_className,loader);
  }
  m_listener=new EntityListener(getClassForName(m_entityListenerClass.getName(),loader),descriptor.getJavaClass());
  processCallbackMethods(getCandidateCallbackMethodsForEntityListener(),descriptor.getLogger());
  if (isDefaultListener) {
    descriptor.addDefaultEventListener(m_listener);
  }
 else {
    descriptor.addEntityListenerEventListener(m_listener);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: 
 */
public void process(MetadataDescriptor descriptor,ClassLoader loader,boolean isDefaultListener){
  if (m_entityListenerClass == null) {
    m_entityListenerClass=getClassForName(m_className,loader);
  }
  m_listener=new EntityListener(getClassForName(m_entityListenerClass.getName(),loader),descriptor.getJavaClass());
  processCallbackMethods(getCandidateCallbackMethodsForEntityListener(),descriptor);
  if (isDefaultListener) {
    descriptor.addDefaultEventListener(m_listener);
  }
 else {
    descriptor.addEntityListenerEventListener(m_listener);
  }
}
Program: 67647
Project: 67647
Buggy source:
public void addTests(){
  addTest(getReadObjectTestSuite());
  addTest(getReadAllTestSuite());
  addTest(getSessionBrokerClientQueryTestSuite());
  addTest(new SessionBrokerPlatformTest());
  addTest(new ReadOnlyClassesInSessionBrokerTest());
  addTest(new VerifyClientBrokerCreationTest());
}

Fixed version (ground truth):
public void addTests(){
  addTest(getReadObjectTestSuite());
  addTest(getReadAllTestSuite());
  addTest(getSessionBrokerClientQueryTestSuite());
  addTest(new SessionBrokerPlatformTest());
  addTest(new ReadOnlyClassesInSessionBrokerTest());
  addTest(new VerifyClientBrokerCreationTest());
  addTest(new SessionBrokerCustomFunctionTest(SessionBrokerCustomFunctionTest.READALLQUERY_TEST));
  addTest(new SessionBrokerCustomFunctionTest(SessionBrokerCustomFunctionTest.UPDATEALLQUERY_TEST));
  addTest(new SessionBrokerCustomFunctionTest(SessionBrokerCustomFunctionTest.DELETEALLQUERY_TEST));
}
Program: 67648
Project: 67648
Buggy source:
public ExpressionSQLPrinter(AbstractSession session,AbstractRecord translationRow,SQLCall call,boolean printQualifiedNames){
  this.session=session;
  this.translationRow=translationRow;
  this.call=call;
  this.shouldPrintQualifiedNames=printQualifiedNames;
  this.requiresDistinct=false;
  isFirstElementPrinted=false;
}

Fixed version (ground truth):
public ExpressionSQLPrinter(AbstractSession session,AbstractRecord translationRow,SQLCall call,boolean printQualifiedNames,ExpressionBuilder builder){
  this.session=session;
  this.translationRow=translationRow;
  this.call=call;
  this.shouldPrintQualifiedNames=printQualifiedNames;
  if (builder == null || builder.getDescriptor() == null) {
    this.platform=(DatabasePlatform)getSession().getPlatform();
  }
 else {
    this.platform=(DatabasePlatform)getSession().getPlatform(builder.getDescriptor().getJavaClass());
  }
  this.requiresDistinct=false;
  isFirstElementPrinted=false;
}
Program: 67649
Project: 67649
Buggy source:
/** 
 * INTERNAL: Return the database platform specific information.
 */
public DatabasePlatform getPlatform(){
  return session.getPlatform();
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the database platform specific information.
 */
public DatabasePlatform getPlatform(){
  return this.platform;
}
Program: 67650
Project: 67650
Buggy source:
/** 
 * Return SQL call for the statement, through generating the SQL string.
 */
public DatabaseCall buildCall(AbstractSession session){
  SQLCall call=(SQLCall)super.buildCall(session);
  Writer writer=new CharArrayWriter(100);
  try {
    writer.write(call.getSQLString());
    boolean whereWasPrinted=true;
    if (selectCallForExist != null) {
      if (shouldExtractWhereClauseFromSelectCallForExist) {
        whereWasPrinted=writeWhere(writer,selectCallForExist,call);
      }
 else {
        writer.write("String_Node_Str");
        writeSelect(writer,selectCallForExist,tableAliasInSelectCallForExist,call);
        writer.write("String_Node_Str");
      }
    }
 else     if (inheritanceExpression != null) {
      writer.write("String_Node_Str");
      ExpressionSQLPrinter printer=new ExpressionSQLPrinter(session,getTranslationRow(),call,false);
      printer.setWriter(writer);
      printer.printExpression(inheritanceExpression);
    }
 else {
      whereWasPrinted=false;
    }
    if (selectCallForNotExist != null) {
      if (whereWasPrinted) {
        writer.write("String_Node_Str");
      }
 else {
        writer.write("String_Node_Str");
      }
      writer.write("String_Node_Str");
      writeSelect(writer,selectCallForNotExist,tableAliasInSelectCallForNotExist,call);
      writer.write("String_Node_Str");
    }
    call.setSQLString(writer.toString());
  }
 catch (  IOException exception) {
    throw ValidationException.fileError(exception);
  }
  return call;
}

Fixed version (ground truth):
/** 
 * Return SQL call for the statement, through generating the SQL string.
 */
public DatabaseCall buildCall(AbstractSession session){
  SQLCall call=(SQLCall)super.buildCall(session);
  Writer writer=new CharArrayWriter(100);
  try {
    writer.write(call.getSQLString());
    boolean whereWasPrinted=true;
    if (selectCallForExist != null) {
      if (shouldExtractWhereClauseFromSelectCallForExist) {
        whereWasPrinted=writeWhere(writer,selectCallForExist,call);
      }
 else {
        writer.write("String_Node_Str");
        writeSelect(writer,selectCallForExist,tableAliasInSelectCallForExist,call);
        writer.write("String_Node_Str");
      }
    }
 else     if (inheritanceExpression != null) {
      writer.write("String_Node_Str");
      ExpressionSQLPrinter printer=new ExpressionSQLPrinter(session,getTranslationRow(),call,false,getBuilder());
      printer.setWriter(writer);
      printer.printExpression(inheritanceExpression);
    }
 else {
      whereWasPrinted=false;
    }
    if (selectCallForNotExist != null) {
      if (whereWasPrinted) {
        writer.write("String_Node_Str");
      }
 else {
        writer.write("String_Node_Str");
      }
      writer.write("String_Node_Str");
      writeSelect(writer,selectCallForNotExist,tableAliasInSelectCallForNotExist,call);
      writer.write("String_Node_Str");
    }
    call.setSQLString(writer.toString());
  }
 catch (  IOException exception) {
    throw ValidationException.fileError(exception);
  }
  return call;
}
Program: 67651
Project: 67651
Buggy source:
/** 
 * Append the string containing the SQL insert string for the given table.
 */
public DatabaseCall buildCall(AbstractSession session){
  SQLCall call=new SQLCall();
  call.returnNothing();
  Writer writer=new CharArrayWriter(100);
  try {
    writer.write("String_Node_Str");
    if (getHintString() != null) {
      writer.write(getHintString());
      writer.write("String_Node_Str");
    }
    writer.write("String_Node_Str");
    writer.write(getTable().getQualifiedName());
    if (getWhereClause() != null) {
      writer.write("String_Node_Str");
      ExpressionSQLPrinter printer=new ExpressionSQLPrinter(session,getTranslationRow(),call,false);
      printer.setWriter(writer);
      printer.printExpression(getWhereClause());
    }
    call.setSQLString(writer.toString());
  }
 catch (  IOException exception) {
    throw ValidationException.fileError(exception);
  }
  return call;
}

Fixed version (ground truth):
/** 
 * Append the string containing the SQL insert string for the given table.
 */
public DatabaseCall buildCall(AbstractSession session){
  SQLCall call=new SQLCall();
  call.returnNothing();
  Writer writer=new CharArrayWriter(100);
  try {
    writer.write("String_Node_Str");
    if (getHintString() != null) {
      writer.write(getHintString());
      writer.write("String_Node_Str");
    }
    writer.write("String_Node_Str");
    writer.write(getTable().getQualifiedName());
    if (getWhereClause() != null) {
      writer.write("String_Node_Str");
      ExpressionSQLPrinter printer=new ExpressionSQLPrinter(session,getTranslationRow(),call,false,getBuilder());
      printer.setWriter(writer);
      printer.printExpression(getWhereClause());
    }
    call.setSQLString(writer.toString());
  }
 catch (  IOException exception) {
    throw ValidationException.fileError(exception);
  }
  return call;
}
Program: 67652
Project: 67652
Buggy source:
/** 
 * Print the SQL representation of the statement on a stream.
 */
public DatabaseCall buildCall(AbstractSession session){
  SQLCall call=new SQLCall();
  call.returnManyRows();
  Writer writer=new CharArrayWriter(200);
  ExpressionSQLPrinter printer=new ExpressionSQLPrinter(session,getTranslationRow(),call,requiresAliases());
  printer.setWriter(writer);
  session.getPlatform().printSQLSelectStatement(call,printer,this);
  call.setSQLString(writer.toString());
  return call;
}

Fixed version (ground truth):
/** 
 * Print the SQL representation of the statement on a stream.
 */
public DatabaseCall buildCall(AbstractSession session){
  SQLCall call=new SQLCall();
  call.returnManyRows();
  Writer writer=new CharArrayWriter(200);
  ExpressionSQLPrinter printer=new ExpressionSQLPrinter(session,getTranslationRow(),call,requiresAliases(),getBuilder());
  printer.setWriter(writer);
  session.getPlatform().printSQLSelectStatement(call,printer,this);
  call.setSQLString(writer.toString());
  return call;
}
Program: 67656
Project: 67656
Buggy source:
public ArrayList<Property> getPropertiesForClass(JavaClass cls,TypeInfo info){
  if (info.getAccessType() == XmlAccessType.FIELD) {
    return getFieldPropertiesForClass(cls,info,false);
  }
 else   if (info.getAccessType() == XmlAccessType.PROPERTY) {
    return getPropertyPropertiesForClass(cls,info,false);
  }
 else   if (info.getAccessType() == XmlAccessType.PUBLIC_MEMBER) {
    return getPublicMemberPropertiesForClass(cls,info);
  }
 else {
    return getNoAccessTypePropertiesForClass(cls,info);
  }
}

Fixed version (ground truth):
public ArrayList<Property> getPropertiesForClass(JavaClass cls,TypeInfo info){
  ArrayList<Property> returnList;
  if (info.getAccessType() == XmlAccessType.FIELD) {
    returnList=getFieldPropertiesForClass(cls,info,false);
  }
 else   if (info.getAccessType() == XmlAccessType.PROPERTY) {
    returnList=getPropertyPropertiesForClass(cls,info,false);
  }
 else   if (info.getAccessType() == XmlAccessType.PUBLIC_MEMBER) {
    returnList=getPublicMemberPropertiesForClass(cls,info);
  }
 else {
    returnList=getNoAccessTypePropertiesForClass(cls,info);
  }
  if (info.getXmlValueProperty() != null) {
    for (    Property nextProp : returnList) {
      if (!nextProp.equals(info.getXmlValueProperty()) && !nextProp.isAttribute()) {
        throw JAXBException.propertyOrFieldShouldBeAnAttribute(nextProp.getPropertyName());
      }
    }
  }
  return returnList;
}
Program: 67659
Project: 67659
Buggy source:
/** 
 * Returns true if the field or method passed in is annotated with JAXB annotations.
 */
private boolean hasJAXBAnnotations(JavaHasAnnotations elem){
  if (helper.isAnnotationPresent(elem,XmlElement.class) || helper.isAnnotationPresent(elem,XmlAttribute.class) || helper.isAnnotationPresent(elem,XmlAnyElement.class)|| helper.isAnnotationPresent(elem,XmlAnyAttribute.class)|| helper.isAnnotationPresent(elem,XmlValue.class)|| helper.isAnnotationPresent(elem,XmlElements.class)|| helper.isAnnotationPresent(elem,XmlElementRef.class)|| helper.isAnnotationPresent(elem,XmlElementRefs.class)|| helper.isAnnotationPresent(elem,XmlID.class)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Returns true if the field or method passed in is annotated with JAXB annotations.
 */
private boolean hasJAXBAnnotations(JavaHasAnnotations elem){
  if (helper.isAnnotationPresent(elem,XmlElement.class) || helper.isAnnotationPresent(elem,XmlAttribute.class) || helper.isAnnotationPresent(elem,XmlAnyElement.class)|| helper.isAnnotationPresent(elem,XmlAnyAttribute.class)|| helper.isAnnotationPresent(elem,XmlValue.class)|| helper.isAnnotationPresent(elem,XmlElements.class)|| helper.isAnnotationPresent(elem,XmlElementRef.class)|| helper.isAnnotationPresent(elem,XmlElementRefs.class)|| helper.isAnnotationPresent(elem,XmlID.class)|| helper.isAnnotationPresent(elem,XmlSchemaType.class)) {
    return true;
  }
  return false;
}
Program: 67666
Project: 67666
Buggy source:
public boolean isCollectionType(Property field){
  JavaClass type=field.getType();
  if (helper.getJavaClass(java.util.Collection.class).isAssignableFrom(type) || helper.getJavaClass(java.util.List.class).isAssignableFrom(type) || helper.getJavaClass(java.util.Set.class).isAssignableFrom(type)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isCollectionType(JavaClass type){
  if (helper.getJavaClass(java.util.Collection.class).isAssignableFrom(type) || helper.getJavaClass(java.util.List.class).isAssignableFrom(type) || helper.getJavaClass(java.util.Set.class).isAssignableFrom(type)) {
    return true;
  }
  return false;
}
Program: 67668
Project: 67668
Buggy source:
public void generateAnyObjectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLAnyObjectMapping mapping=new XMLAnyObjectMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
  descriptor.addMapping(mapping);
}

Fixed version (ground truth):
public void generateAnyObjectMapping(Property property,XMLDescriptor descriptor,NamespaceInfo namespaceInfo){
  XMLAnyObjectMapping mapping=new XMLAnyObjectMapping();
  mapping.setAttributeName(property.getPropertyName());
  if (property.isMethodProperty()) {
    mapping.setGetMethodName(property.getGetMethodName());
    mapping.setSetMethodName(property.getSetMethodName());
  }
  if (property.getType().getQualifiedName().equals("String_Node_Str")) {
    mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT);
  }
 else {
    mapping.setKeepAsElementPolicy(UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT);
  }
  descriptor.addMapping(mapping);
}
Program: 67672
Project: 67672
Buggy source:
@Override protected void addProblemsTo(List newProblems){
  super.addProblemsTo(newProblems);
  checkTargetPrimaryKey(newProblems);
}

Fixed version (ground truth):
@Override protected void addProblemsTo(List newProblems){
  super.addProblemsTo(newProblems);
  checkXmlFieldPairsNotZero(newProblems);
  checkTargetPrimaryKey(newProblems);
}
Program: 67673
Project: 67673
Buggy source:
public MWXmlFieldPair xmlFieldPairAt(int index){
  return this.xmlFieldPairs.get(index);
}

Fixed version (ground truth):
public MWXmlFieldPair xmlFieldPairAt(int index){
  if (index < this.xmlFieldPairsSize()) {
    return this.xmlFieldPairs.get(index);
  }
  return null;
}
Program: 67674
Project: 67674
Buggy source:
public MWXmlField firstMappedXmlField(){
  MWXmlFieldPair firstFieldPair=xmlFieldPairAt(0);
  if (firstFieldPair.getSourceXmlField().isResolved()) {
    return firstFieldPair.getSourceXmlField();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
public MWXmlField firstMappedXmlField(){
  MWXmlFieldPair firstFieldPair=xmlFieldPairAt(0);
  if (firstFieldPair != null && firstFieldPair.getSourceXmlField() != null && firstFieldPair.getSourceXmlField().isResolved()) {
    return firstFieldPair.getSourceXmlField();
  }
 else {
    return null;
  }
}
Program: 67675
Project: 67675
Buggy source:
public String getPackageName(){
  return jClass.getPackage().getName();
}

Fixed version (ground truth):
public String getPackageName(){
  if (jClass.getPackage() != null) {
    return jClass.getPackage().getName();
  }
  return null;
}
Program: 67676
Project: 67676
Buggy source:
public Binder createBinder(){
  return new JAXBBinder(this.xmlContext);
}

Fixed version (ground truth):
public Binder createBinder(Class nodeClass){
  if (nodeClass.getName().equals("String_Node_Str")) {
    return new JAXBBinder(this.xmlContext);
  }
 else {
    throw new UnsupportedOperationException(JAXBException.unsupportedNodeClass(nodeClass.getName()));
  }
}
Program: 67677
Project: 67677
Buggy source:
private XMLDescriptor buildAnyDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(Any.class);
  descriptor.setNamespaceResolver(namespaceResolver);
  descriptor.setDefaultRootElement(XMLConstants.SCHEMA_PREFIX + "String_Node_Str");
  XMLDirectMapping processContentsMapping=new XMLDirectMapping();
  processContentsMapping.setAttributeName("String_Node_Str");
  processContentsMapping.setXPath("String_Node_Str");
  descriptor.addMapping(processContentsMapping);
  XMLDirectMapping minOccursMapping=new XMLDirectMapping();
  minOccursMapping.setAttributeName("String_Node_Str");
  minOccursMapping.setXPath("String_Node_Str");
  minOccursMapping.setNullValue(Occurs.ONE);
  descriptor.addMapping(minOccursMapping);
  XMLDirectMapping maxOccursMapping=new XMLDirectMapping();
  maxOccursMapping.setAttributeName("String_Node_Str");
  maxOccursMapping.setXPath("String_Node_Str");
  maxOccursMapping.setNullValue(Occurs.ONE);
  descriptor.addMapping(maxOccursMapping);
  return descriptor;
}

Fixed version (ground truth):
private XMLDescriptor buildAnyDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(Any.class);
  descriptor.setNamespaceResolver(namespaceResolver);
  descriptor.setDefaultRootElement(XMLConstants.SCHEMA_PREFIX + "String_Node_Str");
  XMLDirectMapping processContentsMapping=new XMLDirectMapping();
  processContentsMapping.setAttributeName("String_Node_Str");
  processContentsMapping.setXPath("String_Node_Str");
  descriptor.addMapping(processContentsMapping);
  XMLDirectMapping namespaceMapping=new XMLDirectMapping();
  namespaceMapping.setAttributeName("String_Node_Str");
  namespaceMapping.setXPath("String_Node_Str");
  descriptor.addMapping(namespaceMapping);
  XMLDirectMapping minOccursMapping=new XMLDirectMapping();
  minOccursMapping.setAttributeName("String_Node_Str");
  minOccursMapping.setXPath("String_Node_Str");
  minOccursMapping.setNullValue(Occurs.ONE);
  descriptor.addMapping(minOccursMapping);
  XMLDirectMapping maxOccursMapping=new XMLDirectMapping();
  maxOccursMapping.setAttributeName("String_Node_Str");
  maxOccursMapping.setXPath("String_Node_Str");
  maxOccursMapping.setNullValue(Occurs.ONE);
  descriptor.addMapping(maxOccursMapping);
  return descriptor;
}
Program: 67678
Project: 67678
Buggy source:
private XMLDescriptor buildAnyAttributeDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(AnyAttribute.class);
  descriptor.setNamespaceResolver(namespaceResolver);
  descriptor.setDefaultRootElement("String_Node_Str");
  XMLDirectMapping processContentsMapping=new XMLDirectMapping();
  processContentsMapping.setAttributeName("String_Node_Str");
  processContentsMapping.setXPath("String_Node_Str");
  descriptor.addMapping(processContentsMapping);
  return descriptor;
}

Fixed version (ground truth):
private XMLDescriptor buildAnyAttributeDescriptor(){
  XMLDescriptor descriptor=new XMLDescriptor();
  descriptor.setJavaClass(AnyAttribute.class);
  descriptor.setNamespaceResolver(namespaceResolver);
  descriptor.setDefaultRootElement("String_Node_Str");
  XMLDirectMapping processContentsMapping=new XMLDirectMapping();
  processContentsMapping.setAttributeName("String_Node_Str");
  processContentsMapping.setXPath("String_Node_Str");
  descriptor.addMapping(processContentsMapping);
  XMLDirectMapping namespaceMapping=new XMLDirectMapping();
  namespaceMapping.setAttributeName("String_Node_Str");
  namespaceMapping.setXPath("String_Node_Str");
  descriptor.addMapping(namespaceMapping);
  return descriptor;
}
Program: 67680
Project: 67680
Buggy source:
public Object getAttributeValueFromObject(Object object){
  Object value=nestedAccessor.getAttributeValueFromObject(object);
  if (isContainer) {
    Object results=containerPolicy.containerInstance(containerPolicy.sizeFor(value));
    Object iterator=containerPolicy.iteratorFor(value);
    while (containerPolicy.hasNext(iterator)) {
      Object next=containerPolicy.next(iterator,null);
      if (next instanceof JAXBElement) {
        JAXBElement element=(JAXBElement)next;
        XMLRoot root=new XMLRoot();
        root.setLocalName(element.getName().getLocalPart());
        root.setNamespaceURI(element.getName().getNamespaceURI());
        root.setObject(element.getValue());
        containerPolicy.addInto(root,results,null);
      }
 else {
        containerPolicy.addInto(next,results,null);
      }
    }
    value=results;
  }
 else {
    if (value instanceof JAXBElement) {
      JAXBElement element=(JAXBElement)value;
      XMLRoot root=new XMLRoot();
      root.setLocalName(element.getName().getLocalPart());
      root.setNamespaceURI(element.getName().getNamespaceURI());
      root.setObject(element.getValue());
      value=root;
    }
  }
  return value;
}

Fixed version (ground truth):
public Object getAttributeValueFromObject(Object object){
  Object value=nestedAccessor.getAttributeValueFromObject(object);
  if (isContainer) {
    Object results=containerPolicy.containerInstance(containerPolicy.sizeFor(value));
    Object iterator=containerPolicy.iteratorFor(value);
    while (containerPolicy.hasNext(iterator)) {
      Object next=containerPolicy.next(iterator,null);
      if (next instanceof JAXBElement) {
        JAXBElement element=(JAXBElement)next;
        XMLRoot root=new XMLRoot();
        root.setLocalName(element.getName().getLocalPart());
        root.setNamespaceURI(element.getName().getNamespaceURI());
        root.setObject(element.getValue());
        containerPolicy.addInto(root,results,null);
      }
 else {
        containerPolicy.addInto(next,results,null);
      }
    }
    value=results;
  }
 else {
    if (value != null && value.getClass().getName().equals(JAXB_ELEMENT_CLASSNAME)) {
      JAXBElement element=(JAXBElement)value;
      XMLRoot root=new XMLRoot();
      root.setLocalName(element.getName().getLocalPart());
      root.setNamespaceURI(element.getName().getNamespaceURI());
      root.setObject(element.getValue());
      value=root;
    }
  }
  return value;
}
Program: 67681
Project: 67681
Buggy source:
private JAXBElement createJAXBElement(QName qname,Class theClass,Object value){
  if (ClassConstants.XML_GREGORIAN_CALENDAR.isAssignableFrom(theClass)) {
    theClass=ClassConstants.XML_GREGORIAN_CALENDAR;
  }
 else   if (ClassConstants.DURATION.isAssignableFrom(theClass)) {
    theClass=ClassConstants.DURATION;
  }
  Class scopeClass=qNamesToScopes.get(qname);
  return new JAXBElement(qname,theClass,scopeClass,value);
}

Fixed version (ground truth):
private JAXBElement createJAXBElement(QName qname,Class theClass,Object value){
  if (value != null && value instanceof JAXBElement) {
    return (JAXBElement)value;
  }
  if (ClassConstants.XML_GREGORIAN_CALENDAR.isAssignableFrom(theClass)) {
    theClass=ClassConstants.XML_GREGORIAN_CALENDAR;
  }
 else   if (ClassConstants.DURATION.isAssignableFrom(theClass)) {
    theClass=ClassConstants.DURATION;
  }
  Class scopeClass=qNamesToScopes.get(qname);
  return new JAXBElement(qname,theClass,scopeClass,value);
}
Program: 67682
Project: 67682
Buggy source:
public void generateDescriptorForJAXBElementSubclass(JavaClass javaClass,Project project,NamespaceResolver nsr){
  String jClassName=javaClass.getQualifiedName();
  TypeInfo info=typeInfo.get(jClassName);
  XMLDescriptor xmlDescriptor=new XMLDescriptor();
  xmlDescriptor.setJavaClassName(jClassName);
  String[] factoryMethodParamTypes=info.getFactoryMethodParamTypes();
  MultiArgInstantiationPolicy policy=new MultiArgInstantiationPolicy();
  policy.useFactoryInstantiationPolicy(info.getObjectFactoryClassName(),info.getFactoryMethodName());
  policy.setParameterTypeNames(factoryMethodParamTypes);
  policy.setDefaultValues(new String[]{null});
  xmlDescriptor.setInstantiationPolicy(policy);
  XMLDirectMapping mapping=new XMLDirectMapping();
  mapping.setAttributeName("String_Node_Str");
  mapping.setGetMethodName("String_Node_Str");
  mapping.setSetMethodName("String_Node_Str");
  mapping.setXPath("String_Node_Str");
  mapping.setAttributeClassificationName(factoryMethodParamTypes[0]);
  xmlDescriptor.addMapping(mapping);
  xmlDescriptor.setNamespaceResolver(nsr);
  project.addDescriptor(xmlDescriptor);
  info.setDescriptor(xmlDescriptor);
}

Fixed version (ground truth):
public void generateDescriptorForJAXBElementSubclass(JavaClass javaClass,Project project,NamespaceResolver nsr){
  String jClassName=javaClass.getQualifiedName();
  TypeInfo info=typeInfo.get(jClassName);
  XMLDescriptor xmlDescriptor=new XMLDescriptor();
  xmlDescriptor.setJavaClassName(jClassName);
  String[] factoryMethodParamTypes=info.getFactoryMethodParamTypes();
  MultiArgInstantiationPolicy policy=new MultiArgInstantiationPolicy();
  policy.useFactoryInstantiationPolicy(info.getObjectFactoryClassName(),info.getFactoryMethodName());
  policy.setParameterTypeNames(factoryMethodParamTypes);
  policy.setDefaultValues(new String[]{null});
  xmlDescriptor.setInstantiationPolicy(policy);
  JavaClass paramClass=helper.getJavaClass(factoryMethodParamTypes[0]);
  if (helper.isBuiltInJavaType(paramClass)) {
    XMLDirectMapping mapping=new XMLDirectMapping();
    mapping.setAttributeName("String_Node_Str");
    mapping.setGetMethodName("String_Node_Str");
    mapping.setSetMethodName("String_Node_Str");
    mapping.setXPath("String_Node_Str");
    Class attributeClassification=org.eclipse.persistence.internal.helper.Helper.getClassFromClasseName(factoryMethodParamTypes[0],getClass().getClassLoader());
    mapping.setAttributeClassification(attributeClassification);
    xmlDescriptor.addMapping(mapping);
  }
 else {
    XMLCompositeObjectMapping mapping=new XMLCompositeObjectMapping();
    mapping.setAttributeName("String_Node_Str");
    mapping.setGetMethodName("String_Node_Str");
    mapping.setSetMethodName("String_Node_Str");
    mapping.setXPath("String_Node_Str");
    mapping.setReferenceClassName(factoryMethodParamTypes[0]);
    xmlDescriptor.addMapping(mapping);
  }
  xmlDescriptor.setNamespaceResolver(nsr);
  project.addDescriptor(xmlDescriptor);
  info.setDescriptor(xmlDescriptor);
}
Program: 67685
Project: 67685
Buggy source:
/** 
 * Triggers UnitOfWork valueholders directly without triggering the wrapped valueholder (this). <p> When in transaction and/or for pessimistic locking the UnitOfWorkValueHolder needs to be triggered directly without triggering the wrapped valueholder. However only the wrapped valueholder knows how to trigger the indirection, i.e. it may be a batchValueHolder, and it stores all the info like the row and the query. Note: This method is not thread-safe.  It must be used in a synchronized manner
 */
public Object instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder){
  return instantiate(unitOfWorkValueHolder.getUnitOfWork());
}

Fixed version (ground truth):
/** 
 * Triggers UnitOfWork valueholders directly without triggering the wrapped valueholder (this). <p> When in transaction and/or for pessimistic locking the UnitOfWorkValueHolder needs to be triggered directly without triggering the wrapped valueholder. However only the wrapped valueholder knows how to trigger the indirection, i.e. it may be a batchValueHolder, and it stores all the info like the row and the query. Note: This method is not thread-safe. It must be used in a synchronized manner
 */
public Object instantiateForUnitOfWorkValueHolder(UnitOfWorkValueHolder unitOfWorkValueHolder){
  return instantiate(unitOfWorkValueHolder.getUnitOfWork());
}
Program: 67686
Project: 67686
Buggy source:
/** 
 * Releases a wrapped valueholder privately owned by a particular unit of work. <p> When unit of work clones are built directly from rows no object in the shared cache points to this valueholder, so it can store the unit of work as its session.  However once that UnitOfWork commits and the valueholder is merged into the shared cache, the session needs to be reset to the root session, ie. the server session.
 */
public void releaseWrappedValueHolder(){
  AbstractSession session=getSession();
  if ((session != null) && session.isUnitOfWork()) {
    setSession(session.getRootSession(query));
  }
}

Fixed version (ground truth):
/** 
 * Releases a wrapped valueholder privately owned by a particular unit of work. <p> When unit of work clones are built directly from rows no object in the shared cache points to this valueholder, so it can store the unit of work as its session. However once that UnitOfWork commits and the valueholder is merged into the shared cache, the session needs to be reset to the root session, ie. the server session.
 */
public void releaseWrappedValueHolder(){
  AbstractSession session=getSession();
  if ((session != null) && session.isUnitOfWork()) {
    setSession(session.getRootSession(query));
  }
}
Program: 67687
Project: 67687
Buggy source:
/** 
 * INTERNAL: Answers if this valueholder is a pessimistic locking one.  Such valueholders are special in that they can be triggered multiple times by different UnitsOfWork.  Each time a lock query will be issued.  Hence even if instantiated it may have to be instantiated again, and once instantiated all fields can not be reset. <p> Since locks will be issued each time this valueholder is triggered, triggering this directly on the session in auto commit mode will generate an exception.  This only UnitOfWorkValueHolder's wrapping this can trigger it. Note: This method is not thread-safe.  It must be used in a synchronized manner
 */
public boolean isPessimisticLockingValueHolder(){
  if ((getQuery() == null) || !getQuery().isObjectLevelReadQuery()) {
    return false;
  }
  ObjectLevelReadQuery query=(ObjectLevelReadQuery)getQuery();
  return query.isLockQuery(getSession());
}

Fixed version (ground truth):
/** 
 * INTERNAL: Answers if this valueholder is a pessimistic locking one. Such valueholders are special in that they can be triggered multiple times by different UnitsOfWork. Each time a lock query will be issued. Hence even if instantiated it may have to be instantiated again, and once instantiated all fields can not be reset. <p> Since locks will be issued each time this valueholder is triggered, triggering this directly on the session in auto commit mode will generate an exception. This only UnitOfWorkValueHolder's wrapping this can trigger it. Note: This method is not thread-safe. It must be used in a synchronized manner
 */
public boolean isPessimisticLockingValueHolder(){
  if ((getQuery() == null) || !getQuery().isObjectLevelReadQuery()) {
    return false;
  }
  ObjectLevelReadQuery query=(ObjectLevelReadQuery)getQuery();
  return query.isLockQuery(getSession());
}
Program: 67688
Project: 67688
Buggy source:
/** 
 * Return the query.
 */
protected ReadQuery getQuery(){
  return query;
}

Fixed version (ground truth):
/** 
 * Return the query. The query for a QueryBasedValueHolder is constructed dynamically based on the original query on the parent object and the mapping configuration. If modifying a query the developer must be careful not to change the results returned as that may cause the application to see incorrect results.
 */
public ReadQuery getQuery(){
  return query;
}
Program: 67689
Project: 67689
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  Object value=xmlChoiceCollectionMapping.getAttributeValueFromObject(object);
  if (value == null) {
    return false;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(value);
  while (cp.hasNext(iterator)) {
    Object nextValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,nextValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  Object value=xmlChoiceCollectionMapping.getAttributeValueFromObject(object);
  if (value == null) {
    return false;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(value);
  if (cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return false;
  }
  while (cp.hasNext(iterator)) {
    Object nextValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,nextValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  return true;
}