nus-yam/ex-repair huggingface dataset:
Program: 65236
Project: 65236
Buggy source:
public void testRoundTrip() throws Exception {
  if (isUnmarshalTest()) {
    InputStream instream=null;
    if (writeControlDocumentLocation != null) {
      instream=ClassLoader.getSystemResourceAsStream(writeControlDocumentLocation);
    }
 else {
      instream=ClassLoader.getSystemResourceAsStream(resourceName);
    }
    jaxbUnmarshaller.setProperty(org.eclipse.persistence.jaxb.JAXBContext.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=jaxbUnmarshaller.unmarshal(new StreamSource(instream),getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(instream);
    }
    instream.close();
    xmlToObjectTest(testObject);
    objectToXMLStringWriter(testObject);
  }
}

Fixed version (ground truth):
public void testRoundTrip() throws Exception {
  if (isUnmarshalTest()) {
    InputStream instream=null;
    if (writeControlDocumentLocation != null) {
      instream=ClassLoader.getSystemResourceAsStream(writeControlDocumentLocation);
    }
 else {
      instream=ClassLoader.getSystemResourceAsStream(resourceName);
    }
    jaxbUnmarshaller.setProperty(MarshallerProperties.MEDIA_TYPE,"String_Node_Str");
    Object testObject=null;
    if (getUnmarshalClass() != null) {
      testObject=jaxbUnmarshaller.unmarshal(new StreamSource(instream),getUnmarshalClass());
    }
 else {
      testObject=jaxbUnmarshaller.unmarshal(instream);
    }
    instream.close();
    xmlToObjectTest(testObject);
    objectToXMLStringWriter(testObject);
  }
}
Program: 65237
Project: 65237
Buggy source:
private JSONReader(String attrPrefix,NamespaceResolver nr,boolean namespaceAware,boolean includeRoot,char namespaceSeparator,ErrorHandler errorHandler,String textWrapper,Class unmarshalClass){
  this.attributePrefix=attrPrefix;
  if (attributePrefix == XMLConstants.EMPTY_STRING) {
    attributePrefix=null;
  }
  namespaces=nr;
  this.namespaceAware=namespaceAware;
  this.namespaceSeparator=namespaceSeparator;
  this.includeRoot=includeRoot;
  this.setErrorHandler(errorHandler);
  this.textWrapper=textWrapper;
  this.unmarshalClass=unmarshalClass;
}

Fixed version (ground truth):
public JSONReader(String attrPrefix,NamespaceResolver nr,boolean namespaceAware,boolean includeRoot,Character namespaceSeparator,ErrorHandler errorHandler,String textWrapper,Class unmarshalClass){
  this.attributePrefix=attrPrefix;
  if (attributePrefix == XMLConstants.EMPTY_STRING) {
    attributePrefix=null;
  }
  namespaces=nr;
  this.namespaceAware=namespaceAware;
  if (namespaceSeparator == null) {
    this.namespaceSeparator=XMLConstants.DOT;
  }
 else {
    this.namespaceSeparator=namespaceSeparator;
  }
  this.includeRoot=includeRoot;
  this.setErrorHandler(errorHandler);
  this.textWrapper=textWrapper;
  this.unmarshalClass=unmarshalClass;
}
Program: 65238
Project: 65238
Buggy source:
public JSONWriterRecord(){
  super();
  space=XMLConstants.EMPTY_STRING;
  namespaceSeparator=XMLConstants.DOT;
}

Fixed version (ground truth):
public JSONWriterRecord(){
  super();
  space=XMLConstants.EMPTY_STRING;
}
Program: 65239
Project: 65239
Buggy source:
public void setXMLReader(XMLReader xmlReader){
  this.xmlReader=xmlReader;
  namespaceAware=xmlReader.isNamespaceAware();
  namespaceSeparator=xmlReader.getNamespaceSeparator();
  if (xPathFragment != null) {
    xPathFragment.setNamespaceAware(isNamespaceAware());
  }
}

Fixed version (ground truth):
public void setXMLReader(XMLReader xmlReader){
  this.xmlReader=xmlReader;
  namespaceAware=xmlReader.isNamespaceAware();
  if (xPathFragment != null) {
    xPathFragment.setNamespaceAware(isNamespaceAware());
  }
}
Program: 65240
Project: 65240
Buggy source:
public XMLRecord(){
  super(null,null);
  namespaceResolver=new NamespaceResolver();
  namespaceSeparator=XMLConstants.COLON;
  namespaceAware=true;
}

Fixed version (ground truth):
public XMLRecord(){
  super(null,null);
  namespaceResolver=new NamespaceResolver();
  namespaceAware=true;
}
Program: 65241
Project: 65241
Buggy source:
/** 
 * INTERNAL: The character used to separate the prefix and uri portions when namespaces are present 
 * @since 2.4
 */
public char getNamespaceSeparator(){
  return namespaceSeparator;
}

Fixed version (ground truth):
/** 
 * INTERNAL: The character used to separate the prefix and uri portions when namespaces are present 
 * @since 2.4
 */
public char getNamespaceSeparator(){
  return XMLConstants.COLON;
}
Program: 65242
Project: 65242
Buggy source:
/** 
 * Creates a new EclipseLink   {@link Expression} by visiting the given JPQL {@link StateFieldPathExpression}. This method temporarily changes the null allowed flag if the state field is a foreign reference mapping
 * @param expression The {@link StateFieldPathExpression} to convert into an EclipseLink {@link Expression}
 * @return The EclipseLink {@link Expression} representation of that path expression
 */
Expression buildModifiedPathExpression(StateFieldPathExpression expression){
  PathResolver resolver=pathResolver();
  try {
    resolver.length=expression.pathSize();
    resolver.nullAllowed=false;
    resolver.localExpression=null;
    resolver.checkMappingType=true;
    expression.accept(resolver);
    return resolver.localExpression;
  }
  finally {
    resolver.length=-1;
    resolver.nullAllowed=false;
    resolver.checkMappingType=false;
    resolver.localExpression=null;
    resolver.descriptor=null;
    this.type[0]=null;
    this.typeExpression=false;
    this.queryExpression=null;
  }
}

Fixed version (ground truth):
/** 
 * Creates a new EclipseLink   {@link Expression} by visiting the given JPQL {@link StateFieldPathExpression}. This method temporarily changes the null allowed flag if the state field is a foreign reference mapping
 * @param expression The {@link StateFieldPathExpression} to convert into an EclipseLink {@link Expression}
 * @return The EclipseLink {@link Expression} representation of that path expression
 */
Expression buildModifiedPathExpression(StateFieldPathExpression expression){
  try {
    PathResolver resolver=new PathResolver();
    resolver.length=expression.pathSize();
    resolver.checkMappingType=true;
    expression.accept(resolver);
    return resolver.localExpression;
  }
  finally {
    this.type[0]=null;
    this.typeExpression=false;
    this.queryExpression=null;
  }
}
Program: 65243
Project: 65243
Buggy source:
private void visitInExpression(InExpression expression,Expression stateFieldPathExpression){
  InExpressionBuilder visitor=inExpressionBuilder();
  try {
    visitor.hasNot=expression.hasNot();
    visitor.singleInputParameter=expression.isSingleInputParameter();
    visitor.stateFieldPathExpression=stateFieldPathExpression;
    expression.getInItems().accept(visitor);
  }
  finally {
    visitor.hasNot=false;
    visitor.singleInputParameter=false;
    visitor.stateFieldPathExpression=null;
  }
}

Fixed version (ground truth):
private void visitInExpression(InExpression expression,Expression leftExpression){
  InExpressionBuilder visitor=new InExpressionBuilder();
  visitor.hasNot=expression.hasNot();
  visitor.singleInputParameter=expression.isSingleInputParameter();
  visitor.leftExpression=leftExpression;
  expression.getInItems().accept(visitor);
}
Program: 65244
Project: 65244
Buggy source:
/** 
 * Creates a new EclipseLink   {@link Expression} by visiting the given JPQL {@link CollectionValuedPathExpression} that is used in the <code><b>GROUP BY</b></code> clause.
 * @param expression The {@link CollectionValuedPathExpression} to convert into an EclipseLink{@link Expression}
 * @return The EclipseLink {@link Expression} representation of that path expression
 */
Expression buildGroupByExpression(CollectionValuedPathExpression expression){
  PathResolver resolver=pathResolver();
  try {
    resolver.length=expression.pathSize() - 1;
    resolver.nullAllowed=false;
    resolver.localExpression=null;
    resolver.checkMappingType=false;
    expression.accept(resolver);
    return resolver.localExpression;
  }
  finally {
    resolver.length=-1;
    resolver.descriptor=null;
    resolver.nullAllowed=false;
    resolver.checkMappingType=false;
    resolver.localExpression=null;
    this.type[0]=null;
    this.typeExpression=false;
    this.queryExpression=null;
  }
}

Fixed version (ground truth):
/** 
 * Creates a new EclipseLink   {@link Expression} by visiting the given JPQL {@link CollectionValuedPathExpression} that is used in the <code><b>GROUP BY</b></code> clause.
 * @param expression The {@link CollectionValuedPathExpression} to convert into an EclipseLink{@link Expression}
 * @return The EclipseLink {@link Expression} representation of that path expression
 */
Expression buildGroupByExpression(CollectionValuedPathExpression expression){
  try {
    PathResolver resolver=new PathResolver();
    resolver.length=expression.pathSize() - 1;
    resolver.nullAllowed=false;
    resolver.checkMappingType=false;
    expression.accept(resolver);
    return resolver.localExpression;
  }
  finally {
    this.type[0]=null;
    this.typeExpression=false;
    this.queryExpression=null;
  }
}
Program: 65246
Project: 65246
Buggy source:
public void testValidateNoSchemaReference() throws JAXBException {
  Class[] classes={Address.class};
  JAXBContext jc=JAXBContextFactory.createContext(classes,null);
  Validator validator=jc.createValidator();
  assertTrue(validator.validate(new Address()));
}

Fixed version (ground truth):
public void testValidateNoSchemaReference() throws JAXBException {
  try {
    Class[] classes={Address.class};
    JAXBContext jc=JAXBContextFactory.createContext(classes,null);
    Validator validator=jc.createValidator();
    validator.validate(new Address());
  }
 catch (  ValidationException e) {
    XMLMarshalException xme=(XMLMarshalException)e.getLinkedException();
    XMLPlatformException xpe=(XMLPlatformException)xme.getInternalException();
    XMLMarshalException xme2=(XMLMarshalException)xpe.getInternalException();
    assertEquals(XMLMarshalException.ERROR_RESOLVING_XML_SCHEMA,xme2.getErrorCode());
    return;
  }
}
Program: 65248
Project: 65248
Buggy source:
public Object unmarshal(XMLReader xmlReader,InputSource inputSource,Class clazz){
  try {
    SAXDocumentBuilder saxDocumentBuilder=new SAXDocumentBuilder();
    xmlReader.setContentHandler(saxDocumentBuilder);
    xmlReader.parse(inputSource);
    return xmlToObject(new DOMRecord(saxDocumentBuilder.getDocument()),clazz);
  }
 catch (  IOException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
 finally {
    xmlUnmarshaller.getStringBuffer().reset();
  }
}

Fixed version (ground truth):
public Object unmarshal(XMLReader xmlReader,InputSource inputSource,Class clazz){
  if (xmlUnmarshaller.getMediaType() != MediaType.APPLICATION_XML) {
    throw XMLMarshalException.unsupportedMediaTypeForPlatform();
  }
  try {
    SAXDocumentBuilder saxDocumentBuilder=new SAXDocumentBuilder();
    xmlReader.setContentHandler(saxDocumentBuilder);
    xmlReader.parse(inputSource);
    return xmlToObject(new DOMRecord(saxDocumentBuilder.getDocument()),clazz);
  }
 catch (  IOException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
catch (  SAXException e) {
    throw XMLMarshalException.unmarshalException(e);
  }
 finally {
    xmlUnmarshaller.getStringBuffer().reset();
  }
}
Program: 65249
Project: 65249
Buggy source:
private XMLReader getXMLReader(){
  if (null == xmlReader) {
    try {
      xmlReader=new XMLReader(getSAXParser().getXMLReader());
      if (null != errorHandler) {
        xmlReader.setErrorHandler(errorHandler);
      }
      if (null != entityResolver) {
        xmlReader.setEntityResolver(entityResolver);
      }
      setValidationMode(getValidationMode());
      if (null != getSchema()) {
        xmlReader.setFeature(VALIDATING,xmlReader.getFeature(VALIDATING));
      }
      return xmlReader;
    }
 catch (    Exception e) {
      throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
    }
  }
  return xmlReader;
}

Fixed version (ground truth):
private XMLReader getXMLReader(Class clazz){
  if (null == xmlReader) {
    if (xmlUnmarshaller.getMediaType() == MediaType.APPLICATION_JSON) {
      return new JSONReader(xmlUnmarshaller.getAttributePrefix(),xmlUnmarshaller.getNamespaceResolver(),xmlUnmarshaller.getNamespaceResolver() != null,xmlUnmarshaller.isIncludeRoot(),xmlUnmarshaller.getNamespaceSeparator(),xmlUnmarshaller.getErrorHandler(),xmlUnmarshaller.getValueWrapper(),clazz);
    }
    try {
      xmlReader=new XMLReader(getSAXParser().getXMLReader());
      if (null != errorHandler) {
        xmlReader.setErrorHandler(errorHandler);
      }
      if (null != entityResolver) {
        xmlReader.setEntityResolver(entityResolver);
      }
      setValidationMode(getValidationMode());
      if (null != getSchema()) {
        xmlReader.setFeature(VALIDATING,xmlReader.getFeature(VALIDATING));
      }
      return xmlReader;
    }
 catch (    Exception e) {
      throw XMLMarshalException.errorInstantiatingSchemaPlatform(e);
    }
  }
  return xmlReader;
}
Program: 65251
Project: 65251
Buggy source:
private JSONReader(String attrPrefix,NamespaceResolver nr,boolean namespaceAware,boolean includeRoot,char namespaceSeparator,ErrorHandler errorHandler,String textWrapper){
  this.attributePrefix=attrPrefix;
  if (attributePrefix == XMLConstants.EMPTY_STRING) {
    attributePrefix=null;
  }
  namespaces=nr;
  this.namespaceAware=namespaceAware;
  this.namespaceSeparator=namespaceSeparator;
  this.includeRoot=includeRoot;
  this.setErrorHandler(errorHandler);
  this.textWrapper=textWrapper;
}

Fixed version (ground truth):
private JSONReader(String attrPrefix,NamespaceResolver nr,boolean namespaceAware,boolean includeRoot,char namespaceSeparator,ErrorHandler errorHandler,String textWrapper,Class unmarshalClass){
  this.attributePrefix=attrPrefix;
  if (attributePrefix == XMLConstants.EMPTY_STRING) {
    attributePrefix=null;
  }
  namespaces=nr;
  this.namespaceAware=namespaceAware;
  this.namespaceSeparator=namespaceSeparator;
  this.includeRoot=includeRoot;
  this.setErrorHandler(errorHandler);
  this.textWrapper=textWrapper;
  this.unmarshalClass=unmarshalClass;
}
Program: 65252
Project: 65252
Buggy source:
public java.lang.Boolean isMyBooleanWrapperTest(){
  return new Boolean(getBoolean(START_PROPERTY_INDEX + 51));
}

Fixed version (ground truth):
public java.lang.Boolean isMyBooleanWrapperTest(){
  return getBoolean(START_PROPERTY_INDEX + 50);
}
Program: 65253
Project: 65253
Buggy source:
public java.lang.Long getMyLongWrapperTest(){
  return getLong(START_PROPERTY_INDEX + 50);
}

Fixed version (ground truth):
public java.lang.Long getMyLongWrapperTest(){
  return getLong(START_PROPERTY_INDEX + 56);
}
Program: 65254
Project: 65254
Buggy source:
public void setMyLongWrapperTest(java.lang.Long value){
  set(START_PROPERTY_INDEX + 50,value);
}

Fixed version (ground truth):
public void setMyLongWrapperTest(java.lang.Long value){
  set(START_PROPERTY_INDEX + 56,value);
}
Program: 65255
Project: 65255
Buggy source:
public void setMyBooleanWrapperTest(java.lang.Boolean value){
  set(START_PROPERTY_INDEX + 51,value);
}

Fixed version (ground truth):
public void setMyBooleanWrapperTest(java.lang.Boolean value){
  set(START_PROPERTY_INDEX + 50,value);
}
Program: 65256
Project: 65256
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  suite.addTest(new JUnitJPQLModifyTestSuite("String_Node_Str"));
  return suite;
}
Program: 65258
Project: 65258
Buggy source:
@POST @Consumes(MediaType.APPLICATION_XML) public void create(Address address){
  entityManager.persist(address);
}

Fixed version (ground truth):
@POST @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public void create(Address address){
  entityManager.persist(address);
}
Program: 65259
Project: 65259
Buggy source:
@PUT @Consumes(MediaType.APPLICATION_XML) public void update(Address address){
  entityManager.merge(address);
}

Fixed version (ground truth):
@PUT @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public void update(Address address){
  entityManager.merge(address);
}
Program: 65260
Project: 65260
Buggy source:
@SuppressWarnings("String_Node_Str") @GET @Produces(MediaType.APPLICATION_XML) @Path("String_Node_Str") public List<Customer> findCustomerByCity(@PathParam("String_Node_Str") String city){
  Query query=entityManager.createNamedQuery("String_Node_Str");
  query.setParameter("String_Node_Str",city);
  return query.getResultList();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @GET @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Path("String_Node_Str") public List<Customer> findCustomerByCity(@PathParam("String_Node_Str") String city){
  Query query=entityManager.createNamedQuery("String_Node_Str");
  query.setParameter("String_Node_Str",city);
  return query.getResultList();
}
Program: 65261
Project: 65261
Buggy source:
@POST @Consumes(MediaType.APPLICATION_XML) public void create(Customer customer){
  entityManager.persist(customer);
}

Fixed version (ground truth):
@POST @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public void create(Customer customer){
  entityManager.persist(customer);
}
Program: 65262
Project: 65262
Buggy source:
@PUT @Consumes(MediaType.APPLICATION_XML) public void update(Customer customer){
  entityManager.merge(customer);
}

Fixed version (ground truth):
@PUT @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public void update(Customer customer){
  entityManager.merge(customer);
}
Program: 65264
Project: 65264
Buggy source:
@AfterClass public static void tearDown(){
  String ddlDrop=System.getProperty(DATABASE_DDL_DROP_KEY,DEFAULT_DATABASE_DDL_DROP);
  if ("String_Node_Str".equalsIgnoreCase(ddlDrop)) {
    runDdl(conn,DROP_ROWTYPE_TEST_PACKAGE,ddlDebug);
    runDdl(conn,DROP_ROWTYPE_SHADOWTYPE,ddlDebug);
    runDdl(conn,DROP_ROWTYPE_TEST_TABLE,ddlDebug);
  }
}

Fixed version (ground truth):
@AfterClass public static void tearDown(){
  String ddlDrop=System.getProperty(DATABASE_DDL_DROP_KEY,DEFAULT_DATABASE_DDL_DROP);
  if ("String_Node_Str".equalsIgnoreCase(ddlDrop)) {
    runDdl(conn,DROP_ROWTYPE_TEST_PACKAGE,ddlDebug);
    runDdl(conn,DROP_ROWTYPE_TEST_TABLE,ddlDebug);
  }
  for (  String ddl : builder.getTypeDropDDL()) {
    runDdl(conn,ddl,ddlDebug);
  }
}
Program: 65265
Project: 65265
Buggy source:
protected void updateNamespaces(QName qname,MarshalRecord marshalRecord,XMLField xmlField){
  if (qname != null) {
    if (xmlField != null) {
      if (xmlField.isTypedTextField()) {
        if (xmlField.getSchemaType() == null) {
          if (qname.equals(XMLConstants.STRING_QNAME)) {
            return;
          }
        }
 else {
          if (xmlField.isSchemaType(qname)) {
            return;
          }
        }
      }
 else {
        return;
      }
    }
    String prefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(qname.getNamespaceURI());
    if ((prefix == null) || prefix.length() == 0) {
      if (XMLConstants.SCHEMA_URL.equals(qname.getNamespaceURI())) {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix(XMLConstants.SCHEMA_PREFIX);
      }
 else {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix();
      }
      marshalRecord.namespaceDeclaration(prefix,qname.getNamespaceURI());
    }
    String typeValue=prefix + XMLConstants.COLON + qname.getLocalPart();
    addTypeAttribute(marshalRecord,typeValue);
  }
}

Fixed version (ground truth):
protected void updateNamespaces(QName qname,MarshalRecord marshalRecord,XMLField xmlField){
  if (qname != null) {
    if (xmlField != null) {
      if (xmlField.isTypedTextField()) {
        if (xmlField.getSchemaType() == null) {
          if (qname.equals(XMLConstants.STRING_QNAME)) {
            return;
          }
        }
 else {
          if (xmlField.isSchemaType(qname)) {
            return;
          }
        }
      }
 else {
        return;
      }
    }
    String prefix=marshalRecord.getNamespaceResolver().resolveNamespaceURI(qname.getNamespaceURI());
    if ((prefix == null) || prefix.length() == 0) {
      if (XMLConstants.SCHEMA_URL.equals(qname.getNamespaceURI())) {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix(XMLConstants.SCHEMA_PREFIX);
      }
 else {
        prefix=marshalRecord.getNamespaceResolver().generatePrefix();
      }
      marshalRecord.namespaceDeclaration(prefix,qname.getNamespaceURI());
    }
    String typeValue=null;
    if (marshalRecord.isNamespaceAware()) {
      typeValue=prefix + marshalRecord.getNamespaceSeparator() + qname.getLocalPart();
    }
 else {
      typeValue=qname.getLocalPart();
    }
    addTypeAttribute(marshalRecord,typeValue);
  }
}
Program: 65272
Project: 65272
Buggy source:
private JSONReader(String attrPrefix,NamespaceResolver nr,boolean namespaceAware,boolean includeRoot,char namespaceSeparator,ErrorHandler errorHandler){
  this.attributePrefix=attrPrefix;
  if (attributePrefix == XMLConstants.EMPTY_STRING) {
    attributePrefix=null;
  }
  namespaces=nr;
  this.namespaceAware=namespaceAware;
  this.namespaceSeparator=namespaceSeparator;
  this.includeRoot=includeRoot;
  this.setErrorHandler(errorHandler);
}

Fixed version (ground truth):
private JSONReader(String attrPrefix,NamespaceResolver nr,boolean namespaceAware,boolean includeRoot,char namespaceSeparator,ErrorHandler errorHandler,String textWrapper){
  this.attributePrefix=attrPrefix;
  if (attributePrefix == XMLConstants.EMPTY_STRING) {
    attributePrefix=null;
  }
  namespaces=nr;
  this.namespaceAware=namespaceAware;
  this.namespaceSeparator=namespaceSeparator;
  this.includeRoot=includeRoot;
  this.setErrorHandler(errorHandler);
  this.textWrapper=textWrapper;
}
Program: 65275
Project: 65275
Buggy source:
public void testImageStarSpecified_ConentTypeImageGif() throws JAXBException {
  RootImageStar root=new RootImageStar();
  root.setMimeType(IMAGE_GIF);
  root.setImage(IMAGE);
  try {
    marshaller.marshal(root,new StringWriter());
  }
 catch (  MarshalException ex) {
    if (!(((XMLMarshalException)ex.getLinkedException()).getErrorCode() == XMLMarshalException.NO_ENCODER_FOR_MIME_TYPE)) {
      throw ex;
    }
 else {
      return;
    }
  }
  assertEquals(IMAGE_GIF,attachmentMarshaller.getMimeType());
}

Fixed version (ground truth):
public void testImageStarSpecified_ConentTypeImageGif() throws JAXBException {
  RootImageStar root=new RootImageStar();
  root.setMimeType(IMAGE_GIF);
  root.setImage(IMAGE);
  try {
    marshaller.marshal(root,new StringWriter());
  }
 catch (  MarshalException ex) {
    ConversionException ce=(ConversionException)ex.getLinkedException();
    XMLMarshalException me=(XMLMarshalException)ce.getInternalException();
    if (me.getErrorCode() != XMLMarshalException.NO_ENCODER_FOR_MIME_TYPE) {
      throw ex;
    }
 else {
      return;
    }
  }
  assertEquals(IMAGE_GIF,attachmentMarshaller.getMimeType());
}
Program: 65276
Project: 65276
Buggy source:
public void testNoMimeTypeSpecied_ContentTypeImageGif() throws JAXBException {
  Root root=new Root();
  root.setMimeType(IMAGE_GIF);
  root.setImage(IMAGE);
  try {
    marshaller.marshal(root,new StringWriter());
  }
 catch (  MarshalException ex) {
    if (!(((XMLMarshalException)ex.getLinkedException()).getErrorCode() == XMLMarshalException.NO_ENCODER_FOR_MIME_TYPE)) {
      throw ex;
    }
 else {
      return;
    }
  }
  assertEquals(IMAGE_GIF,attachmentMarshaller.getMimeType());
}

Fixed version (ground truth):
public void testNoMimeTypeSpecied_ContentTypeImageGif() throws JAXBException {
  Root root=new Root();
  root.setMimeType(IMAGE_GIF);
  root.setImage(IMAGE);
  try {
    marshaller.marshal(root,new StringWriter());
  }
 catch (  MarshalException ex) {
    ConversionException ce=(ConversionException)ex.getLinkedException();
    XMLMarshalException me=(XMLMarshalException)ce.getInternalException();
    if (me.getErrorCode() != XMLMarshalException.NO_ENCODER_FOR_MIME_TYPE) {
      throw ex;
    }
 else {
      return;
    }
  }
  assertEquals(IMAGE_GIF,attachmentMarshaller.getMimeType());
}
Program: 65277
Project: 65277
Buggy source:
public void testImageJpegSpecified_ConentTypeImageGif() throws JAXBException {
  RootImageJpeg root=new RootImageJpeg();
  root.setMimeType(IMAGE_GIF);
  root.setImage(IMAGE);
  try {
    marshaller.marshal(root,new StringWriter());
  }
 catch (  MarshalException ex) {
    if (!(((XMLMarshalException)ex.getLinkedException()).getErrorCode() == XMLMarshalException.NO_ENCODER_FOR_MIME_TYPE)) {
      throw ex;
    }
 else {
      return;
    }
  }
  assertEquals(IMAGE_GIF,attachmentMarshaller.getMimeType());
}

Fixed version (ground truth):
public void testImageJpegSpecified_ConentTypeImageGif() throws JAXBException {
  RootImageJpeg root=new RootImageJpeg();
  root.setMimeType(IMAGE_GIF);
  root.setImage(IMAGE);
  try {
    marshaller.marshal(root,new StringWriter());
  }
 catch (  MarshalException ex) {
    ConversionException ce=(ConversionException)ex.getLinkedException();
    XMLMarshalException me=(XMLMarshalException)ce.getInternalException();
    if (me.getErrorCode() != XMLMarshalException.NO_ENCODER_FOR_MIME_TYPE) {
      throw ex;
    }
 else {
      return;
    }
  }
  assertEquals(IMAGE_GIF,attachmentMarshaller.getMimeType());
}
Program: 65279
Project: 65279
Buggy source:
protected void writeXsiTypeAttribute(XMLDescriptor xmlDescriptor,XMLRecord row,String typeValue,boolean addToNamespaceResolver){
  XMLField xmlField=null;
  if (row.isNamespaceAware()) {
    String xsiPrefix=null;
    boolean generated=false;
    xsiPrefix=row.getNamespaceResolver().resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
    if (xsiPrefix == null) {
      xsiPrefix=xmlDescriptor.getNonNullNamespaceResolver().generatePrefix(XMLConstants.SCHEMA_INSTANCE_PREFIX);
      generated=true;
      writeNamespace(row,xsiPrefix,XMLConstants.SCHEMA_INSTANCE_URL,addToNamespaceResolver);
    }
    xmlField=(XMLField)xmlDescriptor.buildField(XMLConstants.ATTRIBUTE + xsiPrefix + XMLConstants.COLON+ XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
    if (generated) {
      xmlField.getLastXPathFragment().setGeneratedPrefix(true);
    }
  }
 else {
    xmlField=(XMLField)xmlDescriptor.buildField(XMLConstants.ATTRIBUTE + XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
  }
  xmlField.getLastXPathFragment().setNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
  row.add(xmlField,typeValue);
}

Fixed version (ground truth):
protected void writeXsiTypeAttribute(XMLRecord row,String typeValue,boolean addToNamespaceResolver){
  XMLField xmlField=null;
  if (row.isNamespaceAware()) {
    String xsiPrefix=null;
    boolean generated=false;
    xsiPrefix=row.getNamespaceResolver().resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
    if (xsiPrefix == null) {
      xsiPrefix=XMLConstants.SCHEMA_INSTANCE_PREFIX;
      generated=true;
      writeNamespace(row,xsiPrefix,XMLConstants.SCHEMA_INSTANCE_URL,addToNamespaceResolver);
    }
    xmlField=new XMLField(XMLConstants.ATTRIBUTE + xsiPrefix + XMLConstants.COLON+ XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
    if (generated) {
      xmlField.getLastXPathFragment().setGeneratedPrefix(true);
    }
  }
 else {
    xmlField=new XMLField(XMLConstants.ATTRIBUTE + XMLConstants.SCHEMA_TYPE_ATTRIBUTE);
  }
  xmlField.getLastXPathFragment().setNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL);
  row.add(xmlField,typeValue);
}
Program: 65280
Project: 65280
Buggy source:
/** 
 * Ensure that using unmarshal(XMLStreamReader, Class) works in a Dynamic context. Create a dummy Descriptor with a concrete Java class, add it to the session, and then try to unmarshal using that class.  An empty instance of that concrete class should be returned.
 */
public void testUnmarshalWithClass() throws Exception {
  ClassLoader classLoader=this.getClass().getClassLoader();
  InputStream iStream=classLoader.getResourceAsStream(OXM_METADATA);
  Map<String,Object> properties=new HashMap<String,Object>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,iStream);
  DynamicJAXBContext jc=DynamicJAXBContextFactory.createContextFromOXM(classLoader,properties);
  Unmarshaller unmarshaller=jc.createUnmarshaller();
  InputStream xmlStream=classLoader.getResourceAsStream(XML_RESOURCE_BEFORE);
  DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
  docFactory.setNamespaceAware(true);
  Document xsdDocument=docFactory.newDocumentBuilder().parse(xmlStream);
  Source domSource=new DOMSource(xsdDocument);
  XMLDescriptor dummy=new XMLDescriptor();
  dummy.setJavaClass(javax.swing.JLabel.class);
  jc.getXMLContext().getSession(0).addDescriptor(dummy);
  Object o=unmarshaller.unmarshal(domSource,javax.swing.JLabel.class);
  JAXBElement jelem=(JAXBElement)o;
  assertEquals(javax.swing.JLabel.class,jelem.getValue().getClass());
}

Fixed version (ground truth):
/** 
 * Ensure that using unmarshal(XMLStreamReader, Class) works in a Dynamic context. Create a dummy Descriptor with a concrete Java class, add it to the session, and then try to unmarshal using that class.  An empty instance of that concrete class should be returned.
 */
public void testUnmarshalWithClass() throws Exception {
  ClassLoader classLoader=this.getClass().getClassLoader();
  InputStream iStream=classLoader.getResourceAsStream(OXM_METADATA);
  Map<String,Object> properties=new HashMap<String,Object>();
  properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,iStream);
  DynamicJAXBContext jc=DynamicJAXBContextFactory.createContextFromOXM(classLoader,properties);
  Unmarshaller unmarshaller=jc.createUnmarshaller();
  InputStream xmlStream=classLoader.getResourceAsStream(XML_RESOURCE_BEFORE);
  DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
  docFactory.setNamespaceAware(true);
  Document xsdDocument=docFactory.newDocumentBuilder().parse(xmlStream);
  Source domSource=new DOMSource(xsdDocument);
  XMLDescriptor dummy=new XMLDescriptor();
  dummy.setJavaClass(org.eclipse.persistence.testing.jaxb.employee.Employee.class);
  jc.getXMLContext().getSession(0).addDescriptor(dummy);
  Object o=unmarshaller.unmarshal(domSource,org.eclipse.persistence.testing.jaxb.employee.Employee.class);
  JAXBElement jelem=(JAXBElement)o;
  assertEquals(org.eclipse.persistence.testing.jaxb.employee.Employee.class,jelem.getValue().getClass());
}
Program: 65281
Project: 65281
Buggy source:
public JSONFormattedWriterRecord(){
  numberOfTabs=1;
  complexType=true;
  isLastEventText=false;
}

Fixed version (ground truth):
public JSONFormattedWriterRecord(){
  numberOfTabs=1;
  complexType=true;
  isLastEventText=false;
  space="String_Node_Str";
}
Program: 65283
Project: 65283
Buggy source:
public JSONWriterRecord(){
  super();
  namespaceSeparator=XMLConstants.DOT;
}

Fixed version (ground truth):
public JSONWriterRecord(){
  super();
  space=XMLConstants.EMPTY_STRING;
  namespaceSeparator=XMLConstants.DOT;
}
Program: 65284
Project: 65284
Buggy source:
protected void writeKey(XPathFragment xPathFragment) throws IOException {
  super.openStartElement(xPathFragment,namespaceResolver);
  isStartElementOpen=true;
  writer.write('"');
  if (xPathFragment.isAttribute() && attributePrefix != null) {
    writer.write(attributePrefix);
  }
  if (isNamespaceAware()) {
    if (xPathFragment.getNamespaceURI() != null) {
      String prefix=null;
      if (getNamespaceResolver() != null) {
        prefix=getNamespaceResolver().resolveNamespaceURI(xPathFragment.getNamespaceURI());
      }
 else       if (namespaceResolver != null) {
        prefix=namespaceResolver.resolveNamespaceURI(xPathFragment.getNamespaceURI());
      }
      if (prefix != null && !prefix.equals(XMLConstants.EMPTY_STRING)) {
        writer.write(prefix);
        writer.write(getNamespaceSeparator());
      }
    }
  }
  writer.write(xPathFragment.getLocalName());
  writer.write("String_Node_Str");
}

Fixed version (ground truth):
protected void writeKey(XPathFragment xPathFragment) throws IOException {
  super.openStartElement(xPathFragment,namespaceResolver);
  isStartElementOpen=true;
  writer.write('"');
  if (xPathFragment.isAttribute() && attributePrefix != null) {
    writer.write(attributePrefix);
  }
  if (isNamespaceAware()) {
    if (xPathFragment.getNamespaceURI() != null) {
      String prefix=null;
      if (getNamespaceResolver() != null) {
        prefix=getNamespaceResolver().resolveNamespaceURI(xPathFragment.getNamespaceURI());
      }
 else       if (namespaceResolver != null) {
        prefix=namespaceResolver.resolveNamespaceURI(xPathFragment.getNamespaceURI());
      }
      if (prefix != null && !prefix.equals(XMLConstants.EMPTY_STRING)) {
        writer.write(prefix);
        writer.write(getNamespaceSeparator());
      }
    }
  }
  writer.write(xPathFragment.getLocalName());
  writer.write("String_Node_Str");
  writer.write(space);
  writer.write(XMLConstants.COLON);
  writer.write(space);
}
Program: 65285
Project: 65285
Buggy source:
public void setup(){
  getAbstractSession().beginTransaction();
  postalCode="String_Node_Str";
  UnitOfWork uow=getSession().acquireUnitOfWork();
  Address address=(Address)uow.registerObject(new Address());
  uow.assignSequenceNumber(address);
  address.setPostalCode(postalCode);
  address.setCity("String_Node_Str");
  address.setCountry("String_Node_Str");
  uow.commit();
  getAbstractSession().commitTransaction();
  originalAddress=address;
}

Fixed version (ground truth):
public void setup(){
  if (!isSequenceNumberEnabled()) {
    throw new TestWarningException("String_Node_Str");
  }
  getAbstractSession().beginTransaction();
  postalCode="String_Node_Str";
  UnitOfWork uow=getSession().acquireUnitOfWork();
  Address address=(Address)uow.registerObject(new Address());
  uow.assignSequenceNumber(address);
  address.setPostalCode(postalCode);
  address.setCity("String_Node_Str");
  address.setCountry("String_Node_Str");
  uow.commit();
  getAbstractSession().commitTransaction();
  originalAddress=address;
}
Program: 65286
Project: 65286
Buggy source:
public void reset(){
  UnitOfWork deleteUOW=getSession().acquireUnitOfWork();
  deleteUOW.deleteObject(deleteUOW.readObject(originalAddress));
  deleteUOW.deleteObject(deleteUOW.readObject(originalEmployee));
  deleteUOW.commit();
  getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
}

Fixed version (ground truth):
public void reset(){
  if (!isSequenceNumberEnabled()) {
    return;
  }
  UnitOfWork deleteUOW=getSession().acquireUnitOfWork();
  deleteUOW.deleteObject(deleteUOW.readObject(originalAddress));
  deleteUOW.deleteObject(deleteUOW.readObject(originalEmployee));
  deleteUOW.commit();
  getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
}
Program: 65287
Project: 65287
Buggy source:
/** 
 * Removed.  Requires a JSON parsing feature to detect incorrect data
 * @Test public void testCreateWrongType(){ WebResource webResource = client.resource(SERVER_URI + DEFAULT_PU + "/entity/" + "StaticUser"); ByteArrayOutputStream os = new ByteArrayOutputStream(); try{ context.marshallEntity(new StaticBid(), MediaType.APPLICATION_JSON_TYPE, os);        } catch (JAXBException e){ fail("Exception thrown unmarshalling: " + e); } ClientResponse response = webResource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE).put(ClientResponse.class, os.toString()); Status status = response.getClientResponseStatus(); assertTrue("Wrong exception thrown for non-existant object read.", status.equals(Status.NOT_FOUND)); }
 */
@Test public void testCreateGarbage(){
  WebResource webResource=client.resource(SERVER_URI + DEFAULT_PU + "String_Node_Str"+ "String_Node_Str");
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  byte[] b="String_Node_Str".getBytes();
  try {
    os.write(b);
  }
 catch (  IOException e) {
    fail("String_Node_Str" + e);
  }
  ClientResponse response=webResource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE).put(ClientResponse.class,os.toString());
  Status status=response.getClientResponseStatus();
  assertTrue("String_Node_Str" + status,status.equals(Status.INTERNAL_SERVER_ERROR));
}

Fixed version (ground truth):
/** 
 * Removed.  Requires a JSON parsing feature to detect incorrect data
 * @Test public void testCreateWrongType(){ WebResource webResource = client.resource(SERVER_URI + DEFAULT_PU + "/entity/" + "StaticUser"); ByteArrayOutputStream os = new ByteArrayOutputStream(); try{ context.marshallEntity(new StaticBid(), MediaType.APPLICATION_JSON_TYPE, os);        } catch (JAXBException e){ fail("Exception thrown unmarshalling: " + e); } ClientResponse response = webResource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE).put(ClientResponse.class, os.toString()); Status status = response.getClientResponseStatus(); assertTrue("Wrong exception thrown for non-existant object read.", status.equals(Status.NOT_FOUND)); }
 */
@Test public void testCreateGarbage(){
  WebResource webResource=client.resource(SERVER_URI + DEFAULT_PU + "String_Node_Str"+ "String_Node_Str");
  ByteArrayOutputStream os=new ByteArrayOutputStream();
  byte[] b="String_Node_Str".getBytes();
  try {
    os.write(b);
  }
 catch (  IOException e) {
    fail("String_Node_Str" + e);
  }
  ClientResponse response=webResource.type(MediaType.APPLICATION_JSON_TYPE).accept(MediaType.APPLICATION_JSON_TYPE).put(ClientResponse.class,os.toString());
  Status status=response.getClientResponseStatus();
  assertTrue("String_Node_Str" + status,status.equals(Status.BAD_REQUEST));
}
Program: 65288
Project: 65288
Buggy source:
@BeforeClass public static void setup(){
  Map<String,Object> properties=new HashMap<String,Object>();
  ExamplePropertiesLoader.loadProperties(properties);
  properties.put(PersistenceUnitProperties.NON_JTA_DATASOURCE,null);
  properties.put(PersistenceUnitProperties.DDL_GENERATION,PersistenceUnitProperties.DROP_AND_CREATE);
  PersistenceFactory factory=new PersistenceFactory();
  factory.setMetadataStore(new DatabaseMetadataStore());
  factory.getMetadataStore().setProperties(properties);
  factory.getMetadataStore().clearMetadata();
  EntityManagerFactory emf=Persistence.createEntityManagerFactory(DEFAULT_PU,properties);
  try {
    context=factory.bootstrapPersistenceContext("String_Node_Str",emf,new URI("String_Node_Str"),false);
  }
 catch (  URISyntaxException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  populateDB(emf);
  client=Client.create();
}

Fixed version (ground truth):
@BeforeClass public static void setup(){
  Map<String,Object> properties=new HashMap<String,Object>();
  ExamplePropertiesLoader.loadProperties(properties);
  properties.put(PersistenceUnitProperties.NON_JTA_DATASOURCE,null);
  properties.put(PersistenceUnitProperties.JTA_DATASOURCE,null);
  properties.put(PersistenceUnitProperties.DDL_GENERATION,PersistenceUnitProperties.DROP_AND_CREATE);
  PersistenceFactory factory=new PersistenceFactory();
  factory.setMetadataStore(new DatabaseMetadataStore());
  factory.getMetadataStore().setProperties(properties);
  factory.getMetadataStore().clearMetadata();
  EntityManagerFactory emf=Persistence.createEntityManagerFactory(DEFAULT_PU,properties);
  try {
    context=factory.bootstrapPersistenceContext("String_Node_Str",emf,new URI("String_Node_Str"),false);
  }
 catch (  URISyntaxException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
  populateDB(emf);
  client=Client.create();
}
Program: 65289
Project: 65289
Buggy source:
public void test(){
  getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
  UnitOfWork rootUOW=getSession().acquireUnitOfWork();
  Address addressRO=(Address)getSession().readObject(Address.class,new ExpressionBuilder().get("String_Node_Str").equal(postalCode));
  if (addressRO == null) {
    throw new TestErrorException("String_Node_Str");
  }
  UnitOfWork nestedUOW=rootUOW.acquireUnitOfWork();
  nestedUOW.addReadOnlyClass(Address.class);
  Employee emp=(Employee)nestedUOW.registerObject(new Employee());
  emp.setFirstName("String_Node_Str");
  emp.setAddress(addressRO);
  nestedUOW.commit();
  rootUOW.commit();
}

Fixed version (ground truth):
public void test(){
  getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
  UnitOfWork rootUOW=getSession().acquireUnitOfWork();
  Address addressRO=(Address)getSession().readObject(Address.class,new ExpressionBuilder().get("String_Node_Str").equal(postalCode));
  if (addressRO == null) {
    throw new TestErrorException("String_Node_Str");
  }
  UnitOfWork nestedUOW=rootUOW.acquireUnitOfWork();
  nestedUOW.addReadOnlyClass(Address.class);
  Employee emp=(Employee)nestedUOW.registerObject(new Employee());
  nestedUOW.assignSequenceNumber(emp);
  emp.setFirstName("String_Node_Str");
  emp.setAddress(addressRO);
  nestedUOW.commit();
  rootUOW.commit();
  originalEmployee=emp;
}
Program: 65290
Project: 65290
Buggy source:
public void setup(){
  getAbstractSession().beginTransaction();
  postalCode="String_Node_Str";
  UnitOfWork uow=getSession().acquireUnitOfWork();
  Address address=(Address)uow.registerObject(new Address());
  address.setPostalCode(postalCode);
  address.setCity("String_Node_Str");
  address.setCountry("String_Node_Str");
  uow.commit();
  getAbstractSession().commitTransaction();
}

Fixed version (ground truth):
public void setup(){
  getAbstractSession().beginTransaction();
  postalCode="String_Node_Str";
  UnitOfWork uow=getSession().acquireUnitOfWork();
  Address address=(Address)uow.registerObject(new Address());
  uow.assignSequenceNumber(address);
  address.setPostalCode(postalCode);
  address.setCity("String_Node_Str");
  address.setCountry("String_Node_Str");
  uow.commit();
  getAbstractSession().commitTransaction();
  originalAddress=address;
}
Program: 65291
Project: 65291
Buggy source:
public void reset(){
  getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
}

Fixed version (ground truth):
public void reset(){
  UnitOfWork deleteUOW=getSession().acquireUnitOfWork();
  deleteUOW.deleteObject(deleteUOW.readObject(originalAddress));
  deleteUOW.deleteObject(deleteUOW.readObject(originalEmployee));
  deleteUOW.commit();
  getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
}
Program: 65292
Project: 65292
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected AbstractSemanticValidator buildValidator(){
  return new DefaultSemanticValidator(buildSemanticValidatorHelper());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected abstract AbstractSemanticValidator buildValidator();
Program: 65294
Project: 65294
Buggy source:
/** 
 * Validates the given   {@link validateSelectClause}. The default behavior does not require to semantically validate it.
 * @param expression The {@link validateSelectClause} to validate
 */
protected void validateSelectClause(SelectClause expression){
  super.visit(expression);
}

Fixed version (ground truth):
/** 
 * Validates the given   {@link validateSelectClause}. The default behavior does not require to semantically validate it.
 * @param expression The {@link validateSelectClause} to validate
 */
protected void validateSelectClause(SelectClause expression){
  Expression selectExpression=expression.getSelectExpression();
  StateFieldPathExpression pathExpression=getStateFieldPathExpression(selectExpression);
  if (pathExpression != null) {
    validateStateFieldPathExpression(pathExpression,selectClausePathExpressionPathType());
  }
 else {
    selectExpression.accept(this);
  }
}
Program: 65295
Project: 65295
Buggy source:
/** 
 * Validates the encapsulated expression of the given <code><b>SUBSTRING</b></code> expression. The test to perform is: <ul> <li>If the encapsulated expression is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> <li>If the encapsulated expression is not a path expression, validation will be redirected to that expression but the returned status will not be changed.</li> </ul>
 * @param expression The {@link SubstringExpression} to validate by validating its encapsulated expression
 * @return TODO
 */
protected int validateSubstringExpression(SubstringExpression expression){
  int result=0;
  if (expression.hasFirstExpression()) {
    Expression firstExpression=expression.getFirstExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(firstExpression);
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,false);
      updateStatus(result,0,valid);
    }
 else {
      firstExpression.accept(this);
    }
  }
  expression.getSecondExpression().accept(this);
  expression.getThirdExpression().accept(this);
  return result;
}

Fixed version (ground truth):
/** 
 * Validates the encapsulated expression of the given <code><b>SUBSTRING</b></code> expression. The test to perform is: <ul> <li>If the encapsulated expression is a path expression, validation makes sure it is a basic mapping, an association field is not allowed.</li> <li>If the encapsulated expression is not a path expression, validation will be redirected to that expression but the returned status will not be changed.</li> </ul>
 * @param expression The {@link SubstringExpression} to validate by validating its encapsulated expression
 * @return TODO
 */
protected int validateSubstringExpression(SubstringExpression expression){
  int result=0;
  if (expression.hasFirstExpression()) {
    Expression firstExpression=expression.getFirstExpression();
    StateFieldPathExpression pathExpression=getStateFieldPathExpression(firstExpression);
    if (pathExpression != null) {
      boolean valid=validateStateFieldPathExpression(pathExpression,PathType.BASIC_FIELD_ONLY);
      updateStatus(result,0,valid);
    }
 else {
      firstExpression.accept(this);
    }
  }
  expression.getSecondExpression().accept(this);
  expression.getThirdExpression().accept(this);
  return result;
}