nus-yam/ex-repair huggingface dataset:
Program: 65111
Project: 65111
Buggy source:
public void testMarshallerFormattedOutput() throws Exception {
  m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
  assertTrue((Boolean)m.getProperty(Marshaller.JAXB_FORMATTED_OUTPUT));
  m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,false);
  assertFalse((Boolean)m.getProperty(Marshaller.JAXB_FORMATTED_OUTPUT));
}

Fixed version (ground truth):
public void testMarshallerFormattedOutput() throws Exception {
  m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
  assertTrue((Boolean)m.getProperty(Marshaller.JAXB_FORMATTED_OUTPUT));
  m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,false);
  assertFalse((Boolean)m.getProperty(Marshaller.JAXB_FORMATTED_OUTPUT));
  try {
    m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,null);
  }
 catch (  PropertyException pException) {
    return;
  }
  fail("String_Node_Str");
}
Program: 65112
Project: 65112
Buggy source:
public void testMarshallerEncoding() throws Exception {
  m.setProperty(Marshaller.JAXB_ENCODING,"String_Node_Str");
  assertEquals("String_Node_Str",m.getProperty(Marshaller.JAXB_ENCODING));
}

Fixed version (ground truth):
public void testMarshallerEncoding() throws Exception {
  m.setProperty(Marshaller.JAXB_ENCODING,"String_Node_Str");
  assertEquals("String_Node_Str",m.getProperty(Marshaller.JAXB_ENCODING));
  m.setProperty(Marshaller.JAXB_ENCODING,null);
  assertNull(m.getProperty(Marshaller.JAXB_ENCODING));
}
Program: 65113
Project: 65113
Buggy source:
public void testMarshallerObjectIdentity() throws Exception {
  String prop="String_Node_Str";
  m.setProperty(prop,false);
  assertFalse((Boolean)m.getProperty(prop));
  m.setProperty(prop,true);
  assertTrue((Boolean)m.getProperty(prop));
}

Fixed version (ground truth):
public void testMarshallerObjectIdentity() throws Exception {
  String prop="String_Node_Str";
  m.setProperty(prop,false);
  assertFalse((Boolean)m.getProperty(prop));
  m.setProperty(prop,true);
  assertTrue((Boolean)m.getProperty(prop));
  try {
    m.setProperty(prop,null);
  }
 catch (  PropertyException pException) {
    return;
  }
  fail("String_Node_Str");
}
Program: 65116
Project: 65116
Buggy source:
private void initialize(){
  XMLPlatform xmlPlatform=XMLPlatformFactory.getInstance().getXMLPlatform();
  transformer=xmlPlatform.newXMLTransformer();
  setEncoding(XMLConstants.DEFAULT_XML_ENCODING);
  setFormattedOutput(true);
  marshalProperties=new Properties();
  includeRoot=true;
  indentString="String_Node_Str";
}

Fixed version (ground truth):
private void initialize(){
  XMLPlatform xmlPlatform=XMLPlatformFactory.getInstance().getXMLPlatform();
  transformer=xmlPlatform.newXMLTransformer();
  setEncoding(XMLConstants.DEFAULT_XML_ENCODING);
  setFormattedOutput(true);
  marshalProperties=new Properties();
  includeRoot=true;
  marshalEmptyCollections=true;
  indentString="String_Node_Str";
}
Program: 65117
Project: 65117
Buggy source:
public final Object readFrom(Class<Object> type,Type genericType,Annotation[] annotations,MediaType mediaType,MultivaluedMap<String,String> httpHeaders,InputStream entityStream) throws IOException, WebApplicationException {
  try {
    Class<?> domainClass=getDomainClass(genericType);
    JAXBContext jaxbContext=getJAXBContext(domainClass,annotations,mediaType,httpHeaders);
    Unmarshaller unmarshaller=jaxbContext.createUnmarshaller();
    unmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,MediaType.APPLICATION_JSON);
    unmarshaller.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT,includeRoot);
    preReadFrom(type,genericType,annotations,mediaType,httpHeaders,unmarshaller);
    return unmarshaller.unmarshal(new StreamSource(entityStream),domainClass).getValue();
  }
 catch (  JAXBException jaxbException) {
    throw new WebApplicationException(jaxbException);
  }
}

Fixed version (ground truth):
public final Object readFrom(Class<Object> type,Type genericType,Annotation[] annotations,MediaType mediaType,MultivaluedMap<String,String> httpHeaders,InputStream entityStream) throws IOException, WebApplicationException {
  try {
    Class<?> domainClass=getDomainClass(genericType);
    JAXBContext jaxbContext=getJAXBContext(domainClass,annotations,mediaType,httpHeaders);
    Unmarshaller unmarshaller=jaxbContext.createUnmarshaller();
    unmarshaller.setProperty(UnmarshallerProperties.MEDIA_TYPE,MediaType.APPLICATION_JSON);
    unmarshaller.setProperty(UnmarshallerProperties.JSON_ATTRIBUTE_PREFIX,attributePrefix);
    unmarshaller.setProperty(UnmarshallerProperties.JSON_INCLUDE_ROOT,includeRoot);
    unmarshaller.setProperty(UnmarshallerProperties.JSON_NAMESPACE_PREFIX_MAPPER,namespacePrefixMapper);
    unmarshaller.setProperty(UnmarshallerProperties.JSON_NAMESPACE_SEPARATOR,namespaceSeperator);
    unmarshaller.setProperty(UnmarshallerProperties.JSON_VALUE_WRAPPER,valueWrapper);
    preReadFrom(type,genericType,annotations,mediaType,httpHeaders,unmarshaller);
    return unmarshaller.unmarshal(new StreamSource(entityStream),domainClass).getValue();
  }
 catch (  JAXBException jaxbException) {
    throw new WebApplicationException(jaxbException);
  }
}
Program: 65118
Project: 65118
Buggy source:
/** 
 * Specify if the root node should be included in the JSON message (default is false).
 * @param includeRoot - true if the message includes the root node, else false.
 */
public void setIncludeRoot(boolean includeRoot){
  this.includeRoot=includeRoot;
}

Fixed version (ground truth):
/** 
 * Specify if the root node should be included in the JSON message (default is false).
 * @param includeRoot - true if the message includes the root node, else false.
 * @see org.eclipse.persistence.jaxb.MarshallerPropertes.JSON_INCLUDE_ROOT
 * @see org.eclipse.persistence.jaxb.UnmarshallerPropertes.JSON_INCLUDE_ROOT
 */
public void setIncludeRoot(boolean includeRoot){
  this.includeRoot=includeRoot;
}
Program: 65119
Project: 65119
Buggy source:
public final void writeTo(Object object,Class<?> type,Type genericType,Annotation[] annotations,MediaType mediaType,MultivaluedMap<String,Object> httpHeaders,OutputStream entityStream) throws IOException, WebApplicationException {
  try {
    Class<?> domainClass=getDomainClass(genericType);
    JAXBContext jaxbContext=getJAXBContext(domainClass,annotations,mediaType,httpHeaders);
    Marshaller marshaller=jaxbContext.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,formattedOutput);
    marshaller.setProperty(MarshallerProperties.MEDIA_TYPE,MediaType.APPLICATION_JSON);
    marshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT,includeRoot);
    preWriteTo(object,type,genericType,annotations,mediaType,httpHeaders,marshaller);
    marshaller.marshal(object,entityStream);
  }
 catch (  JAXBException jaxbException) {
    throw new WebApplicationException(jaxbException);
  }
}

Fixed version (ground truth):
public final void writeTo(Object object,Class<?> type,Type genericType,Annotation[] annotations,MediaType mediaType,MultivaluedMap<String,Object> httpHeaders,OutputStream entityStream) throws IOException, WebApplicationException {
  try {
    Class<?> domainClass=getDomainClass(genericType);
    JAXBContext jaxbContext=getJAXBContext(domainClass,annotations,mediaType,httpHeaders);
    Marshaller marshaller=jaxbContext.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,formattedOutput);
    marshaller.setProperty(MarshallerProperties.MEDIA_TYPE,MediaType.APPLICATION_JSON);
    marshaller.setProperty(MarshallerProperties.JSON_ATTRIBUTE_PREFIX,attributePrefix);
    marshaller.setProperty(MarshallerProperties.JSON_INCLUDE_ROOT,includeRoot);
    marshaller.setProperty(MarshallerProperties.JSON_NAMESPACE_SEPARATOR,namespaceSeperator);
    marshaller.setProperty(MarshallerProperties.JSON_VALUE_WRAPPER,valueWrapper);
    marshaller.setProperty(MarshallerProperties.NAMESPACE_PREFIX_MAPPER,namespacePrefixMapper);
    preWriteTo(object,type,genericType,annotations,mediaType,httpHeaders,marshaller);
    marshaller.marshal(object,entityStream);
  }
 catch (  JAXBException jaxbException) {
    throw new WebApplicationException(jaxbException);
  }
}
Program: 65120
Project: 65120
Buggy source:
/** 
 * @return true if the root node is included in the JSON message (default isfalse).
 */
public boolean isIncludeRoot(){
  return includeRoot;
}

Fixed version (ground truth):
/** 
 * @return true if the root node is included in the JSON message (default isfalse).
 * @see org.eclipse.persistence.jaxb.MarshallerPropertes.JSON_INCLUDE_ROOT
 * @see org.eclipse.persistence.jaxb.UnmarshallerPropertes.JSON_INCLUDE_ROOT
 */
public boolean isIncludeRoot(){
  return includeRoot;
}
Program: 65121
Project: 65121
Buggy source:
/** 
 * INTERNAL: Add abstract class indicator information to the database row.  This is required when building a row for an insert or an update of a concrete child descriptor.
 */
public void addClassIndicatorFieldToRow(AbstractRecord databaseRow){
  if (hasClassExtractor()) {
    return;
  }
  DatabaseField field=getClassIndicatorField();
  Object value=getClassIndicatorValue();
  boolean namespaceAware=((XMLRecord)databaseRow).isNamespaceAware() || ((XMLRecord)databaseRow).hasCustomNamespaceMapper();
  if (!namespaceAware && value instanceof String) {
    int colonIndex=((String)value).indexOf(XMLConstants.COLON);
    if (colonIndex > -1) {
      value=((String)value).substring(colonIndex + 1);
    }
  }
 else   if (namespaceAware && value instanceof String) {
    if (((XMLRecord)databaseRow).getNamespaceSeparator() != XMLConstants.COLON) {
      value=((String)value).replace(XMLConstants.COLON,((XMLRecord)databaseRow).getNamespaceSeparator());
    }
  }
  databaseRow.put(field,value);
}

Fixed version (ground truth):
/** 
 * INTERNAL: Add abstract class indicator information to the database row.  This is required when building a row for an insert or an update of a concrete child descriptor.
 */
public void addClassIndicatorFieldToRow(AbstractRecord databaseRow){
  if (hasClassExtractor()) {
    return;
  }
  DatabaseField field=getClassIndicatorField();
  Object value=getClassIndicatorValue();
  if (usesXsiType) {
    boolean namespaceAware=((XMLRecord)databaseRow).isNamespaceAware() || ((XMLRecord)databaseRow).hasCustomNamespaceMapper();
    if (value instanceof String) {
      if (namespaceAware) {
        if (((XMLRecord)databaseRow).getNamespaceSeparator() != XMLConstants.COLON) {
          value=((String)value).replace(XMLConstants.COLON,((XMLRecord)databaseRow).getNamespaceSeparator());
        }
      }
 else {
        int colonIndex=((String)value).indexOf(XMLConstants.COLON);
        if (colonIndex > -1) {
          value=((String)value).substring(colonIndex + 1);
        }
      }
    }
  }
  databaseRow.put(field,value);
}
Program: 65123
Project: 65123
Buggy source:
public boolean contains(Object item){
  for (  E e : data) {
    if (e == item) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean contains(Object item,boolean equalsUsingIdentity){
  if (equalsUsingIdentity) {
    for (    E e : data) {
      if (e == item) {
        return true;
      }
    }
  }
 else {
    for (    E e : data) {
      if (e.equals(item)) {
        return true;
      }
    }
  }
  return false;
}
Program: 65126
Project: 65126
Buggy source:
/** 
 * The default constructor initializes the list of References.
 */
public ReferenceResolver(){
  references=new ArrayList();
  referencedContainers=new HashMap<ReferenceKey,Object>();
  lookupKey=new ReferenceKey(null,null);
}

Fixed version (ground truth):
/** 
 * The default constructor initializes the list of References.
 */
public ReferenceResolver(){
  references=new ArrayList();
  lookupKey=new ReferenceKey(null,null);
}
Program: 65129
Project: 65129
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlBinaryDataCollectionMapping.isReadOnly()) {
    return false;
  }
  Object collection=xmlBinaryDataCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    AbstractNullPolicy wrapperNP=xmlBinaryDataCollectionMapping.getWrapperNullPolicy();
    if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
      marshalRecord.nilSimple(namespaceResolver);
      return true;
    }
 else {
      return false;
    }
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(collection);
  if (!cp.hasNext(iterator)) {
    if (xmlBinaryDataCollectionMapping.getWrapperNullPolicy() != null) {
      XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
      marshalRecord.closeStartGroupingElements(groupingFragment);
      return true;
    }
 else {
      return false;
    }
  }
  XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
  marshalRecord.closeStartGroupingElements(groupingFragment);
  marshalRecord.startCollection();
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  marshalRecord.endCollection();
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlBinaryDataCollectionMapping.isReadOnly()) {
    return false;
  }
  Object collection=xmlBinaryDataCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    AbstractNullPolicy wrapperNP=xmlBinaryDataCollectionMapping.getWrapperNullPolicy();
    if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
      marshalRecord.nilSimple(namespaceResolver);
      return true;
    }
 else {
      return false;
    }
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(collection);
  if (!cp.hasNext(iterator)) {
    return marshalRecord.emptyCollection(xPathFragment,namespaceResolver,xmlBinaryDataCollectionMapping.getWrapperNullPolicy() != null);
  }
  XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
  marshalRecord.closeStartGroupingElements(groupingFragment);
  marshalRecord.startCollection();
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  marshalRecord.endCollection();
  return true;
}
Program: 65131
Project: 65131
Buggy source:
/** 
 * @override
 * @param xPathFragment
 * @param unmarshalRecord
 * @param atts
 */
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  if (xmlField.getLastXPathFragment().isAttribute()) {
    if (!this.xmlCollectionReferenceMapping.usesSingleNode()) {
      String namespaceURI=xmlField.getLastXPathFragment().getNamespaceURI();
      String value;
      if (namespaceURI == null) {
        value=atts.getValue(xmlField.getLastXPathFragment().getLocalName());
      }
 else {
        value=atts.getValue(namespaceURI,xmlField.getLastXPathFragment().getLocalName());
      }
      xmlCollectionReferenceMapping.buildReference(unmarshalRecord,xmlField,value,unmarshalRecord.getSession());
      return true;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * @override
 * @param xPathFragment
 * @param unmarshalRecord
 * @param atts
 */
public boolean startElement(XPathFragment xPathFragment,UnmarshalRecord unmarshalRecord,Attributes atts){
  if (xmlField.getLastXPathFragment().isAttribute()) {
    if (!this.xmlCollectionReferenceMapping.usesSingleNode()) {
      String namespaceURI=xmlField.getLastXPathFragment().getNamespaceURI();
      String value;
      if (namespaceURI == null) {
        value=atts.getValue(xmlField.getLastXPathFragment().getLocalName());
      }
 else {
        value=atts.getValue(namespaceURI,xmlField.getLastXPathFragment().getLocalName());
      }
      xmlCollectionReferenceMapping.buildReference(unmarshalRecord,xmlField,value,unmarshalRecord.getSession(),unmarshalRecord.getContainerInstance(this));
      return true;
    }
  }
  return true;
}
Program: 65133
Project: 65133
Buggy source:
/** 
 * Handle attribute operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's map of target primary key values - based on the target key field name.  Note  that if a reference already exists for the xmlCollectionReferenceMapping's  source object instance, we will simply add to the target pk value list.   The Reference object is stored on the ReferenceResolver associated with  the UnmarshalRecord's session.
 */
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  if (value != null) {
    Object realValue=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(),unmarshalRecord);
    xmlCollectionReferenceMapping.buildReference(unmarshalRecord,xmlField,realValue,unmarshalRecord.getSession());
  }
}

Fixed version (ground truth):
/** 
 * Handle attribute operation.  Here we will create and populate an  org.eclipse.persistence.internal.oxm.Reference instance to be used during  the mapping resolution stage.  In particular, the primary key value for this element will be added to the Reference object's map of target primary key values - based on the target key field name.  Note  that if a reference already exists for the xmlCollectionReferenceMapping's  source object instance, we will simply add to the target pk value list.   The Reference object is stored on the ReferenceResolver associated with  the UnmarshalRecord's session.
 */
public void attribute(UnmarshalRecord unmarshalRecord,String namespaceURI,String localName,String value){
  if (value != null) {
    Object realValue=unmarshalRecord.getXMLReader().convertValueBasedOnSchemaType(xmlField,value,(XMLConversionManager)unmarshalRecord.getSession().getDatasourcePlatform().getConversionManager(),unmarshalRecord);
    Object container=unmarshalRecord.getContainerInstance(this);
    xmlCollectionReferenceMapping.buildReference(unmarshalRecord,xmlField,realValue,unmarshalRecord.getSession(),container);
  }
}
Program: 65134
Project: 65134
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlCompositeCollectionMapping.isReadOnly()) {
    return false;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object collection=xmlCompositeCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    AbstractNullPolicy wrapperNP=xmlCompositeCollectionMapping.getWrapperNullPolicy();
    if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
      marshalRecord.nilSimple(namespaceResolver);
      return true;
    }
 else {
      return false;
    }
  }
  Object iterator=cp.iteratorFor(collection);
  if (null != iterator && cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    if (xmlCompositeCollectionMapping.getWrapperNullPolicy() != null) {
      XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      return false;
    }
  }
  marshalRecord.startCollection();
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  marshalRecord.endCollection();
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlCompositeCollectionMapping.isReadOnly()) {
    return false;
  }
  ContainerPolicy cp=getContainerPolicy();
  Object collection=xmlCompositeCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    AbstractNullPolicy wrapperNP=xmlCompositeCollectionMapping.getWrapperNullPolicy();
    if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
      marshalRecord.nilSimple(namespaceResolver);
      return true;
    }
 else {
      return false;
    }
  }
  Object iterator=cp.iteratorFor(collection);
  if (null != iterator && cp.hasNext(iterator)) {
    XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
    marshalRecord.closeStartGroupingElements(groupingFragment);
  }
 else {
    return marshalRecord.emptyCollection(xPathFragment,namespaceResolver,xmlCompositeCollectionMapping.getWrapperNullPolicy() != null);
  }
  marshalRecord.startCollection();
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  marshalRecord.endCollection();
  return true;
}
Program: 65139
Project: 65139
Buggy source:
/** 
 * Determines whether the given variable is a valid Java identifier, which means it follows the Java specification. The first letter has to be a Java identifier start and the others have to be Java identifier parts.
 * @param variable The variable to validate
 * @return <code>true</code> if the given variable follows the Java identifier specification;<code>false</code> otherwise
 */
protected boolean isValidJavaIdentifier(String variable){
  for (int index=0, count=variable.length(); index < count; index++) {
    int character=variable.charAt(index);
    if ((index == 0) && !Character.isJavaIdentifierStart(character)) {
      return false;
    }
 else     if ((index > 0) && !Character.isJavaIdentifierPart(character)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Determines whether the given variable is a valid Java identifier, which means it follows the Java specification. The first letter has to be a Java identifier start and the others have to be Java identifier parts.
 * @param variable The variable to validate
 * @return <code>true</code> if the given variable follows the Java identifier specification;<code>false</code> otherwise
 */
protected boolean isValidJavaIdentifier(String variable){
  for (int index=0, count=variable.length(); index < count; index++) {
    int character=variable.charAt(index);
    if ((index == 0) && !Character.isJavaIdentifierStart(character)) {
      return false;
    }
    if ((index > 0) && !Character.isJavaIdentifierPart(character)) {
      return false;
    }
  }
  return true;
}
Program: 65146
Project: 65146
Buggy source:
public Object getObject(String colName,java.util.Map map){
  return getObject(colName);
}

Fixed version (ground truth):
public <T>T getObject(int columnIndex,Class<T> type){
  return null;
}
Program: 65147
Project: 65147
Buggy source:
/** 
 * Retrieves the value of the designated column in the current row of this <code>ResultSet</code> object as an <code>Object</code> in the Java programming language. If the value is an SQL <code>NULL</code>, the driver returns a Java <code>null</code>. This method uses the specified <code>Map</code> object for custom mapping if appropriate.
 * @param colName the name of the column from which to retrieve the value
 * @param map a <code>java.util.Map</code> object that contains the mappingfrom SQL type names to classes in the Java programming language
 * @return an <code>Object</code> representing the SQL value in thespecified column
 * @exception SQLException if a database access error occurs
 * @since 1.2
 */
public Object getObject(String colName,java.util.Map map){
  return getObject(colName);
}

Fixed version (ground truth):
public <T>T getObject(int columnIndex,Class<T> type){
  return null;
}
Program: 65150
Project: 65150
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(CycleRecoverableTestCases.class);
  suite.addTestSuite(ClassLevelAccessorTestCases.class);
  suite.addTestSuite(PackageLevelAccessorTestCases.class);
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTestSuite(CycleRecoverableTestCases.class);
  suite.addTestSuite(ClassLevelAccessorTestCases.class);
  suite.addTestSuite(PackageLevelAccessorTestCases.class);
  suite.addTestSuite(NonELIDResolverTestCases.class);
  suite.addTestSuite(NonELPrefixMapperTestCases.class);
  suite.addTest(XmlLocationTestSuite.suite());
  return suite;
}
Program: 65159
Project: 65159
Buggy source:
/** 
 * INTERNAL: Convenience method that sets up class indicator and @sdoRef attribute.
 * @param xdesc
 * @param pCls
 */
private void addClassIndicator(XMLDescriptor xdesc,Class pCls,boolean isInheritanceRoot){
  XMLField field=(XMLField)getXmlDescriptor().buildField("String_Node_Str");
  xdesc.getInheritancePolicy().setClassIndicatorField(field);
  String parentIndicator=getName();
  String parentPrefix=xdesc.getNamespaceResolver().resolveNamespaceURI(getURI());
  if (parentPrefix != null) {
    parentIndicator=parentPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT + parentIndicator;
  }
  xdesc.getInheritancePolicy().addClassIndicator(pCls,parentIndicator);
  if (xdesc.getMappingForAttributeName(SDO_REF_MAPPING_ATTRIBUTE_NAME) == null) {
    String sdoPrefix=((SDOTypeHelper)aHelperContext.getTypeHelper()).getPrefix(SDOConstants.SDO_URL);
    XMLDirectMapping sdoRefMapping=new XMLDirectMapping();
    sdoRefMapping.setAttributeName(SDO_REF_MAPPING_ATTRIBUTE_NAME);
    XMLField xmlField=new XMLField("String_Node_Str" + sdoPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT+ SDOConstants.CHANGESUMMARY_REF);
    xmlField.getXPathFragment().setNamespaceURI(SDOConstants.SDO_URL);
    xmlField.getLastXPathFragment().setNamespaceURI(SDOConstants.SDO_URL);
    sdoRefMapping.setField(xmlField);
    xdesc.addMapping(sdoRefMapping);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Convenience method that sets up class indicator and @sdoRef attribute.
 * @param xdesc
 * @param pCls
 */
private void addClassIndicator(XMLDescriptor xdesc,Class pCls,boolean isInheritanceRoot){
  XMLField field=(XMLField)getXmlDescriptor().buildField("String_Node_Str");
  field.initialize();
  xdesc.getInheritancePolicy().setClassIndicatorField(field);
  String parentIndicator=getName();
  String parentPrefix=xdesc.getNamespaceResolver().resolveNamespaceURI(getURI());
  if (parentPrefix != null) {
    parentIndicator=parentPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT + parentIndicator;
  }
  xdesc.getInheritancePolicy().addClassIndicator(pCls,parentIndicator);
  if (xdesc.getMappingForAttributeName(SDO_REF_MAPPING_ATTRIBUTE_NAME) == null) {
    String sdoPrefix=((SDOTypeHelper)aHelperContext.getTypeHelper()).getPrefix(SDOConstants.SDO_URL);
    XMLDirectMapping sdoRefMapping=new XMLDirectMapping();
    sdoRefMapping.setAttributeName(SDO_REF_MAPPING_ATTRIBUTE_NAME);
    XMLField xmlField=new XMLField("String_Node_Str" + sdoPrefix + SDOConstants.SDO_XPATH_NS_SEPARATOR_FRAGMENT+ SDOConstants.CHANGESUMMARY_REF);
    xmlField.getXPathFragment().setNamespaceURI(SDOConstants.SDO_URL);
    xmlField.getLastXPathFragment().setNamespaceURI(SDOConstants.SDO_URL);
    sdoRefMapping.setField(xmlField);
    xdesc.addMapping(sdoRefMapping);
  }
}
Program: 65160
Project: 65160
Buggy source:
public boolean isOwningNode(XPathFragment xPathFragment){
  XPathFragment nextFragment=xPathFragment.getNextFragment();
  if (nextFragment == null) {
    return xPathFragment.isAttribute() || xPathFragment.nameIsText();
  }
 else {
    return (nextFragment != null) && (nextFragment.nameIsText() || nextFragment.isAttribute());
  }
}

Fixed version (ground truth):
public boolean isOwningNode(XPathFragment xPathFragment){
  XPathFragment nextFragment=xPathFragment.getNextFragment();
  if (nextFragment == null || xmlCompositeDirectCollectionMapping.usesSingleNode()) {
    return xPathFragment.isAttribute() || xPathFragment.nameIsText();
  }
 else {
    return (nextFragment != null) && (nextFragment.nameIsText() || nextFragment.isAttribute());
  }
}
Program: 65161
Project: 65161
Buggy source:
@Test public void emprecRefCursorTest2(){
  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);
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  Document doc=xmlPlatform.createDocument();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(NAMES_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@Test public void emprecRefCursorTest2(){
  XMLUnmarshaller unmarshaller=xrService.getXMLContext().createUnmarshaller();
  Object inputTab=unmarshaller.unmarshal(new StringReader(TABLE2_XML));
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str",inputTab);
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  Document doc=xmlPlatform.createDocument();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(NAMES_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}
Program: 65162
Project: 65162
Buggy source:
@Test public void strongRefCursorTest2(){
  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);
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  Document doc=xmlPlatform.createDocument();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(MIKE_NAMES_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}

Fixed version (ground truth):
@Test public void strongRefCursorTest2(){
  XMLUnmarshaller unmarshaller=xrService.getXMLContext().createUnmarshaller();
  Object inputTab=unmarshaller.unmarshal(new StringReader(TABLE_XML));
  Invocation invocation=new Invocation("String_Node_Str");
  invocation.setParameter("String_Node_Str",inputTab);
  Operation op=xrService.getOperation(invocation.getName());
  Object result=op.invoke(xrService,invocation);
  assertNotNull("String_Node_Str",result);
  XMLMarshaller marshaller=xrService.getXMLContext().createMarshaller();
  Document doc=xmlPlatform.createDocument();
  marshaller.marshal(result,doc);
  Document controlDoc=xmlParser.parse(new StringReader(MIKE_NAMES_XML));
  assertTrue("String_Node_Str" + documentToString(controlDoc) + "String_Node_Str"+ documentToString(doc),comparer.isNodeEqual(controlDoc,doc));
}
Program: 65164
Project: 65164
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");
  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");
  return descriptor;
}
Program: 65165
Project: 65165
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);
    }
 else     if (complexType.isRecord()) {
      return new PLSQLRecordWrapper(databaseType);
    }
 else     if (complexType.isCollection()) {
      return new PLSQLCollectionWrapper(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 {
    return new SimplePLSQLTypeWrapper(databaseType);
  }
  return null;
}
Program: 65169
Project: 65169
Buggy source:
/** 
 * Allows the parser validation level to be set.
 * @param level The validation levels are defined in {@link ParserValidationType}
 */
public void setValidationLevel(String validationLevel){
  this.validationLevel=validationLevel;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void setValidationLevel(String validationLevel){
  this.validationLevel=validationLevel;
}
Program: 65170
Project: 65170
Buggy source:
private void addAttribute(String generateName,Expression queryExpression,Class<?> type){
  if (resultVariable != null) {
    generateName=resultVariable;
    queryContext.addQueryExpression(resultVariable,queryExpression);
  }
  query.addAttribute(generateName,queryExpression,type);
}

Fixed version (ground truth):
private void addAttribute(String generateName,Expression queryExpression,Class<?> type){
  if (resultVariable != null) {
    generateName=resultVariable;
    queryContext.addQueryExpression(resultVariable.toUpperCase(),queryExpression);
  }
  query.addAttribute(generateName,queryExpression,type);
}
Program: 65172
Project: 65172
Buggy source:
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlBinaryDataCollectionMapping.isReadOnly()) {
    return false;
  }
  Object collection=xmlBinaryDataCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    AbstractNullPolicy wrapperNP=xmlBinaryDataCollectionMapping.getWrapperNullPolicy();
    if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
      marshalRecord.nilSimple(namespaceResolver);
      return true;
    }
 else {
      return false;
    }
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(collection);
  if (!cp.hasNext(iterator)) {
    if (xmlBinaryDataCollectionMapping.getWrapperNullPolicy() != null) {
      XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
      marshalRecord.closeStartGroupingElements(groupingFragment);
    }
 else {
      return false;
    }
  }
  marshalRecord.startCollection();
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  marshalRecord.endCollection();
  return true;
}

Fixed version (ground truth):
public boolean marshal(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,AbstractSession session,NamespaceResolver namespaceResolver){
  if (xmlBinaryDataCollectionMapping.isReadOnly()) {
    return false;
  }
  Object collection=xmlBinaryDataCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);
  if (null == collection) {
    AbstractNullPolicy wrapperNP=xmlBinaryDataCollectionMapping.getWrapperNullPolicy();
    if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {
      marshalRecord.nilSimple(namespaceResolver);
      return true;
    }
 else {
      return false;
    }
  }
  ContainerPolicy cp=getContainerPolicy();
  Object iterator=cp.iteratorFor(collection);
  if (!cp.hasNext(iterator)) {
    if (xmlBinaryDataCollectionMapping.getWrapperNullPolicy() != null) {
      XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
      marshalRecord.closeStartGroupingElements(groupingFragment);
      return true;
    }
 else {
      return false;
    }
  }
  XPathFragment groupingFragment=marshalRecord.openStartGroupingElements(namespaceResolver);
  marshalRecord.closeStartGroupingElements(groupingFragment);
  marshalRecord.startCollection();
  while (cp.hasNext(iterator)) {
    Object objectValue=cp.next(iterator,session);
    marshalSingleValue(xPathFragment,marshalRecord,object,objectValue,session,namespaceResolver,ObjectMarshalContext.getInstance());
  }
  marshalRecord.endCollection();
  return true;
}
Program: 65173
Project: 65173
Buggy source:
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  value=getConvertedValue(value,marshalRecord,session);
  Object fieldValue=value;
  if (value instanceof XMLRoot) {
    fieldValue=((XMLRoot)value).getObject();
  }
 else   if (value.getClass() == ClassConstants.STRING && this.xmlChoiceCollectionMapping.isMixedContent()) {
    marshalMixedContent(marshalRecord,(String)value);
    return true;
  }
  NodeValue associatedNodeValue=getNodeValueForValue(value);
  if (associatedNodeValue != null) {
    XPathFragment frag=associatedNodeValue.getXPathNode().getXPathFragment();
    if (frag != null) {
      frag=getOwningFragment(associatedNodeValue,frag);
      NodeValue unwrappedNodeValue=((XMLChoiceCollectionMappingUnmarshalNodeValue)associatedNodeValue).getChoiceElementMarshalNodeValue();
      unwrappedNodeValue.marshalSingleValue(frag,marshalRecord,object,fieldValue,session,namespaceResolver,marshalContext);
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  value=getConvertedValue(value,marshalRecord,session);
  if (value.getClass() == ClassConstants.STRING && this.xmlChoiceCollectionMapping.isMixedContent()) {
    marshalMixedContent(marshalRecord,(String)value);
    return true;
  }
  NodeValue associatedNodeValue=getNodeValueForValue(value);
  if (associatedNodeValue != null) {
    XPathFragment frag=associatedNodeValue.getXPathNode().getXPathFragment();
    if (frag != null) {
      frag=getOwningFragment(associatedNodeValue,frag);
      NodeValue unwrappedNodeValue=((XMLChoiceCollectionMappingUnmarshalNodeValue)associatedNodeValue).getChoiceElementMarshalNodeValue();
      return marshalSingleValueWithNodeValue(frag,marshalRecord,object,value,session,namespaceResolver,marshalContext,unwrappedNodeValue);
    }
  }
  return true;
}
Program: 65175
Project: 65175
Buggy source:
protected void setupHandlerForKeepAsElementPolicy(UnmarshalRecord unmarshalRecord,XPathFragment xPathFragment,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + XMLConstants.COLON + qName;
    }
    if (!(unmarshalRecord.getPrefixesForFragment().isEmpty())) {
      for (      Entry<String,String> next : unmarshalRecord.getPrefixesForFragment().entrySet()) {
        builder.startPrefixMapping(next.getKey(),next.getValue());
      }
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    XMLReader xmlReader=unmarshalRecord.getXMLReader();
    xmlReader.setContentHandler(builder);
    xmlReader.setLexicalHandler(null);
  }
 catch (  SAXException ex) {
  }
}

Fixed version (ground truth):
protected void setupHandlerForKeepAsElementPolicy(UnmarshalRecord unmarshalRecord,XPathFragment xPathFragment,Attributes atts){
  SAXFragmentBuilder builder=unmarshalRecord.getFragmentBuilder();
  builder.setOwningRecord(unmarshalRecord);
  try {
    String namespaceURI=XMLConstants.EMPTY_STRING;
    if (xPathFragment.getNamespaceURI() != null) {
      namespaceURI=xPathFragment.getNamespaceURI();
    }
    String qName=xPathFragment.getLocalName();
    if (xPathFragment.getPrefix() != null) {
      qName=xPathFragment.getPrefix() + unmarshalRecord.getNamespaceSeparator() + qName;
    }
    if (!(unmarshalRecord.getPrefixesForFragment().isEmpty())) {
      for (      Entry<String,String> next : unmarshalRecord.getPrefixesForFragment().entrySet()) {
        builder.startPrefixMapping(next.getKey(),next.getValue());
      }
    }
    builder.startElement(namespaceURI,xPathFragment.getLocalName(),qName,atts);
    XMLReader xmlReader=unmarshalRecord.getXMLReader();
    xmlReader.setContentHandler(builder);
    xmlReader.setLexicalHandler(null);
  }
 catch (  SAXException ex) {
  }
}
Program: 65178
Project: 65178
Buggy source:
/** 
 * INTERNAL:
 */
public void nilComplex(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  XPathFragment groupingFragment=openStartGroupingElements(namespaceResolver);
  closeStartGroupingElements(groupingFragment);
  openStartElement(xPathFragment,namespaceResolver,false);
  nonStringCharacters(NULL);
  endElement(xPathFragment,namespaceResolver,false);
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void nilComplex(XPathFragment xPathFragment,NamespaceResolver namespaceResolver){
  XPathFragment groupingFragment=openStartGroupingElements(namespaceResolver);
  closeStartGroupingElements(groupingFragment);
  openStartElement(xPathFragment,namespaceResolver);
  nonStringCharacters(NULL);
  endElement(xPathFragment,namespaceResolver);
}
Program: 65179
Project: 65179
Buggy source:
/** 
 * INTERNAL:
 */
public void setMarshaller(XMLMarshaller marshaller){
  super.setMarshaller(marshaller);
  attributePrefix=marshaller.getAttributePrefix();
  encoder=Charset.forName(marshaller.getEncoding()).newEncoder();
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
public void setMarshaller(XMLMarshaller marshaller){
  super.setMarshaller(marshaller);
  attributePrefix=marshaller.getAttributePrefix();
  encoder=Charset.forName(marshaller.getEncoding()).newEncoder();
  if (marshaller.getValueWrapper() != null) {
    textWrapperFragment=new XPathFragment(marshaller.getValueWrapper());
  }
}
Program: 65186
Project: 65186
Buggy source:
public JSONFormattedWriterRecord(){
  numberOfTabs=1;
  complexType=true;
  isLastEventText=false;
  space="String_Node_Str";
}

Fixed version (ground truth):
public JSONFormattedWriterRecord(){
  numberOfTabs=0;
  complexType=true;
  isLastEventText=false;
  space="String_Node_Str";
}
Program: 65187
Project: 65187
Buggy source:
/** 
 * INTERNAL:
 */
@Override public void endDocument(){
  try {
    if (levels.size() != 1) {
      writer.write(Helper.cr());
    }
    super.endDocument();
    if (levels.isEmpty()) {
      writer.write(Helper.cr());
    }
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 */
@Override public void endDocument(){
  numberOfTabs--;
  super.endDocument();
}
Program: 65188
Project: 65188
Buggy source:
@Override public void endCollection(){
  try {
    writer.write(' ');
    super.endCollection();
    if (levels.size() == 1) {
      writer.write(Helper.cr());
    }
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}

Fixed version (ground truth):
@Override public void endCollection(){
  try {
    writer.write(' ');
    super.endCollection();
  }
 catch (  IOException e) {
    throw XMLMarshalException.marshalException(e);
  }
}
Program: 65191
Project: 65191
Buggy source:
private boolean isTextValue(String localName){
  XPathNode currentNode=((UnmarshalRecord)contentHandler).getXPathNode();
  return ((currentNode.getNonAttributeChildrenMap() == null || currentNode.getNonAttributeChildrenMap().size() == 0 || (currentNode.getNonAttributeChildrenMap().size() == 1 && currentNode.getTextNode() != null)) && textWrapper != null && textWrapper.equals(localName));
}

Fixed version (ground truth):
private boolean isTextValue(String localName){
  XPathNode currentNode=((UnmarshalRecord)contentHandler).getXPathNode();
  if (currentNode == null) {
    return textWrapper != null && textWrapper.equals(localName);
  }
  return ((currentNode.getNonAttributeChildrenMap() == null || currentNode.getNonAttributeChildrenMap().size() == 0 || (currentNode.getNonAttributeChildrenMap().size() == 1 && currentNode.getTextNode() != null)) && textWrapper != null && textWrapper.equals(localName));
}