nus-yam/ex-repair huggingface dataset:
Program: 63446
Project: 63446
Buggy source:
/** 
 * Create database schemas and/or tables and/or create DDL scripts as  determined by the supplied properties. <p> Called by the Persistence class when schema generation is to occur as a  separate phase from creation of the entity manager factory. <p>
 * @param persistenceUnitName the name of the persistence unit
 * @param properties properties for schema generation; these may also contain provider-specific properties. The value of these  properties override any values that may have been configured  elsewhere.
 * @throws PersistenceException if insufficient or inconsistentconfiguration information is provided of if schema generation  otherwise fails
 * @since Java Persistence 2.1
 */
public boolean generateSchema(String persistenceUnitName,Map properties){
  String puName=(persistenceUnitName == null) ? "String_Node_Str" : persistenceUnitName;
  Map nonNullProperties=(properties == null) ? new HashMap() : properties;
  if (checkForProviderProperty(nonNullProperties)) {
    JPAInitializer initializer=getInitializer(puName,nonNullProperties);
    SEPersistenceUnitInfo puInfo=initializer.findPersistenceUnitInfo(puName,nonNullProperties);
    if (puInfo != null) {
      generateSchema(puInfo,nonNullProperties);
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Create database schemas and/or tables and/or create DDL scripts as  determined by the supplied properties. <p> Called by the Persistence class when schema generation is to occur as a  separate phase from creation of the entity manager factory. <p>
 * @param persistenceUnitName the name of the persistence unit
 * @param properties properties for schema generation; these may also contain provider-specific properties. The value of these  properties override any values that may have been configured  elsewhere.
 * @throws PersistenceException if insufficient or inconsistentconfiguration information is provided of if schema generation  otherwise fails
 * @since Java Persistence 2.1
 */
public boolean generateSchema(String persistenceUnitName,Map properties){
  String puName=(persistenceUnitName == null) ? "String_Node_Str" : persistenceUnitName;
  Map nonNullProperties=(properties == null) ? new HashMap() : properties;
  if (checkForProviderProperty(nonNullProperties)) {
    JPAInitializer initializer=getInitializer(puName,nonNullProperties);
    SEPersistenceUnitInfo puInfo=initializer.findPersistenceUnitInfo(puName,nonNullProperties);
    if (puInfo != null && checkForProviderProperty(properties)) {
      createEntityManagerFactoryImpl(puInfo,properties,false).close();
      return true;
    }
  }
  return false;
}
Program: 63448
Project: 63448
Buggy source:
/** 
 * Create and initialize.
 */
public ApplicationAccessWLS(){
  try {
    initUsingCic();
  }
 catch (  Exception e) {
    cicInstance=null;
    try {
      initUsingApplicationAccess();
    }
 catch (    Exception ex) {
      applicationAccessInstance=null;
    }
  }
}

Fixed version (ground truth):
/** 
 * Create and initialize.
 */
public ApplicationAccessWLS(){
  try {
    initUsingCic();
    LOGGER.fine("String_Node_Str");
  }
 catch (  Exception e) {
    LOGGER.log(Level.FINE,"String_Node_Str" + "String_Node_Str",e);
    cicManagerInstance=null;
    try {
      initUsingApplicationAccess();
      LOGGER.fine("String_Node_Str");
    }
 catch (    Exception ex) {
      LOGGER.log(Level.FINE,"String_Node_Str",ex);
      applicationAccessInstance=null;
    }
  }
}
Program: 63449
Project: 63449
Buggy source:
/** 
 * Gets a unique application name. Uses CIC if possible. If not using ApplicationAccess.
 * @param classLoader   the class loader
 * @return unique application name.
 */
public String getApplicationName(ClassLoader classLoader){
  if (cicInstance != null) {
    try {
      return getAppNameUsingCic();
    }
 catch (    Exception e) {
      return null;
    }
  }
  if (applicationAccessInstance != null) {
    try {
      return getAppNameUsingApplicationAccess(classLoader);
    }
 catch (    Exception e) {
      return null;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets a unique application name.
 * @param classLoader   the class loader
 * @return unique application name.
 */
public String getApplicationName(ClassLoader classLoader){
  if (appNames.containsKey(classLoader)) {
    return appNames.get(classLoader);
  }
 else {
synchronized (appNames) {
      if (appNames.containsKey(classLoader)) {
        return appNames.get(classLoader);
      }
 else {
        final String appName=getApplicationNameInternal(classLoader);
        appNames.put(classLoader,appName);
        return appName;
      }
    }
  }
}
Program: 63450
Project: 63450
Buggy source:
/** 
 * Initializes CIC.
 */
protected void initUsingCic() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  final Class cicManagerClass=PrivilegedAccessHelper.getClassForName("String_Node_Str");
  final Method getInstance=PrivilegedAccessHelper.getDeclaredMethod(cicManagerClass,"String_Node_Str",new Class[]{});
  final Object cicManager=PrivilegedAccessHelper.invokeMethod(getInstance,cicManagerClass);
  final Method getCurrentCic=PrivilegedAccessHelper.getMethod(cicManagerClass,"String_Node_Str",new Class[]{},true);
  cicInstance=PrivilegedAccessHelper.invokeMethod(getCurrentCic,cicManager);
  getApplicationId=PrivilegedAccessHelper.getDeclaredMethod(cicInstance.getClass(),"String_Node_Str",new Class[]{});
}

Fixed version (ground truth):
/** 
 * Initializes CIC.
 */
protected void initUsingCic() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
  final Class cicManagerClass=PrivilegedAccessHelper.getClassForName("String_Node_Str");
  final Method getInstance=PrivilegedAccessHelper.getDeclaredMethod(cicManagerClass,"String_Node_Str",new Class[]{});
  cicManagerInstance=PrivilegedAccessHelper.invokeMethod(getInstance,cicManagerClass);
  getCurrentCicMethod=PrivilegedAccessHelper.getMethod(cicManagerClass,"String_Node_Str",new Class[]{},true);
  final Class cicClass=PrivilegedAccessHelper.getClassForName("String_Node_Str");
  getApplicationIdMethod=PrivilegedAccessHelper.getDeclaredMethod(cicClass,"String_Node_Str",new Class[]{});
}
Program: 63451
Project: 63451
Buggy source:
/** 
 * Gets unique application name using CIC. Calls cicInstance.getApplicationId().
 */
private String getAppNameUsingCic() throws InvocationTargetException, IllegalAccessException {
  return (String)PrivilegedAccessHelper.invokeMethod(getApplicationId,cicInstance);
}

Fixed version (ground truth):
/** 
 * Gets unique application name using CIC. Calls cicInstance.getApplicationIdMethod().
 */
private String getAppNameUsingCic() throws InvocationTargetException, IllegalAccessException {
  final Object cicInstance=PrivilegedAccessHelper.invokeMethod(getCurrentCicMethod,cicManagerInstance);
  return (String)PrivilegedAccessHelper.invokeMethod(getApplicationIdMethod,cicInstance);
}
Program: 63452
Project: 63452
Buggy source:
public String getQualifiedTableName(){
  return getQualified(getTableName());
}

Fixed version (ground truth):
public String getQualifiedTableName(){
  return getQualified(getTable().getName());
}
Program: 63453
Project: 63453
Buggy source:
public void onConnect(){
  if (this.table.getName().length() == 0) {
    this.table.setName(((DatabasePlatform)getDatasourcePlatform()).getDefaultSequenceTableName());
  }
  super.onConnect();
}

Fixed version (ground truth):
public void onConnect(){
  if (this.table.getName().length() == 0) {
    this.table.setName(((DatabasePlatform)getDatasourcePlatform()).getDefaultSequenceTableName());
  }
  if ((this.qualifier == null || this.qualifier.length() == 0) && (this.table.getTableQualifier() != null && this.table.getTableQualifier().length() != 0)) {
    this.qualifier=this.table.getTableQualifier();
  }
  super.onConnect();
}
Program: 63454
Project: 63454
Buggy source:
/** 
 * INTERNAL: Return the SQL to delete the row from the sequence table. If we're dealing with create creation, then delegate to the table so that is dropped outright since we will delete the schema. 
 */
public Writer buildDeletionWriter(AbstractSession session,Writer writer) throws ValidationException {
  if (shouldDropTableDefinition()) {
    return tableDefinition.buildDeletionWriter(session,writer);
  }
 else {
    try {
      writer.write("String_Node_Str");
      writer.write(getSequenceTableName());
      writer.write("String_Node_Str" + getSequenceNameFieldName());
      writer.write("String_Node_Str" + getName() + "String_Node_Str");
    }
 catch (    IOException ioException) {
      throw ValidationException.fileError(ioException);
    }
    return writer;
  }
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the SQL to delete the row from the sequence table. If we're dealing with create creation, then delegate to the table so that is dropped outright since we will delete the schema. 
 */
public Writer buildDeletionWriter(AbstractSession session,Writer writer) throws ValidationException {
  if (shouldDropTableDefinition()) {
    return tableDefinition.buildDeletionWriter(session,writer);
  }
 else {
    try {
      writer.write("String_Node_Str");
      writer.write(getSequenceTableQualifiedName());
      writer.write("String_Node_Str" + getSequenceNameFieldName());
      writer.write("String_Node_Str" + getName() + "String_Node_Str");
    }
 catch (    IOException ioException) {
      throw ValidationException.fileError(ioException);
    }
    return writer;
  }
}
Program: 63455
Project: 63455
Buggy source:
/** 
 * PUBLIC:
 */
public String getSequenceTableName(){
  return getTableSequence().getTableName();
}

Fixed version (ground truth):
/** 
 * PUBLIC:
 */
public String getSequenceTableName(){
  return getSequenceTable().getName();
}
Program: 63456
Project: 63456
Buggy source:
/** 
 * INTERNAL: Return the SQL required to insert the sequence row into the sequence table. Assume that the sequence table exists.
 */
public Writer buildCreationWriter(AbstractSession session,Writer writer) throws ValidationException {
  try {
    writer.write("String_Node_Str");
    writer.write(getSequenceTableName());
    writer.write("String_Node_Str" + getSequenceNameFieldName());
    writer.write("String_Node_Str" + getSequenceCounterFieldName());
    writer.write("String_Node_Str");
    writer.write("String_Node_Str" + getName() + "String_Node_Str"+ Integer.toString(sequence.getInitialValue() - 1)+ "String_Node_Str");
  }
 catch (  IOException ioException) {
    throw ValidationException.fileError(ioException);
  }
  return writer;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the SQL required to insert the sequence row into the sequence table. Assume that the sequence table exists.
 */
public Writer buildCreationWriter(AbstractSession session,Writer writer) throws ValidationException {
  try {
    writer.write("String_Node_Str");
    writer.write(getSequenceTableQualifiedName());
    writer.write("String_Node_Str" + getSequenceNameFieldName());
    writer.write("String_Node_Str" + getSequenceCounterFieldName());
    writer.write("String_Node_Str");
    writer.write("String_Node_Str" + getName() + "String_Node_Str"+ Integer.toString(sequence.getInitialValue() - 1)+ "String_Node_Str");
  }
 catch (  IOException ioException) {
    throw ValidationException.fileError(ioException);
  }
  return writer;
}
Program: 63457
Project: 63457
Buggy source:
/** 
 * INTERAL: Execute the SQL required to insert the sequence row into the sequence table. Assume that the sequence table exists.
 */
public boolean checkIfExist(AbstractSession session) throws DatabaseException {
  Vector results=session.priviledgedExecuteSelectingCall(new org.eclipse.persistence.queries.SQLCall("String_Node_Str" + getSequenceTableName() + "String_Node_Str"+ getSequenceNameFieldName()+ "String_Node_Str"+ getName()+ "String_Node_Str"));
  return !results.isEmpty();
}

Fixed version (ground truth):
/** 
 * INTERAL: Execute the SQL required to insert the sequence row into the sequence table. Assume that the sequence table exists.
 */
public boolean checkIfExist(AbstractSession session) throws DatabaseException {
  StringBuilder buffer=new StringBuilder();
  buffer.append("String_Node_Str");
  buffer.append(getSequenceTableQualifiedName());
  buffer.append("String_Node_Str");
  buffer.append(getSequenceNameFieldName());
  buffer.append("String_Node_Str");
  buffer.append(getName());
  buffer.append("String_Node_Str");
  Vector results=session.priviledgedExecuteSelectingCall(new org.eclipse.persistence.queries.SQLCall(buffer.toString()));
  return !results.isEmpty();
}
Program: 63458
Project: 63458
Buggy source:
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  return suite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite suite=new TestSuite("String_Node_Str");
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  suite.addTest(new AdvancedJunitTest("String_Node_Str"));
  return suite;
}
Program: 63459
Project: 63459
Buggy source:
@Test public void createSimpleA(){
  DynamicType simpleTypeA=dynamicHelper.getType("String_Node_Str");
  Assert.assertNotNull(simpleTypeA);
  DynamicEntity a=simpleTypeA.newDynamicEntity();
  assertNotNull(a);
  assertEquals(((Number)a.get("String_Node_Str")).intValue(),0);
  assertFalse(a.isSet("String_Node_Str"));
  assertFalse(a.isSet("String_Node_Str"));
  assertFalse(a.isSet("String_Node_Str"));
  DynamicType typeC=dynamicHelper.getType("String_Node_Str");
  assertEquals(a.get("String_Node_Str").getClass(),typeC.newDynamicEntity().getClass());
  DynamicEntity c=a.<DynamicEntity>get("String_Node_Str");
  assertNotNull(c);
  assertEquals(((Number)c.get("String_Node_Str")).doubleValue(),0.0);
  assertFalse(c.isSet("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void createSimpleA(){
  DynamicType simpleTypeA=dynamicHelper.getType("String_Node_Str");
  Assert.assertNotNull(simpleTypeA);
  DynamicEntity a=simpleTypeA.newDynamicEntity();
  assertNotNull(a);
  assertEquals(((Number)a.get("String_Node_Str")).intValue(),0);
  assertFalse(a.isSet("String_Node_Str"));
  assertFalse(a.isSet("String_Node_Str"));
  assertFalse(a.isSet("String_Node_Str"));
  DynamicType typeC=dynamicHelper.getType("String_Node_Str");
  assertEquals(a.get("String_Node_Str").getClass(),typeC.newDynamicEntity().getClass());
  DynamicEntity c=a.get("String_Node_Str");
  assertNotNull(c);
  assertEquals(((Number)c.get("String_Node_Str")).doubleValue(),0.0,0.01);
  assertFalse(c.isSet("String_Node_Str"));
}
Program: 63460
Project: 63460
Buggy source:
@Test public void createSimpleA(){
  DynamicType simpleTypeA=dynamicHelper.getType("String_Node_Str");
  Assert.assertNotNull(simpleTypeA);
  DynamicEntity a=simpleTypeA.newDynamicEntity();
  assertNotNull(a);
  assertEquals(((Number)a.get("String_Node_Str")).intValue(),0);
  assertFalse(a.isSet("String_Node_Str"));
  assertEquals(a.get("String_Node_Str"),false);
  assertFalse(a.isSet("String_Node_Str"));
  assertEquals(((Number)a.get("String_Node_Str")).doubleValue(),0.0);
  assertFalse(a.isSet("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void createSimpleA(){
  DynamicType simpleTypeA=dynamicHelper.getType("String_Node_Str");
  Assert.assertNotNull(simpleTypeA);
  DynamicEntity a=simpleTypeA.newDynamicEntity();
  assertNotNull(a);
  assertEquals(((Number)a.get("String_Node_Str")).intValue(),0);
  assertFalse(a.isSet("String_Node_Str"));
  assertEquals(a.get("String_Node_Str"),false);
  assertFalse(a.isSet("String_Node_Str"));
  assertEquals(((Number)a.get("String_Node_Str")).doubleValue(),0.0,0.01);
  assertFalse(a.isSet("String_Node_Str"));
}
Program: 63461
Project: 63461
Buggy source:
@Test public void createSimpleA(){
  DynamicTypeImpl simpleTypeA=(DynamicTypeImpl)helper.getType("String_Node_Str");
  assertNotNull(simpleTypeA);
  DynamicEntity a=simpleTypeA.newDynamicEntity();
  assertNotNull(a);
  assertEquals(((Number)a.get("String_Node_Str")).intValue(),0);
  assertFalse(a.isSet("String_Node_Str"));
  assertFalse(a.isSet("String_Node_Str"));
  assertFalse(a.isSet("String_Node_Str"));
  DynamicType typeC=helper.getType("String_Node_Str");
  assertEquals(a.get("String_Node_Str").getClass(),typeC.newDynamicEntity().getClass());
  DynamicEntity c=a.<DynamicEntity>get("String_Node_Str");
  assertNotNull(c);
  assertEquals(((Number)c.get("String_Node_Str")).doubleValue(),0.0);
  assertFalse(c.isSet("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void createSimpleA(){
  DynamicTypeImpl simpleTypeA=(DynamicTypeImpl)helper.getType("String_Node_Str");
  assertNotNull(simpleTypeA);
  DynamicEntity a=simpleTypeA.newDynamicEntity();
  assertNotNull(a);
  assertEquals(((Number)a.get("String_Node_Str")).intValue(),0);
  assertFalse(a.isSet("String_Node_Str"));
  assertFalse(a.isSet("String_Node_Str"));
  assertFalse(a.isSet("String_Node_Str"));
  DynamicType typeC=helper.getType("String_Node_Str");
  assertEquals(a.get("String_Node_Str").getClass(),typeC.newDynamicEntity().getClass());
  DynamicEntity c=a.get("String_Node_Str");
  assertNotNull(c);
  assertEquals(((Number)c.get("String_Node_Str")).doubleValue(),0.0,0.01);
  assertFalse(c.isSet("String_Node_Str"));
}
Program: 63462
Project: 63462
Buggy source:
@Test public void createSimpleA(){
  DynamicType simpleTypeA=helper.getType("String_Node_Str");
  assertNotNull(simpleTypeA);
  DynamicEntity a=simpleTypeA.newDynamicEntity();
  assertNotNull(a);
  assertEquals(((Number)a.get("String_Node_Str")).intValue(),0);
  assertFalse(a.isSet("String_Node_Str"));
  assertEquals(a.get("String_Node_Str"),false);
  assertFalse(a.isSet("String_Node_Str"));
  assertEquals(((Number)a.get("String_Node_Str")).doubleValue(),0.0);
  assertFalse(a.isSet("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void createSimpleA(){
  DynamicType simpleTypeA=helper.getType("String_Node_Str");
  assertNotNull(simpleTypeA);
  DynamicEntity a=simpleTypeA.newDynamicEntity();
  assertNotNull(a);
  assertEquals(((Number)a.get("String_Node_Str")).intValue(),0);
  assertFalse(a.isSet("String_Node_Str"));
  assertEquals(a.get("String_Node_Str"),false);
  assertFalse(a.isSet("String_Node_Str"));
  assertEquals(((Number)a.get("String_Node_Str")).doubleValue(),0.0,0.01);
  assertFalse(a.isSet("String_Node_Str"));
}
Program: 63463
Project: 63463
Buggy source:
public TestSuite getSessionManagerTestSuite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new SessionManagerGetSessionStringStringTest());
  suite.addTest(new SessionManagerGetSessionNotFoundTest());
  suite.addTest(new MWConfigModelEncryptionTest());
  suite.addTestSuite(SessionManagerTest.class);
  return suite;
}

Fixed version (ground truth):
public TestSuite getSessionManagerTestSuite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.addTest(new SessionManagerGetSessionStringStringTest());
  suite.addTest(new SessionManagerGetSessionNotFoundTest());
  suite.addTest(new MWConfigModelEncryptionTest());
  return suite;
}
Program: 63464
Project: 63464
Buggy source:
/** 
 * PUBLIC: Iterate through the exception list printing out the stack traces.
 */
public void printStackTrace(PrintWriter writer){
  super.printStackTrace(writer);
  if (getExceptionList() != null) {
    writer.println("String_Node_Str");
    Iterator<Throwable> exceptionList=getExceptionList().iterator();
    while (exceptionList.hasNext()) {
      writer.write("String_Node_Str");
      writer.write(cr());
      exceptionList.next().printStackTrace(writer);
      writer.write(cr());
    }
  }
  writer.flush();
}

Fixed version (ground truth):
/** 
 * PUBLIC: Iterate through the exception list printing out the stack traces.
 */
public void printStackTrace(PrintWriter writer){
  super.printStackTrace(writer);
  if (getExceptionList() != null) {
    writer.println("String_Node_Str");
    Iterator exceptionList=getExceptionList().iterator();
    while (exceptionList.hasNext()) {
      writer.write("String_Node_Str");
      writer.write(cr());
      ((Throwable)exceptionList.next()).printStackTrace(writer);
      writer.write(cr());
    }
  }
  writer.flush();
}
Program: 63465
Project: 63465
Buggy source:
public void setExceptionList(Vector<Throwable> list){
  this.exceptionList=list;
}

Fixed version (ground truth):
public void setExceptionList(Vector list){
  this.exceptionList=list;
}
Program: 63466
Project: 63466
Buggy source:
public Vector<Throwable> getExceptionList(){
  return this.exceptionList;
}

Fixed version (ground truth):
public Vector getExceptionList(){
  return this.exceptionList;
}
Program: 63467
Project: 63467
Buggy source:
public String toString(){
  if (getErrorCode() == FINAL_EXCEPTION) {
    StringBuffer buffer=new StringBuffer();
    buffer.append(getMessage());
    buffer.append(cr());
    Iterator<Throwable> exceptionList=getExceptionList().iterator();
    while (exceptionList.hasNext()) {
      buffer.append("String_Node_Str");
      buffer.append(cr());
      buffer.append(exceptionList.next().toString());
      buffer.append(cr());
    }
    return buffer.toString();
  }
 else {
    return super.toString();
  }
}

Fixed version (ground truth):
public String toString(){
  if (getErrorCode() == FINAL_EXCEPTION) {
    StringBuffer buffer=new StringBuffer();
    buffer.append(getMessage());
    buffer.append(cr());
    Iterator exceptionList=getExceptionList().iterator();
    while (exceptionList.hasNext()) {
      buffer.append("String_Node_Str");
      buffer.append(cr());
      buffer.append(exceptionList.next().toString());
      buffer.append(cr());
    }
    return buffer.toString();
  }
 else {
    return super.toString();
  }
}
Program: 63469
Project: 63469
Buggy source:
@Test public void testEntityOptions() throws URISyntaxException {
  final Response response=metadataResource.getEntityOptions(version,pu,"String_Node_Str",TestHttpHeaders.generateHTTPHeader(MediaType.APPLICATION_JSON_TYPE,MediaType.APPLICATION_JSON),new TestURIInfo());
  assertTrue(response.getMetadata().containsKey("String_Node_Str"));
  final String link="String_Node_Str" + RestUtils.getServerURI(context.getVersion()) + context.getName()+ "String_Node_Str";
  assertTrue(response.getMetadata().get("String_Node_Str").get(0).equals(link));
}

Fixed version (ground truth):
@Test public void testEntityOptions() throws URISyntaxException {
  final EntityResource entityResource=new EntityResource();
  entityResource.setPersistenceFactory(factory);
  final Response response=entityResource.getEntityOptions(version,pu,"String_Node_Str",TestHttpHeaders.generateHTTPHeader(MediaType.APPLICATION_JSON_TYPE,MediaType.APPLICATION_JSON),new TestURIInfo());
  assertTrue(response.getMetadata().containsKey("String_Node_Str"));
  final String link="String_Node_Str" + RestUtils.getServerURI(context.getVersion()) + context.getName()+ "String_Node_Str";
  assertTrue(response.getMetadata().get("String_Node_Str").get(0).equals(link));
}
Program: 63470
Project: 63470
Buggy source:
@Test public void testQueryOptions() throws URISyntaxException {
  final Response response=metadataResource.getQueryOptions(version,pu,"String_Node_Str",TestHttpHeaders.generateHTTPHeader(MediaType.APPLICATION_JSON_TYPE,MediaType.APPLICATION_JSON),new TestURIInfo());
  assertTrue(response.getMetadata().containsKey("String_Node_Str"));
  final String link="String_Node_Str" + RestUtils.getServerURI(context.getVersion()) + context.getName()+ "String_Node_Str";
  assertTrue(response.getMetadata().get("String_Node_Str").get(0).equals(link));
}

Fixed version (ground truth):
@Test public void testQueryOptions() throws URISyntaxException {
  final QueryResource queryResource=new QueryResource();
  queryResource.setPersistenceFactory(factory);
  final Response response=queryResource.getQueryOptions(version,pu,"String_Node_Str",TestHttpHeaders.generateHTTPHeader(MediaType.APPLICATION_JSON_TYPE,MediaType.APPLICATION_JSON),new TestURIInfo());
  assertTrue(response.getMetadata().containsKey("String_Node_Str"));
  final String link="String_Node_Str" + RestUtils.getServerURI(context.getVersion()) + context.getName()+ "String_Node_Str";
  assertTrue(response.getMetadata().get("String_Node_Str").get(0).equals(link));
}
Program: 63471
Project: 63471
Buggy source:
public void test() throws Exception {
  String[][] EJBQLTestString={{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  verifyCustomQuery(EJBQLTestString);
}

Fixed version (ground truth):
public void test() throws Exception {
  String[][] EJBQLTestString={{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str","String_Node_Str"}};
  verifyCustomQuery(EJBQLTestString);
}
Program: 63472
Project: 63472
Buggy source:
/** 
 * Return true if the specific mark is existing and not quoted around.
 */
private boolean hasArgumentMark(String string,char mark){
  int quoteIndex=-1;
  int lastEndQuoteIndex=-1;
  do {
    int markIndex=string.indexOf(mark,lastEndQuoteIndex + 1);
    if (markIndex == -1) {
      return false;
    }
    quoteIndex=string.lastIndexOf('\'',markIndex);
    if (quoteIndex == -1) {
      return true;
    }
 else {
      boolean hasPairedQuoteBeforeMark=false;
      while (quoteIndex != -1 && quoteIndex >= lastEndQuoteIndex) {
        if ((quoteIndex=string.lastIndexOf('\'',quoteIndex - 1)) != -1) {
          hasPairedQuoteBeforeMark=!hasPairedQuoteBeforeMark;
        }
      }
      if (hasPairedQuoteBeforeMark) {
        return true;
      }
 else {
        lastEndQuoteIndex=string.indexOf('\'',markIndex + 1);
        if (lastEndQuoteIndex == -1) {
          return true;
        }
      }
    }
  }
 while (true);
}

Fixed version (ground truth):
/** 
 * Return true if the specific mark is existing and not quoted around.
 * @param string    string to search
 * @param mark      mark to find
 * @param quote     quote char (usually ' or ")
 */
private boolean hasArgumentMark(String string,char mark,char quote){
  int quoteIndex=-1;
  int lastEndQuoteIndex=-1;
  do {
    int markIndex=string.indexOf(mark,lastEndQuoteIndex + 1);
    if (markIndex == -1) {
      return false;
    }
    quoteIndex=string.lastIndexOf(quote,markIndex);
    if (quoteIndex == -1) {
      return true;
    }
 else {
      boolean hasPairedQuoteBeforeMark=false;
      while (quoteIndex != -1 && quoteIndex >= lastEndQuoteIndex) {
        if ((quoteIndex=string.lastIndexOf(quote,quoteIndex - 1)) != -1) {
          hasPairedQuoteBeforeMark=!hasPairedQuoteBeforeMark;
        }
      }
      if (hasPairedQuoteBeforeMark) {
        return true;
      }
 else {
        lastEndQuoteIndex=string.indexOf(quote,markIndex + 1);
        if (lastEndQuoteIndex == -1) {
          return true;
        }
      }
    }
  }
 while (true);
}
Program: 63474
Project: 63474
Buggy source:
public static void main(String[] args){
  System.out.println(Version.getProduct() + "String_Node_Str" + Version.getVersion());
  System.out.println("String_Node_Str" + Version.getVersionString() + "String_Node_Str"+ Version.getBuildDate());
  System.out.println("String_Node_Str" + JavaSEPlatform.current.toString());
}

Fixed version (ground truth):
public static void main(String[] args){
  System.out.println(Version.getProduct() + "String_Node_Str" + Version.getVersion());
  System.out.println("String_Node_Str" + Version.getVersionString() + "String_Node_Str"+ Version.getBuildDate());
  System.out.println("String_Node_Str" + JavaSEPlatform.CURRENT.toString());
}
Program: 63475
Project: 63475
Buggy source:
/** 
 * Do we run with at least Java SE 1.8?
 * @return Value of {@code true} when we run with Java SE 1.8 or higheror  {@code false} otherwise.
 */
private static final boolean atLeastJava8(){
  return JavaSEPlatform.current.atLeast(JavaSEPlatform.v1_8);
}

Fixed version (ground truth):
/** 
 * Do we run with at least Java SE 1.8?
 * @return Value of {@code true} when we run with Java SE 1.8 or higheror  {@code false} otherwise.
 */
private static final boolean atLeastJava8(){
  return JavaSEPlatform.CURRENT.atLeast(JavaSEPlatform.v1_8);
}
Program: 63476
Project: 63476
Buggy source:
/** 
 * INTERNAL: Return the JDK version we are using.
 * @deprecated Use {@see JavaSEPlatform.current} instead.Will be removed in 2.7.
 */
public static int getJDKVersion(){
switch (JavaSEPlatform.current) {
case v1_7:
    JDK_VERSION=JDK_1_7;
  break;
case v1_8:
JDK_VERSION=JDK_1_8;
break;
case v1_9:
JDK_VERSION=JDK_1_9;
break;
}
return JDK_VERSION;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the JDK version we are using.
 * @deprecated Use {@see JavaSEPlatform.current} instead.Will be removed in 2.7.
 */
public static int getJDKVersion(){
switch (JavaSEPlatform.CURRENT) {
case v1_7:
    JDK_VERSION=JDK_1_7;
  break;
case v1_8:
JDK_VERSION=JDK_1_8;
break;
case v1_9:
JDK_VERSION=JDK_1_9;
break;
default :
throw new IllegalStateException("String_Node_Str" + JavaSEPlatform.CURRENT.toString());
}
return JDK_VERSION;
}
Program: 63477
Project: 63477
Buggy source:
/** 
 * Check whether we are running on Java SE 1.6. This will always return   {@code false} because Java SE 1.6 is notsupported by current EclipseLink.
 * @return Value of {@code true} when we do and value of {@code false}when we do not run on Java SE 1.6.
 * @deprecated Use {@code JavaSEPlatform.current.equals(JavaSEPlatform.v1_6)}instead. Will be removed in 2.7.
 */
public static boolean isJDK16(){
  return JavaSEPlatform.current.equals(JavaSEPlatform.v1_6);
}

Fixed version (ground truth):
/** 
 * Check whether we are running on Java SE 1.6. This will always return   {@code false} because Java SE 1.6 is notsupported by current EclipseLink.
 * @return Value of {@code true} when we do and value of {@code false}when we do not run on Java SE 1.6.
 */
public static boolean isJDK16(){
  return JavaSEPlatform.is(JavaSEPlatform.v1_6);
}
Program: 63478
Project: 63478
Buggy source:
/** 
 * Check whether we are running on Java SE 1.5. This will always return   {@code false} because Java SE 1.5 is notsupported by current EclipseLink.
 * @return Value of {@code true} when we do and value of {@code false}when we do not run on Java SE 1.5.
 * @deprecated Use {@code JavaSEPlatform.current.equals(JavaSEPlatform.v1_5)}instead. Will be removed in 2.7.
 */
public static boolean isJDK15(){
  return JavaSEPlatform.current.equals(JavaSEPlatform.v1_5);
}

Fixed version (ground truth):
/** 
 * Check whether we are running on Java SE 1.5. This will always return   {@code false} because Java SE 1.5 is notsupported by current EclipseLink.
 * @return Value of {@code true} when we do and value of {@code false}when we do not run on Java SE 1.5.
 */
public static boolean isJDK15(){
  return JavaSEPlatform.is(JavaSEPlatform.v1_5);
}
Program: 63479
Project: 63479
Buggy source:
/** 
 * INTERNAL: Get the version of JDK being used from the Version class.
 * @return JDKPlatform a platform appropriate for the version of JDK being used.
 */
protected static JDKPlatform getPlatform(){
  if (platform == null) {
    if (JavaSEPlatform.current.equals(JavaSEPlatform.v1_6)) {
      try {
        Class platformClass=null;
        if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
          try {
            platformClass=(Class)AccessController.doPrivileged(new PrivilegedClassForName("String_Node_Str"));
          }
 catch (          PrivilegedActionException exception) {
          }
        }
 else {
          platformClass=org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName("String_Node_Str");
        }
        if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
          try {
            platform=(JDKPlatform)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(platformClass));
          }
 catch (          PrivilegedActionException exception) {
          }
        }
 else {
          platform=(JDKPlatform)PrivilegedAccessHelper.newInstanceFromClass(platformClass);
        }
      }
 catch (      Exception exception) {
      }
    }
    if (platform == null) {
      platform=new JDK15Platform();
    }
  }
  return platform;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Get the version of JDK being used from the Version class.
 * @return JDKPlatform a platform appropriate for the version of JDK being used.
 */
protected static JDKPlatform getPlatform(){
  if (platform == null) {
    if (JavaSEPlatform.CURRENT.equals(JavaSEPlatform.v1_6)) {
      try {
        Class platformClass=null;
        if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
          try {
            platformClass=(Class)AccessController.doPrivileged(new PrivilegedClassForName("String_Node_Str"));
          }
 catch (          PrivilegedActionException exception) {
          }
        }
 else {
          platformClass=org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName("String_Node_Str");
        }
        if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()) {
          try {
            platform=(JDKPlatform)AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(platformClass));
          }
 catch (          PrivilegedActionException exception) {
          }
        }
 else {
          platform=(JDKPlatform)PrivilegedAccessHelper.newInstanceFromClass(platformClass);
        }
      }
 catch (      Exception exception) {
      }
    }
    if (platform == null) {
      platform=new JDK15Platform();
    }
  }
  return platform;
}
Program: 63480
Project: 63480
Buggy source:
/** 
 * Builds object graph for specified object using given filter.
 * @param object the object to build object graph for. Mandatory.
 * @param filter the filter (included or excluded fields) to use. Optional.
 * @return constructed object graph.
 */
public ObjectGraph createObjectGraph(Object object,FieldsFilter filter){
  final Node root=new Node();
  if (PersistenceWeavedRest.class.isAssignableFrom(object.getClass())) {
    createNodeForEntity(object,root);
  }
 else   if (object instanceof SingleResultQueryResult) {
    root.addAttributeNode("String_Node_Str");
    root.addSubNode("String_Node_Str");
    final SingleResultQueryResult singleResultQueryResult=(SingleResultQueryResult)object;
    replaceEntitiesWithLinks(singleResultQueryResult.getFields());
  }
 else   if (object instanceof ReadAllQueryResultCollection) {
    createNodeForPageableCollection((PageableCollection)object,root);
  }
 else {
    return null;
  }
  ObjectGraph objectGraph=context.getJAXBContext().createObjectGraph(object.getClass());
  fillObjectGraphFromNode(objectGraph,root,filter);
  return objectGraph;
}

Fixed version (ground truth):
/** 
 * Builds object graph for specified object using given filter.
 * @param object the object to build object graph for. Mandatory.
 * @param filter the filter (included or excluded fields) to use. Optional.
 * @return constructed object graph.
 */
public ObjectGraph createObjectGraph(Object object,FieldsFilter filter){
  final Node root=new Node();
  if (PersistenceWeavedRest.class.isAssignableFrom(object.getClass())) {
    createNodeForEntity(object,root);
  }
 else   if (object instanceof SingleResultQueryResult) {
    root.addAttributeNode("String_Node_Str");
    final SingleResultQueryResult singleResultQueryResult=(SingleResultQueryResult)object;
    processFieldsList(root.addSubNode("String_Node_Str"),singleResultQueryResult.getFields());
  }
 else   if (object instanceof ReadAllQueryResultCollection) {
    createNodeForPageableCollection((PageableCollection)object,root);
  }
 else {
    return null;
  }
  ObjectGraph objectGraph=context.getJAXBContext().createObjectGraph(object.getClass());
  fillObjectGraphFromNode(objectGraph,root,filter);
  return objectGraph;
}
Program: 63481
Project: 63481
Buggy source:
private void createNodeForPageableCollection(PageableCollection collection,Node node){
  node.addAttributeNode("String_Node_Str");
  node.addAttributeNode("String_Node_Str");
  node.addAttributeNode("String_Node_Str");
  node.addAttributeNode("String_Node_Str");
  node.addAttributeNode("String_Node_Str");
  if (collection.getItems() != null && !collection.getItems().isEmpty()) {
    final Node subNode=node.addSubNode("String_Node_Str");
    if (collection instanceof ReportQueryResultCollection) {
      subNode.addAttributeNode("String_Node_Str");
      final ReportQueryResultCollection reportQueryResultCollection=(ReportQueryResultCollection)collection;
      for (      ReportQueryResultListItem item : reportQueryResultCollection.getItems()) {
        replaceEntitiesWithLinks(item.getFields());
      }
    }
 else {
      createNodeForEntity(collection.getItems().get(0),subNode);
    }
  }
}

Fixed version (ground truth):
private void createNodeForPageableCollection(PageableCollection collection,Node node){
  node.addAttributeNode("String_Node_Str");
  node.addAttributeNode("String_Node_Str");
  node.addAttributeNode("String_Node_Str");
  node.addAttributeNode("String_Node_Str");
  node.addAttributeNode("String_Node_Str");
  if (collection.getItems() != null && !collection.getItems().isEmpty()) {
    final Node subNode=node.addSubNode("String_Node_Str");
    if (collection instanceof ReportQueryResultCollection) {
      final ReportQueryResultCollection reportQueryResultCollection=(ReportQueryResultCollection)collection;
      processFieldsList(subNode.addSubNode("String_Node_Str"),reportQueryResultCollection.getItems().get(0).getFields());
    }
 else {
      createNodeForEntity(collection.getItems().get(0),subNode);
    }
  }
}
Program: 63482
Project: 63482
Buggy source:
private void marshalSimpleValue(XPathFragment xmlRootFragment,MarshalRecord marshalRecord,Object originalValue,Object object,Object value,CoreAbstractSession session,NamespaceResolver namespaceResolver){
  QName qname=null;
  if (xmlRootFragment != null) {
    qname=((Root)originalValue).getSchemaType();
    setupFragment(((Root)originalValue),xmlRootFragment,marshalRecord);
    getXPathNode().startElement(marshalRecord,xmlRootFragment,object,session,namespaceResolver,null,null);
    updateNamespaces(qname,marshalRecord,null);
  }
  marshalRecord.characters(qname,value,null,false);
  if (xmlRootFragment != null) {
    marshalRecord.endElement(xmlRootFragment,namespaceResolver);
  }
}

Fixed version (ground truth):
private void marshalSimpleValue(XPathFragment xmlRootFragment,MarshalRecord marshalRecord,Object originalValue,Object object,Object value,CoreAbstractSession session,NamespaceResolver namespaceResolver){
  QName qname=null;
  if (xmlRootFragment != null) {
    qname=((Root)originalValue).getSchemaType();
    setupFragment(((Root)originalValue),xmlRootFragment,marshalRecord);
    CoreAttributeGroup group=marshalRecord.getCurrentAttributeGroup();
    CoreAttributeItem item=group.getItem(getMapping().getAttributeName());
    CoreAttributeGroup nestedGroup=XMLRecord.DEFAULT_ATTRIBUTE_GROUP;
    if (item != null) {
      if (item.getGroup() != null && null != xmlRootFragment.getLocalName()) {
        CoreAttributeItem nestedItem=item.getGroup().getItem(xmlRootFragment.getLocalName());
        if (null != nestedItem) {
          nestedGroup=item.getGroup();
        }
 else {
          return;
        }
      }
    }
    getXPathNode().startElement(marshalRecord,xmlRootFragment,object,session,namespaceResolver,null,null);
    updateNamespaces(qname,marshalRecord,null);
  }
  marshalRecord.characters(qname,value,null,false);
  if (xmlRootFragment != null) {
    marshalRecord.endElement(xmlRootFragment,namespaceResolver);
  }
}
Program: 63484
Project: 63484
Buggy source:
/** 
 * INTERNAL: Return the JDK version we are using.
 * @deprecated Use {@see JavaSEPlatform.current} instead.Will be removed in 2.7.
 */
public static int getJDKVersion(){
switch (JavaSEPlatform.CURRENT) {
case v1_7:
    JDK_VERSION=JDK_1_7;
  break;
case v1_8:
JDK_VERSION=JDK_1_8;
break;
case v1_9:
JDK_VERSION=JDK_1_9;
break;
default :
throw new IllegalStateException("String_Node_Str" + JavaSEPlatform.CURRENT.toString());
}
return JDK_VERSION;
}

Fixed version (ground truth):
/** 
 * INTERNAL: Return the JDK version we are using.
 * @deprecated Use {@code JavaSEPlatform.CURRENT} instead.Will be removed in 2.7.
 */
public static int getJDKVersion(){
switch (JavaSEPlatform.CURRENT) {
case v1_7:
    JDK_VERSION=JDK_1_7;
  break;
case v1_8:
JDK_VERSION=JDK_1_8;
break;
case v1_9:
JDK_VERSION=JDK_1_9;
break;
default :
throw new IllegalStateException("String_Node_Str" + JavaSEPlatform.CURRENT.toString());
}
return JDK_VERSION;
}
Program: 63485
Project: 63485
Buggy source:
/** 
 * Set 1.5 as current Java SE version.
 * @throws UnsupportedOperationException when invoked because Java SE 1.5is not supported by current EclipseLink.
 * @deprecated Use {@see JavaSEPlatform} instead. Will be removed in 2.7.
 */
public static void useJDK15(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Set 1.5 as current Java SE version.
 * @throws UnsupportedOperationException when invoked because Java SE 1.5is not supported by current EclipseLink.
 * @deprecated Use {@link JavaSEPlatform} instead. Will be removed in 2.7.
 */
public static void useJDK15(){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 63486
Project: 63486
Buggy source:
/** 
 * Set 1.6 as current Java SE version.
 * @throws UnsupportedOperationException when invoked because Java SE 1.6is not supported by current EclipseLink.
 * @deprecated Use {@see JavaSEPlatform} instead. Will be removed in 2.7.
 */
public static void useJDK16(){
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Set 1.6 as current Java SE version.
 * @throws UnsupportedOperationException when invoked because Java SE 1.6is not supported by current EclipseLink.
 * @deprecated Use {@link JavaSEPlatform} instead. Will be removed in 2.7.
 */
public static void useJDK16(){
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 63487
Project: 63487
Buggy source:
/** 
 * Returns version   {@see String} containing three part version numberand build qualifier.
 * @return Version {@see String}.
 */
public static String getVersionString(){
  StringBuilder sb=new StringBuilder(version.length() + 1 + qualifier.length());
  sb.append(version);
  sb.append(SEPARATOR);
  sb.append(qualifier);
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Returns version   {@link String} containing three part version numberand build qualifier.
 * @return Version {@link String}.
 */
public static String getVersionString(){
  StringBuilder sb=new StringBuilder(version.length() + 1 + qualifier.length());
  sb.append(version);
  sb.append(SEPARATOR);
  sb.append(qualifier);
  return sb.toString();
}
Program: 63488
Project: 63488
Buggy source:
@Override protected Object instantiate() throws DatabaseException {
  if (this.session == null) {
    throw ValidationException.instantiatingValueholderWithNullSession();
  }
  Integer refreshCascade=null;
  if (wrappedValueHolder instanceof QueryBasedValueHolder) {
    refreshCascade=((QueryBasedValueHolder)getWrappedValueHolder()).getRefreshCascadePolicy();
  }
  return mapping.buildCloneForPartObject(this.wrappedValueHolder.getValue(),null,null,null,this.session,refreshCascade,true,true);
}

Fixed version (ground truth):
@Override protected Object instantiate() throws DatabaseException {
  if (this.session == null) {
    throw ValidationException.instantiatingValueholderWithNullSession();
  }
  Integer refreshCascade=null;
  if (wrappedValueHolder instanceof QueryBasedValueHolder) {
    refreshCascade=((QueryBasedValueHolder)getWrappedValueHolder()).getRefreshCascadePolicy();
  }
  Object clone=mapping.buildCloneForPartObject(this.wrappedValueHolder.getValue(),null,null,null,this.session,refreshCascade,true,true);
  if (wrappedValueHolder.isInstantiated() && refreshCascade != null) {
    ((QueryBasedValueHolder)getWrappedValueHolder()).setRefreshCascadePolicy(null);
  }
  return clone;
}
Program: 63489
Project: 63489
Buggy source:
/** 
 * Clone the original attribute value.
 */
public Object buildCloneFor(Object originalAttributeValue){
  Integer refreshCascade=null;
  if (wrappedValueHolder instanceof QueryBasedValueHolder) {
    refreshCascade=((QueryBasedValueHolder)getWrappedValueHolder()).getRefreshCascadePolicy();
  }
  return this.mapping.buildCloneForPartObject(originalAttributeValue,null,null,this.relationshipSourceObject,getUnitOfWork(),refreshCascade,true,true);
}

Fixed version (ground truth):
/** 
 * Clone the original attribute value.
 */
public Object buildCloneFor(Object originalAttributeValue){
  Integer refreshCascade=null;
  if (wrappedValueHolder instanceof QueryBasedValueHolder) {
    refreshCascade=((QueryBasedValueHolder)getWrappedValueHolder()).getRefreshCascadePolicy();
  }
  Object clone=this.mapping.buildCloneForPartObject(originalAttributeValue,null,null,this.relationshipSourceObject,getUnitOfWork(),refreshCascade,true,true);
  if (wrappedValueHolder.isInstantiated() && refreshCascade != null) {
    ((QueryBasedValueHolder)getWrappedValueHolder()).setRefreshCascadePolicy(null);
  }
  return clone;
}
Program: 63492
Project: 63492
Buggy source:
/** 
 * INTERNAL:
 * @param session               typically will be a unit of work
 * @param userSpecifiedResolver a user-provided subclass of IDResolver, may be null
 */
public final void resolveReferences(final CoreAbstractSession session,final IDResolver userSpecifiedResolver,final ErrorHandler handler){
}

Fixed version (ground truth):
/** 
 * INTERNAL:
 * @param session               typically will be a unit of work
 * @param userSpecifiedResolver a user-provided subclass of IDResolver, may be null
 */
public final void resolveReferences(final CoreAbstractSession session,final IDResolver userSpecifiedResolver,final ErrorHandler handler){
  final Collection<Reference> luckyReferences=referencesMap.values();
  final Iterator<Reference> itLucky=luckyReferences.iterator();
  final Iterator<Reference> itUnlucky=unluckyReferences.iterator();
  Integer lastValue=unluckyRefPositions.peekLast();
  boolean[] a;
  if (lastValue == null) {
    lastValue=-1;
    a=new boolean[1];
  }
 else {
    a=new boolean[lastValue + 1];
    for (    final Integer integer : unluckyRefPositions) {
      a[integer]=true;
    }
  }
  for (int i=0, totalLength=luckyReferences.size() + unluckyReferences.size(); i < totalLength; i++) {
    final Reference reference;
    if (i <= lastValue && a[i]) {
      reference=itUnlucky.next();
    }
 else {
      reference=itLucky.next();
    }
    perform(session,userSpecifiedResolver,handler,reference);
  }
  resetContainers();
}