nus-yam/ex-repair huggingface dataset:
Program: 63248
Project: 63248
Buggy source:
@Test public void testComplexJPQLIN(){
  EntityManager em=emf.createEntityManager();
  Query q=em.createQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  q.getResultList();
  if (em.isOpen()) {
    em.clear();
    em.close();
  }
}

Fixed version (ground truth):
@Test public void testComplexJPQLIN(){
  if (getPlatform(emf) instanceof DerbyPlatform) {
    Assert.assertTrue("String_Node_Str" + "String_Node_Str",true);
    return;
  }
  EntityManager em=emf.createEntityManager();
  Query q=em.createQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str");
  q.getResultList();
  if (em.isOpen()) {
    em.clear();
    em.close();
  }
}
Program: 63251
Project: 63251
Buggy source:
public void testQueryPESSIMISTIC_READLock(){
  if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
    return;
  }
  if (!isOnServer() && isSelectForUpateSupported()) {
    EntityManager em=createEntityManager();
    PessimisticLockException pessimisticLockException=null;
    try {
      beginTransaction(em);
      EntityManager em2=createEntityManager();
      try {
        beginTransaction(em2);
        List employees2=em2.createQuery("String_Node_Str").getResultList();
        Employee employee2=(Employee)employees2.get(0);
        List employees=em.createQuery("String_Node_Str").setLockMode(LockModeType.PESSIMISTIC_READ).getResultList();
        Employee employee=(Employee)employees.get(0);
        employee.setFirstName("String_Node_Str");
        HashMap properties=new HashMap();
        properties.put(QueryHints.PESSIMISTIC_LOCK_TIMEOUT,0);
        em2.lock(employee2,LockModeType.PESSIMISTIC_READ,properties);
        employee2.setFirstName("String_Node_Str");
        commitTransaction(em2);
      }
 catch (      javax.persistence.PessimisticLockException ex) {
        pessimisticLockException=ex;
      }
 finally {
        closeEntityManagerAndTransaction(em2);
      }
      commitTransaction(em);
    }
 catch (    RuntimeException ex) {
      if (isTransactionActive(em)) {
        rollbackTransaction(em);
      }
      throw ex;
    }
 finally {
      closeEntityManager(em);
    }
    assertFalse("String_Node_Str",pessimisticLockException == null);
  }
}

Fixed version (ground truth):
public void testQueryPESSIMISTIC_READLock(){
  if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
    return;
  }
  if (!isOnServer() && isSelectForUpateSupported()) {
    EntityManager em=createEntityManager();
    PessimisticLockException pessimisticLockException=null;
    try {
      beginTransaction(em);
      EntityManager em2=createEntityManager();
      try {
        beginTransaction(em2);
        List employees2=em2.createQuery("String_Node_Str").getResultList();
        Employee employee2=(Employee)employees2.get(0);
        List employees=em.createQuery("String_Node_Str").setLockMode(LockModeType.PESSIMISTIC_READ).getResultList();
        Employee employee=(Employee)employees.get(0);
        employee.setFirstName("String_Node_Str");
        em2.lock(employee2,LockModeType.PESSIMISTIC_READ);
        employee2.setFirstName("String_Node_Str");
        commitTransaction(em2);
      }
 catch (      javax.persistence.PessimisticLockException ex) {
        pessimisticLockException=ex;
      }
 finally {
        closeEntityManagerAndTransaction(em2);
      }
      commitTransaction(em);
    }
 catch (    RuntimeException ex) {
      if (isTransactionActive(em)) {
        rollbackTransaction(em);
      }
      throw ex;
    }
 finally {
      closeEntityManager(em);
    }
    assertFalse("String_Node_Str",pessimisticLockException == null);
  }
}
Program: 63252
Project: 63252
Buggy source:
public void testQueryPESSIMISTIC_WRITELock(){
  if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
    return;
  }
  if (!isOnServer() && isSelectForUpateSupported()) {
    EntityManager em=createEntityManager();
    Exception pessimisticLockException=null;
    try {
      beginTransaction(em);
      EntityManager em2=createEntityManager();
      try {
        beginTransaction(em2);
        List employees2=em2.createQuery("String_Node_Str").getResultList();
        Employee employee2=(Employee)employees2.get(0);
        List employees=em.createQuery("String_Node_Str").setLockMode(LockModeType.PESSIMISTIC_READ).getResultList();
        Employee employee=(Employee)employees.get(0);
        employee.setFirstName("String_Node_Str");
        HashMap properties=new HashMap();
        properties.put(QueryHints.PESSIMISTIC_LOCK_TIMEOUT,0);
        em2.lock(employee2,LockModeType.PESSIMISTIC_READ,properties);
        employee2.setFirstName("String_Node_Str");
        commitTransaction(em2);
      }
 catch (      javax.persistence.PessimisticLockException ex) {
        pessimisticLockException=ex;
      }
 finally {
        closeEntityManagerAndTransaction(em2);
      }
      commitTransaction(em);
    }
 catch (    RuntimeException ex) {
      if (isTransactionActive(em)) {
        rollbackTransaction(em);
      }
      throw ex;
    }
 finally {
      closeEntityManager(em);
    }
    assertFalse("String_Node_Str",pessimisticLockException == null);
  }
}

Fixed version (ground truth):
public void testQueryPESSIMISTIC_WRITELock(){
  if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
    return;
  }
  if (!isOnServer() && isSelectForUpateSupported()) {
    EntityManager em=createEntityManager();
    Exception pessimisticLockException=null;
    try {
      beginTransaction(em);
      EntityManager em2=createEntityManager();
      try {
        beginTransaction(em2);
        List employees2=em2.createQuery("String_Node_Str").getResultList();
        Employee employee2=(Employee)employees2.get(0);
        List employees=em.createQuery("String_Node_Str").setLockMode(LockModeType.PESSIMISTIC_READ).getResultList();
        Employee employee=(Employee)employees.get(0);
        employee.setFirstName("String_Node_Str");
        em2.lock(employee2,LockModeType.PESSIMISTIC_READ);
        employee2.setFirstName("String_Node_Str");
        commitTransaction(em2);
      }
 catch (      javax.persistence.PessimisticLockException ex) {
        pessimisticLockException=ex;
      }
 finally {
        closeEntityManagerAndTransaction(em2);
      }
      commitTransaction(em);
    }
 catch (    RuntimeException ex) {
      if (isTransactionActive(em)) {
        rollbackTransaction(em);
      }
      throw ex;
    }
 finally {
      closeEntityManager(em);
    }
    assertFalse("String_Node_Str",pessimisticLockException == null);
  }
}
Program: 63253
Project: 63253
Buggy source:
public void testLockWithSecondaryTable(){
  if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
    return;
  }
  if (!isOnServer() && isSelectForUpateSupported()) {
    EntityManager em=createEntityManager();
    Exception pessimisticLockException=null;
    try {
      beginTransaction(em);
      EntityManager em2=createEntityManager();
      try {
        beginTransaction(em2);
        List employees2=em2.createQuery("String_Node_Str").getResultList();
        Employee employee2=(Employee)employees2.get(0);
        List employees=em.createQuery("String_Node_Str").setLockMode(LockModeType.PESSIMISTIC_WRITE).getResultList();
        Employee employee=(Employee)employees.get(0);
        employee.setSalary(90000);
        HashMap properties=new HashMap();
        properties.put(QueryHints.PESSIMISTIC_LOCK_TIMEOUT,0);
        em2.lock(employee2,LockModeType.PESSIMISTIC_WRITE,properties);
        employee2.setSalary(100000);
        commitTransaction(em2);
      }
 catch (      PessimisticLockException ex) {
        pessimisticLockException=ex;
      }
 finally {
        closeEntityManagerAndTransaction(em2);
      }
      commitTransaction(em);
    }
 catch (    RuntimeException ex) {
      if (isTransactionActive(em)) {
        rollbackTransaction(em);
      }
      throw ex;
    }
 finally {
      closeEntityManager(em);
    }
    assertFalse("String_Node_Str",pessimisticLockException == null);
  }
}

Fixed version (ground truth):
public void testLockWithSecondaryTable(){
  if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
    return;
  }
  if (!isOnServer() && isSelectForUpateSupported()) {
    EntityManager em=createEntityManager();
    Exception pessimisticLockException=null;
    try {
      beginTransaction(em);
      EntityManager em2=createEntityManager();
      try {
        beginTransaction(em2);
        List employees2=em2.createQuery("String_Node_Str").getResultList();
        Employee employee2=(Employee)employees2.get(0);
        List employees=em.createQuery("String_Node_Str").setLockMode(LockModeType.PESSIMISTIC_WRITE).getResultList();
        Employee employee=(Employee)employees.get(0);
        employee.setSalary(90000);
        em2.lock(employee2,LockModeType.PESSIMISTIC_WRITE);
        employee2.setSalary(100000);
        commitTransaction(em2);
      }
 catch (      PessimisticLockException ex) {
        pessimisticLockException=ex;
      }
 finally {
        closeEntityManagerAndTransaction(em2);
      }
      commitTransaction(em);
    }
 catch (    RuntimeException ex) {
      if (isTransactionActive(em)) {
        rollbackTransaction(em);
      }
      throw ex;
    }
 finally {
      closeEntityManager(em);
    }
    assertFalse("String_Node_Str",pessimisticLockException == null);
  }
}
Program: 63255
Project: 63255
Buggy source:
/** 
 * Tests an execute update on a named stored procedure that does a select. NamedStoredProcedure defines a result class.
 */
public void testQueryExecuteOnStoredProcQueryBuiltFromJPAThatDoesNothing(){
  if (supportsStoredProcedures() && getPlatform().isMySQL()) {
    EntityManager em=createEntityManager();
    try {
      getServerSession(getPersistenceUnitName()).executeQuery(((StoredProcedureQueryImpl)em.createNamedStoredProcedureQuery("String_Node_Str")).getDatabaseQuery());
    }
 catch (    Exception e) {
      if (isTransactionActive(em)) {
        rollbackTransaction(em);
      }
      fail("String_Node_Str" + e);
    }
 finally {
      closeEntityManager(em);
    }
  }
}

Fixed version (ground truth):
/** 
 * Tests an execute update on a named stored procedure that does a select. NamedStoredProcedure defines a result class.
 */
public void testQueryExecuteOnStoredProcQueryBuiltFromJPAThatDoesNothing(){
  if (supportsStoredProcedures() && getPlatform().isMySQL()) {
    EntityManager em=createEntityManager();
    try {
      getServerSession(getPersistenceUnitName()).executeQuery(em.createNamedStoredProcedureQuery("String_Node_Str").unwrap(StoredProcedureQueryImpl.class).getDatabaseQuery());
    }
 catch (    Exception e) {
      if (isTransactionActive(em)) {
        rollbackTransaction(em);
      }
      fail("String_Node_Str" + e);
    }
 finally {
      closeEntityManager(em);
    }
  }
}
Program: 63257
Project: 63257
Buggy source:
/** 
 * Tests an execute update on a named stored procedure that does a select. NamedStoredProcedure defines a result class.
 */
public void testQueryExecuteOnStoredProcQueryBuiltFromJPAThatDoesNothing(){
  if (supportsStoredProcedures() && getPlatform().isMySQL()) {
    EntityManager em=createEntityManager();
    try {
      getServerSession(getPersistenceUnitName()).executeQuery(((StoredProcedureQueryImpl)em.createNamedStoredProcedureQuery("String_Node_Str")).getDatabaseQuery());
    }
 catch (    Exception e) {
      if (isTransactionActive(em)) {
        rollbackTransaction(em);
      }
      fail("String_Node_Str" + e);
    }
 finally {
      closeEntityManager(em);
    }
  }
}

Fixed version (ground truth):
/** 
 * Tests an execute update on a named stored procedure that does a select. NamedStoredProcedure defines a result class.
 */
public void testQueryExecuteOnStoredProcQueryBuiltFromJPAThatDoesNothing(){
  if (supportsStoredProcedures() && getPlatform().isMySQL()) {
    EntityManager em=createEntityManager();
    try {
      getServerSession(getPersistenceUnitName()).executeQuery(em.createNamedStoredProcedureQuery("String_Node_Str").unwrap(StoredProcedureQueryImpl.class).getDatabaseQuery());
    }
 catch (    Exception e) {
      if (isTransactionActive(em)) {
        rollbackTransaction(em);
      }
      fail("String_Node_Str" + e);
    }
 finally {
      closeEntityManager(em);
    }
  }
}
Program: 63260
Project: 63260
Buggy source:
public void testGetPersistenceUnitUtilOnCloseEMF(){
  EntityManagerFactory emf=getEntityManagerFactory();
  closeEntityManagerFactory();
  try {
    emf.getPersistenceUnitUtil();
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
}

Fixed version (ground truth):
public void testGetPersistenceUnitUtilOnCloseEMF(){
  EntityManagerFactory emf=getEntityManagerFactory();
  emf.close();
  try {
    emf.getPersistenceUnitUtil();
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
}
Program: 63261
Project: 63261
Buggy source:
public static Test suite(){
  TestSuite fullSuite=new TestSuite();
  fullSuite.setName("String_Node_Str");
  fullSuite.addTest(StoredProcedureQueryTestSuite.suite());
  fullSuite.addTest(ConverterTestSuite.suite());
  fullSuite.addTest(CriteriaQueryTestSuite.suite());
  fullSuite.addTest(CriteriaQueryMetamodelTestSuite.suite());
  fullSuite.addTest(DDLTestSuite.suite());
  fullSuite.addTest(ForeignKeyTestSuite.suite());
  fullSuite.addTest(IndexTestSuite.suite());
  fullSuite.addTest(EntityManagerFactoryTestSuite.suite());
  fullSuite.addTest(EntityGraphTestSuite.suite());
  fullSuite.addTest(QueryTestSuite.suite());
  fullSuite.addTest(EntityManagerTestSuite.suite());
  fullSuite.addTest(XMLNamedStoredProcedureQueryTestSuite.suite());
  fullSuite.addTest(XMLConverterTestSuite.suite());
  fullSuite.addTest(XMLForeignKeyTestSuite.suite());
  fullSuite.addTest(XMLIndexTestSuite.suite());
  fullSuite.addTest(XMLEntityGraphTestSuite.suite());
  fullSuite.addTest(WeaverTestSuite.suite());
  return fullSuite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite fullSuite=new TestSuite();
  fullSuite.setName("String_Node_Str");
  fullSuite.addTest(StoredProcedureQueryTestSuite.suite());
  fullSuite.addTest(ConverterTestSuite.suite());
  fullSuite.addTest(CriteriaQueryTestSuite.suite());
  fullSuite.addTest(CriteriaQueryMetamodelTestSuite.suite());
  fullSuite.addTest(DDLTestSuite.suite());
  fullSuite.addTest(ForeignKeyTestSuite.suite());
  fullSuite.addTest(IndexTestSuite.suite());
  fullSuite.addTest(EntityGraphTestSuite.suite());
  fullSuite.addTest(QueryTestSuite.suite());
  fullSuite.addTest(EntityManagerTestSuite.suite());
  fullSuite.addTest(XMLNamedStoredProcedureQueryTestSuite.suite());
  fullSuite.addTest(XMLConverterTestSuite.suite());
  fullSuite.addTest(XMLForeignKeyTestSuite.suite());
  fullSuite.addTest(XMLIndexTestSuite.suite());
  fullSuite.addTest(XMLEntityGraphTestSuite.suite());
  fullSuite.addTest(WeaverTestSuite.suite());
  fullSuite.addTest(EntityManagerFactoryTestSuite.suite());
  return fullSuite;
}
Program: 63262
Project: 63262
Buggy source:
public void testGetPersistenceUnitUtilOnCloseEMF(){
  EntityManagerFactory emf=getEntityManagerFactory();
  closeEntityManagerFactory();
  try {
    emf.getPersistenceUnitUtil();
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
}

Fixed version (ground truth):
public void testGetPersistenceUnitUtilOnCloseEMF(){
  EntityManagerFactory emf=getEntityManagerFactory();
  emf.close();
  try {
    emf.getPersistenceUnitUtil();
    fail("String_Node_Str");
  }
 catch (  IllegalStateException e) {
  }
}
Program: 63263
Project: 63263
Buggy source:
public static Test suite(){
  TestSuite fullSuite=new TestSuite();
  fullSuite.setName("String_Node_Str");
  fullSuite.addTest(StoredProcedureQueryTestSuite.suite());
  fullSuite.addTest(ConverterTestSuite.suite());
  fullSuite.addTest(CriteriaQueryTestSuite.suite());
  fullSuite.addTest(CriteriaQueryMetamodelTestSuite.suite());
  fullSuite.addTest(DDLTestSuite.suite());
  fullSuite.addTest(ForeignKeyTestSuite.suite());
  fullSuite.addTest(IndexTestSuite.suite());
  fullSuite.addTest(EntityManagerFactoryTestSuite.suite());
  fullSuite.addTest(EntityGraphTestSuite.suite());
  fullSuite.addTest(QueryTestSuite.suite());
  fullSuite.addTest(EntityManagerTestSuite.suite());
  fullSuite.addTest(XMLNamedStoredProcedureQueryTestSuite.suite());
  fullSuite.addTest(XMLConverterTestSuite.suite());
  fullSuite.addTest(XMLForeignKeyTestSuite.suite());
  fullSuite.addTest(XMLIndexTestSuite.suite());
  fullSuite.addTest(XMLEntityGraphTestSuite.suite());
  fullSuite.addTest(AnnotationsTestSuite.suite());
  fullSuite.addTest(MetadataASMFactoryTest.suite());
  return fullSuite;
}

Fixed version (ground truth):
public static Test suite(){
  TestSuite fullSuite=new TestSuite();
  fullSuite.setName("String_Node_Str");
  fullSuite.addTest(StoredProcedureQueryTestSuite.suite());
  fullSuite.addTest(ConverterTestSuite.suite());
  fullSuite.addTest(CriteriaQueryTestSuite.suite());
  fullSuite.addTest(CriteriaQueryMetamodelTestSuite.suite());
  fullSuite.addTest(DDLTestSuite.suite());
  fullSuite.addTest(ForeignKeyTestSuite.suite());
  fullSuite.addTest(IndexTestSuite.suite());
  fullSuite.addTest(EntityGraphTestSuite.suite());
  fullSuite.addTest(QueryTestSuite.suite());
  fullSuite.addTest(EntityManagerTestSuite.suite());
  fullSuite.addTest(XMLNamedStoredProcedureQueryTestSuite.suite());
  fullSuite.addTest(XMLConverterTestSuite.suite());
  fullSuite.addTest(XMLForeignKeyTestSuite.suite());
  fullSuite.addTest(XMLIndexTestSuite.suite());
  fullSuite.addTest(XMLEntityGraphTestSuite.suite());
  fullSuite.addTest(AnnotationsTestSuite.suite());
  fullSuite.addTest(MetadataASMFactoryTest.suite());
  fullSuite.addTest(EntityManagerFactoryTestSuite.suite());
  return fullSuite;
}
Program: 63264
Project: 63264
Buggy source:
public int compile(String classpath,Object[] javaFiles){
  int jv=JavaSEPlatform.CURRENT.getMajor();
  final String javaVersion="String_Node_Str" + jv;
  final String[] args=new String[javaFiles.length + ((jv >= 9) ? 9 : 7)];
  final String javac=getJavaC();
  args[0]=javac;
  args[1]="String_Node_Str";
  args[2]=classpath;
  args[3]="String_Node_Str";
  args[4]=javaVersion;
  args[5]="String_Node_Str";
  args[6]=javaVersion;
  if ("String_Node_Str".equals(javaVersion)) {
    args[7]="String_Node_Str";
    args[8]="String_Node_Str";
    System.arraycopy(javaFiles,0,args,9,javaFiles.length);
  }
 else {
    System.arraycopy(javaFiles,0,args,7,javaFiles.length);
  }
  int exitVal=-1;
  try {
    Process proc=Runtime.getRuntime().exec(args);
    InputStream stderr=proc.getErrorStream();
    InputStreamReader isr=new InputStreamReader(stderr);
    BufferedReader br=new BufferedReader(isr);
    String line=br.readLine();
    if (line != null) {
      System.out.println("String_Node_Str");
      while (line != null) {
        System.out.println(line);
        if ((line=br.readLine()) == null) {
          System.out.println("String_Node_Str");
        }
      }
    }
    exitVal=proc.waitFor();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return exitVal;
}

Fixed version (ground truth):
public int compile(String classpath,Object[] javaFiles){
  int jv=JavaSEPlatform.CURRENT.getMajor();
  final String javaVersion="String_Node_Str" + ((jv >= 9) ? jv : JavaSEPlatform.CURRENT.toString());
  final String[] args=new String[javaFiles.length + ((jv >= 9) ? 9 : 7)];
  final String javac=getJavaC();
  args[0]=javac;
  args[1]="String_Node_Str";
  args[2]=classpath;
  args[3]="String_Node_Str";
  args[4]=javaVersion;
  args[5]="String_Node_Str";
  args[6]=javaVersion;
  if (9 >= jv) {
    args[7]="String_Node_Str";
    args[8]="String_Node_Str";
    System.arraycopy(javaFiles,0,args,9,javaFiles.length);
  }
 else {
    System.arraycopy(javaFiles,0,args,7,javaFiles.length);
  }
  int exitVal=-1;
  try {
    Process proc=Runtime.getRuntime().exec(args);
    InputStream stderr=proc.getErrorStream();
    InputStreamReader isr=new InputStreamReader(stderr);
    BufferedReader br=new BufferedReader(isr);
    String line=br.readLine();
    if (line != null) {
      System.out.println("String_Node_Str");
      while (line != null) {
        System.out.println(line);
        if ((line=br.readLine()) == null) {
          System.out.println("String_Node_Str");
        }
      }
    }
    exitVal=proc.waitFor();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return exitVal;
}
Program: 63265
Project: 63265
Buggy source:
/** 
 * Check whether current Java SE is at least (greater or equal) provided platform.
 * @param platform Java SE platform to compare with.
 */
public static boolean atLeast(JavaSEPlatform platform){
  return CURRENT.atLeast(platform);
}

Fixed version (ground truth):
/** 
 * Check whether current Java SE is at least (greater or equal) provided platform.
 * @param platform Java SE platform to compare with.
 */
public static boolean atLeast(JavaSEPlatform platform){
  return CURRENT.gte(platform);
}
Program: 63266
Project: 63266
Buggy source:
public int compile(String classpath,Object[] javaFiles){
  final String[] args=new String[javaFiles.length + 7];
  final String javac=getJavaC();
  final String javaVersion=JavaSEPlatform.CURRENT.toString();
  args[0]=javac;
  args[1]="String_Node_Str";
  args[2]=classpath;
  args[3]="String_Node_Str";
  args[4]=javaVersion;
  args[5]="String_Node_Str";
  args[6]=javaVersion;
  System.arraycopy(javaFiles,0,args,7,javaFiles.length);
  int exitVal=-1;
  try {
    Process proc=Runtime.getRuntime().exec(args);
    InputStream stderr=proc.getErrorStream();
    InputStreamReader isr=new InputStreamReader(stderr);
    BufferedReader br=new BufferedReader(isr);
    String line=br.readLine();
    if (line != null) {
      System.out.println("String_Node_Str");
      while (line != null) {
        System.out.println(line);
        if ((line=br.readLine()) == null) {
          System.out.println("String_Node_Str");
        }
      }
    }
    exitVal=proc.waitFor();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return exitVal;
}

Fixed version (ground truth):
public int compile(String classpath,Object[] javaFiles){
  int jv=JavaSEPlatform.CURRENT.getMajor();
  final String javaVersion="String_Node_Str" + jv;
  final String[] args=new String[javaFiles.length + ((jv >= 9) ? 9 : 7)];
  final String javac=getJavaC();
  args[0]=javac;
  args[1]="String_Node_Str";
  args[2]=classpath;
  args[3]="String_Node_Str";
  args[4]=javaVersion;
  args[5]="String_Node_Str";
  args[6]=javaVersion;
  if ("String_Node_Str".equals(javaVersion)) {
    args[7]="String_Node_Str";
    args[8]="String_Node_Str";
    System.arraycopy(javaFiles,0,args,9,javaFiles.length);
  }
 else {
    System.arraycopy(javaFiles,0,args,7,javaFiles.length);
  }
  int exitVal=-1;
  try {
    Process proc=Runtime.getRuntime().exec(args);
    InputStream stderr=proc.getErrorStream();
    InputStreamReader isr=new InputStreamReader(stderr);
    BufferedReader br=new BufferedReader(isr);
    String line=br.readLine();
    if (line != null) {
      System.out.println("String_Node_Str");
      while (line != null) {
        System.out.println(line);
        if ((line=br.readLine()) == null) {
          System.out.println("String_Node_Str");
        }
      }
    }
    exitVal=proc.waitFor();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return exitVal;
}
Program: 63267
Project: 63267
Buggy source:
/** 
 * Invoke static method of the specified class.
 * @param name Method name.
 * @param c Class containing method to invoke.
 * @param parameterTypes Method parameter array.
 * @param args An array of objects to be passed as arguments to the method call
 * @throws InvocationTargetException If the underlying constructor throws an exception.
 * @throws IllegalArgumentException  If an unwrapping conversion fails.
 * @throws IllegalAccessException    If the underlying field is either inaccessible or final.
 * @throws SecurityException         If a security manager is present and access to the field was denied.
 * @throws NoSuchMethodException     If a field with the specified name is not found.
 */
public static final Object invokeStaticMethod(final String name,final Class c,final Class<?>[] parameterTypes,final Object... args) throws ReflectiveOperationException {
  Method m=c.getDeclaredMethod(name,parameterTypes);
  boolean accessible=m.isAccessible();
  if (!accessible) {
    m.setAccessible(true);
  }
  Object result=m.invoke(null,args);
  if (!accessible) {
    m.setAccessible(accessible);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Invoke static method of the specified class.
 * @param name Method name.
 * @param c Class containing method to invoke.
 * @param parameterTypes Method parameter array.
 * @param returnType Class to be returned.
 * @param args An array of objects to be passed as arguments to the method call
 * @throws InvocationTargetException If the underlying constructor throws an exception.
 * @throws IllegalArgumentException  If an unwrapping conversion fails.
 * @throws IllegalAccessException    If the underlying field is either inaccessible or final.
 * @throws SecurityException         If a security manager is present and access to the field was denied.
 * @throws NoSuchMethodException     If a field with the specified name is not found.
 */
public static final <T>T invokeStaticMethod(final String name,final Class c,final Class<?>[] parameterTypes,final Class<T> returnType,final Object... args) throws ReflectiveOperationException {
  return returnType.cast(invokeStaticMethod(name,c,parameterTypes,args));
}
Program: 63268
Project: 63268
Buggy source:
/** 
 * Invoke a method of the specified class instance.
 * @param name Method name.
 * @param obj Class instance containing method to invoke.
 * @param parameterTypes Method parameter array.
 * @param args An array of objects to be passed as arguments to the method call
 * @throws InvocationTargetException If the underlying constructor throws an exception.
 * @throws IllegalArgumentException  If an unwrapping conversion fails.
 * @throws IllegalAccessException    If the underlying field is either inaccessible or final.
 * @throws SecurityException         If a security manager is present and access to the field was denied.
 * @throws NoSuchMethodException     If a field with the specified name is not found.
 */
public static final Object invokeMethod(final String name,final Object obj,final Class<?>[] parameterTypes,final Object... args) throws ReflectiveOperationException {
  Method m=obj.getClass().getDeclaredMethod(name,parameterTypes);
  boolean accessible=m.isAccessible();
  if (!accessible) {
    m.setAccessible(true);
  }
  Object result=m.invoke(obj,args);
  if (!accessible) {
    m.setAccessible(accessible);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Invoke a method of the specified class instance.
 * @param name Method name.
 * @param obj Class instance containing method to invoke.
 * @param parameterTypes Method parameter array.
 * @param returnType Class to be returned.
 * @param args An array of objects to be passed as arguments to the method call
 * @throws InvocationTargetException If the underlying constructor throws an exception.
 * @throws IllegalArgumentException  If an unwrapping conversion fails.
 * @throws IllegalAccessException    If the underlying field is either inaccessible or final.
 * @throws SecurityException         If a security manager is present and access to the field was denied.
 * @throws NoSuchMethodException     If a field with the specified name is not found.
 */
public static final <T>T invokeMethod(final String name,final Object obj,final Class<?>[] parameterTypes,final Class<T> returnType,final Object... args) throws ReflectiveOperationException {
  return returnType.cast(invokeMethod(name,obj,parameterTypes,args));
}
Program: 63269
Project: 63269
Buggy source:
public static TestSuite getDataTypeComparisonTestSuite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.setDescription("String_Node_Str");
  suite.addTestSuite(org.eclipse.persistence.testing.tests.helper.JavaUtilTest.class);
  suite.addTest(new CompareArrayContentTest());
  suite.addTest(new CompareArrayLengthTest());
  suite.addTest(new CompareCharArrayLengthTest());
  suite.addTest(new CompareCharArrayContentTest());
  suite.addTest(new CheckAreVectorTypesAssignableWithNullVectorTest());
  suite.addTest(new CheckAreVectorTypesAssignableTest());
  suite.addTest(new CheckCompareByteArraysWithDifferentElementsTest());
  suite.addTest(new CheckCompareBigDecimalsTest());
  suite.addTest(new CheckClassIsSubclassWithNullSuperclassTest());
  suite.addTest(new BasicTest());
  suite.addTest(new TimeFromDateTest());
  suite.addTest(new TimeFromLongTest());
  suite.addTest(new TimeFromStringTest());
  suite.addTest(new TimestampFromDateTest());
  suite.addTest(new TimestampFromLongTest());
  suite.addTest(new TimestampFromStringTest());
  return suite;
}

Fixed version (ground truth):
public static TestSuite getDataTypeComparisonTestSuite(){
  TestSuite suite=new TestSuite();
  suite.setName("String_Node_Str");
  suite.setDescription("String_Node_Str");
  suite.addTestSuite(org.eclipse.persistence.testing.tests.helper.JavaUtilTest.class);
  suite.addTestSuite(org.eclipse.persistence.testing.tests.helper.JavaVersionTest.class);
  suite.addTest(new CompareArrayContentTest());
  suite.addTest(new CompareArrayLengthTest());
  suite.addTest(new CompareCharArrayLengthTest());
  suite.addTest(new CompareCharArrayContentTest());
  suite.addTest(new CheckAreVectorTypesAssignableWithNullVectorTest());
  suite.addTest(new CheckAreVectorTypesAssignableTest());
  suite.addTest(new CheckCompareByteArraysWithDifferentElementsTest());
  suite.addTest(new CheckCompareBigDecimalsTest());
  suite.addTest(new CheckClassIsSubclassWithNullSuperclassTest());
  suite.addTest(new BasicTest());
  suite.addTest(new TimeFromDateTest());
  suite.addTest(new TimeFromLongTest());
  suite.addTest(new TimeFromStringTest());
  suite.addTest(new TimestampFromDateTest());
  suite.addTest(new TimestampFromLongTest());
  suite.addTest(new TimestampFromStringTest());
  return suite;
}
Program: 63270
Project: 63270
Buggy source:
/** 
 * Test major and minor version numbers pairs to <code>JavaSEPlatform</code> conversion.
 */
@Test public void testMajorMinorToPlatform(){
  int[][] valid={{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{9,0}};
  int[][] invalid={{0,0},{0,1},{0,3},{0,5},{0,7},{0,9},{1,0},{2,0},{2,1},{2,2},{3,0},{4,0},{1,10}};
  for (  int[] version : valid) {
    int major=version[0];
    int minor=version[1];
    JavaSEPlatform platform=JavaSEPlatform.toValue(major,minor);
    assertNotNull("String_Node_Str" + "String_Node_Str",platform);
    assertTrue("String_Node_Str" + "String_Node_Str",major == platform.getMajor() && minor == platform.getMinor());
  }
  for (  int[] version : invalid) {
    int major=version[0];
    int minor=version[1];
    JavaSEPlatform platform=JavaSEPlatform.toValue(major,minor);
    assertNull("String_Node_Str" + "String_Node_Str",platform);
  }
}

Fixed version (ground truth):
/** 
 * Test major and minor version numbers pairs to <code>JavaSEPlatform</code> conversion.
 */
@Test public void testMajorMinorToPlatform(){
  for (  int[] version : VALID) {
    int major=version[0];
    int minor=version[1];
    JavaSEPlatform platform=JavaSEPlatform.toValue(major,minor);
    assertNotNull("String_Node_Str" + "String_Node_Str" + Integer.toString(major) + "String_Node_Str"+ Integer.toString(minor)+ "String_Node_Str",platform);
    int[] result=resultMapping(version);
    assertTrue("String_Node_Str" + "String_Node_Str" + Integer.toString(major) + "String_Node_Str"+ Integer.toString(minor)+ "String_Node_Str",result[0] == platform.getMajor() && result[1] == platform.getMinor());
  }
  for (  int[] version : INVALID) {
    int major=version[0];
    int minor=version[1];
    JavaSEPlatform platform=JavaSEPlatform.toValue(major,minor);
    assertTrue("String_Node_Str" + "String_Node_Str" + Integer.toString(major) + "String_Node_Str"+ Integer.toString(minor)+ "String_Node_Str",LATEST.getMajor() == platform.getMajor() && LATEST.getMinor() == platform.getMinor());
  }
}
Program: 63271
Project: 63271
Buggy source:
/** 
 * Test   {@link String} with major and minor version numbers pairsto <code>JavaSEPlatform</code> conversion.
 */
@Test public void testStringToPlatform(){
  int[][] valid={{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{1,8},{1,9},{9,0}};
  int[][] invalid={{0,0},{0,1},{0,3},{0,5},{0,7},{0,9},{1,0},{2,0},{2,1},{2,2},{3,0},{4,0},{1,10}};
  for (  int[] version : valid) {
    int major=version[0];
    int minor=version[1];
    String versionString=JavaSEPlatform.versionString(major,minor);
    JavaSEPlatform platform=JavaSEPlatform.toValue(versionString);
    assertNotNull("String_Node_Str" + "String_Node_Str",platform);
    assertTrue("String_Node_Str" + "String_Node_Str",major == platform.getMajor() && minor == platform.getMinor());
  }
  for (  int[] version : invalid) {
    int major=version[0];
    int minor=version[1];
    String versionString=JavaSEPlatform.versionString(major,minor);
    JavaSEPlatform platform=JavaSEPlatform.toValue(major,minor);
    assertNull("String_Node_Str" + "String_Node_Str",platform);
  }
}

Fixed version (ground truth):
/** 
 * Test   {@link String} with major and minor version numbers pairsto <code>JavaSEPlatform</code> conversion.
 */
@Test public void testStringToPlatform(){
  for (  int[] version : VALID) {
    int major=version[0];
    int minor=version[1];
    String versionString=JavaSEPlatform.versionString(major,minor);
    JavaSEPlatform platform=JavaSEPlatform.toValue(versionString);
    assertNotNull("String_Node_Str" + "String_Node_Str" + Integer.toString(major) + "String_Node_Str"+ Integer.toString(minor)+ "String_Node_Str",platform);
    int[] result=resultMapping(version);
    assertTrue("String_Node_Str" + "String_Node_Str" + Integer.toString(major) + "String_Node_Str"+ Integer.toString(minor)+ "String_Node_Str",result[0] == platform.getMajor() && result[1] == platform.getMinor());
  }
  for (  int[] version : INVALID) {
    int major=version[0];
    int minor=version[1];
    String versionString=JavaSEPlatform.versionString(major,minor);
    JavaSEPlatform platform=JavaSEPlatform.toValue(major,minor);
    assertTrue("String_Node_Str" + "String_Node_Str" + Integer.toString(major) + "String_Node_Str"+ Integer.toString(minor)+ "String_Node_Str",LATEST.getMajor() == platform.getMajor() && LATEST.getMinor() == platform.getMinor());
  }
}
Program: 63272
Project: 63272
Buggy source:
public int compile(String classpath,Object[] javaFiles){
  int jv=JavaSEPlatform.CURRENT.getMajor();
  final String javaVersion="String_Node_Str" + ((jv >= 9) ? jv : JavaSEPlatform.CURRENT.toString());
  final String[] args=new String[javaFiles.length + ((jv >= 9) ? 9 : 7)];
  final String javac=getJavaC();
  args[0]=javac;
  args[1]="String_Node_Str";
  args[2]=classpath;
  args[3]="String_Node_Str";
  args[4]=javaVersion;
  args[5]="String_Node_Str";
  args[6]=javaVersion;
  if (9 >= jv) {
    args[7]="String_Node_Str";
    args[8]="String_Node_Str";
    System.arraycopy(javaFiles,0,args,9,javaFiles.length);
  }
 else {
    System.arraycopy(javaFiles,0,args,7,javaFiles.length);
  }
  int exitVal=-1;
  try {
    Process proc=Runtime.getRuntime().exec(args);
    InputStream stderr=proc.getErrorStream();
    InputStreamReader isr=new InputStreamReader(stderr);
    BufferedReader br=new BufferedReader(isr);
    String line=br.readLine();
    if (line != null) {
      System.out.println("String_Node_Str");
      while (line != null) {
        System.out.println(line);
        if ((line=br.readLine()) == null) {
          System.out.println("String_Node_Str");
        }
      }
    }
    exitVal=proc.waitFor();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return exitVal;
}

Fixed version (ground truth):
public int compile(String classpath,Object[] javaFiles){
  int jv=JavaSEPlatform.CURRENT.getMajor();
  final String javaVersion="String_Node_Str" + ((jv >= 9) ? jv : JavaSEPlatform.CURRENT.toString());
  final String[] args=new String[javaFiles.length + ((jv >= 9) ? 9 : 7)];
  final String javac=getJavaC();
  args[0]=javac;
  args[1]="String_Node_Str";
  args[2]=classpath;
  args[3]="String_Node_Str";
  args[4]=javaVersion;
  args[5]="String_Node_Str";
  args[6]=javaVersion;
  if (jv >= 9) {
    args[7]="String_Node_Str";
    args[8]="String_Node_Str";
    System.arraycopy(javaFiles,0,args,9,javaFiles.length);
  }
 else {
    System.arraycopy(javaFiles,0,args,7,javaFiles.length);
  }
  int exitVal=-1;
  try {
    Process proc=Runtime.getRuntime().exec(args);
    InputStream stderr=proc.getErrorStream();
    InputStreamReader isr=new InputStreamReader(stderr);
    BufferedReader br=new BufferedReader(isr);
    String line=br.readLine();
    if (line != null) {
      System.out.println("String_Node_Str");
      while (line != null) {
        System.out.println(line);
        if ((line=br.readLine()) == null) {
          System.out.println("String_Node_Str");
        }
      }
    }
    exitVal=proc.waitFor();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  return exitVal;
}
Program: 63273
Project: 63273
Buggy source:
/** 
 * Invoke   {@code Runtime.Version} method with given name ({@code major} or {@code minor}) to retrieve version numbers.
 * @param vClass {@code Runtime.Version} class.
 * @param vObj {@code Runtime.Version} class instance containing JDK version information.
 * @param name name of {@code Runtime.Version} instance method to invoke.
 */
private static Integer getRuntimeVersionNumber(final Object vObj,final String name){
  try {
    final Method m=vObj.getClass().getMethod(name);
    return (Integer)m.invoke(vObj);
  }
 catch (  ReflectiveOperationException e) {
    AbstractSessionLog.getLog().log(SessionLog.WARNING,"String_Node_Str",new String[]{RUNTIME_VERSION_METHOD_NAME,e.getClass().getName()});
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Invoke   {@code Runtime.Version} method with given name ({@code major} or {@code minor}) to retrieve version numbers.
 * @param vClass {@code Runtime.Version} class.
 * @param vObj {@code Runtime.Version} class instance containing JDK version information.
 * @param name name of {@code Runtime.Version} instance method to invoke.
 */
private static Integer getRuntimeVersionNumber(final Object vObj,final String name){
  try {
    final Method m=vObj.getClass().getMethod(name);
    return (Integer)m.invoke(vObj);
  }
 catch (  ReflectiveOperationException e) {
    throw new IllegalStateException(e);
  }
}
Program: 63274
Project: 63274
Buggy source:
/** 
 * Invoke   {@code Runtime#version()} method to retrieve {@code Runtime.Version} instance.
 * @return {@code Runtime.Version} instance for JDK 9 and later or {@code null} otherwise.
 */
private static Object runtimeVersionObject(){
  try {
    final Method m=Runtime.class.getMethod(RUNTIME_VERSION_METHOD_NAME);
    return m.invoke(null);
  }
 catch (  NoSuchMethodException e) {
    AbstractSessionLog.getLog().log(SessionLog.FINEST,"String_Node_Str",new String[]{RUNTIME_VERSION_METHOD_NAME,Runtime.class.getName()});
  }
catch (  ReflectiveOperationException e) {
    AbstractSessionLog.getLog().log(SessionLog.WARNING,"String_Node_Str",new String[]{RUNTIME_VERSION_METHOD_NAME,e.getClass().getName()});
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Invoke   {@code Runtime#version()} method to retrieve {@code Runtime.Version} instance.
 * @return {@code Runtime.Version} instance for JDK 9 and later or {@code null} otherwise.
 */
private static Object runtimeVersionObject(){
  try {
    final Method m=Runtime.class.getMethod(RUNTIME_VERSION_METHOD_NAME);
    return m.invoke(null);
  }
 catch (  NoSuchMethodException e) {
    return null;
  }
catch (  ReflectiveOperationException e) {
    throw new IllegalStateException(e);
  }
}
Program: 63276
Project: 63276
Buggy source:
/** 
 * Recreate the insurance database.
 */
public void createTables(DatabaseSession session){
  if (!SchemaManager.FAST_TABLE_CREATOR) {
    try {
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
    }
 catch (    Exception e) {
    }
  }
  new InsuranceTableCreator().replaceTables(session);
}

Fixed version (ground truth):
/** 
 * Recreate the insurance database.
 */
public void createTables(DatabaseSession session){
  if (!SchemaManager.FAST_TABLE_CREATOR) {
    try {
      if (session.getPlatform().isMySQL()) {
        session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      }
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
    }
 catch (    Exception e) {
      session.getSessionLog().logThrowable(SessionLog.WARNING,e);
    }
 finally {
      if (session.getPlatform().isMySQL()) {
        session.executeNonSelectingCall(new SQLCall("String_Node_Str"));
      }
    }
  }
  new InsuranceTableCreator().replaceTables(session);
}
Program: 63277
Project: 63277
Buggy source:
private void validateOnCallbackEvent(DescriptorEvent event,String callbackEventName,Class[] validationGroup){
  Object source=event.getSource();
  Validator validator=getValidator(event);
  boolean isBeanConstrained=validator.getConstraintsForClass(source.getClass()).isBeanConstrained();
  boolean noOptimization="String_Node_Str".equalsIgnoreCase((String)event.getSession().getProperty(PersistenceUnitProperties.BEAN_VALIDATION_NO_OPTIMISATION));
  boolean shouldValidate=noOptimization || isBeanConstrained;
  if (shouldValidate) {
    Set<ConstraintViolation<Object>> constraintViolations=validate(source,validationGroup,validator);
    if (constraintViolations.size() > 0) {
      throw new ConstraintViolationException(ExceptionLocalization.buildMessage("String_Node_Str",new Object[]{callbackEventName,source.getClass().getName()}),(Set<ConstraintViolation<?>>)(Object)constraintViolations);
    }
  }
}

Fixed version (ground truth):
private void validateOnCallbackEvent(DescriptorEvent event,String callbackEventName,Class[] validationGroup){
  Object source=event.getSource();
  Validator validator=getValidator(event);
  boolean isBeanConstrained=isBeanConstrained(source,validator);
  boolean noOptimization="String_Node_Str".equalsIgnoreCase((String)event.getSession().getProperty(PersistenceUnitProperties.BEAN_VALIDATION_NO_OPTIMISATION));
  boolean shouldValidate=noOptimization || isBeanConstrained;
  if (shouldValidate) {
    Set<ConstraintViolation<Object>> constraintViolations=validate(source,validationGroup,validator);
    if (constraintViolations.size() > 0) {
      throw new ConstraintViolationException(ExceptionLocalization.buildMessage("String_Node_Str",new Object[]{callbackEventName,source.getClass().getName()}),(Set<ConstraintViolation<?>>)(Object)constraintViolations);
    }
  }
}
Program: 63278
Project: 63278
Buggy source:
@Before public void setUp() throws Exception {
  classLoader=new ValidationClassLoader(currentThread.getContextClassLoader());
  currentThread.setContextClassLoader(classLoader);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  classLoader=new ValidationClassLoader(currentThread.getContextClassLoader());
  currentThread.setContextClassLoader(classLoader);
  resetBeanValidation();
}
Program: 63279
Project: 63279
Buggy source:
private Boolean checkClassLoader(String className){
  try {
    ClassLoader loader=WebSpherePlatformDetector.class.getClassLoader();
    Class<?> cls=loader.loadClass(LIBERTY_PROFILE_INFO_INT);
    if (cls != null) {
      return Boolean.TRUE;
    }
  }
 catch (  Throwable t) {
  }
  return Boolean.FALSE;
}

Fixed version (ground truth):
private Boolean checkClassLoader(String className){
  try {
    ClassLoader loader=WebSpherePlatformDetector.class.getClassLoader();
    Class<?> cls=loader.loadClass(className);
    if (cls != null) {
      return Boolean.TRUE;
    }
  }
 catch (  Throwable t) {
  }
  return Boolean.FALSE;
}
Program: 63280
Project: 63280
Buggy source:
@Override public void addJoin(FromImpl from){
  if (this.joins == null) {
    this.joins=new HashSet<FromImpl>();
  }
  this.joins.add(from);
}

Fixed version (ground truth):
@Override public void addJoin(FromImpl from){
  if (this.joins == null) {
    this.joins=new LinkedHashSet<FromImpl>();
  }
  this.joins.add(from);
}
Program: 63282
Project: 63282
Buggy source:
private void validateOnCallbackEvent(DescriptorEvent event,String callbackEventName,Class[] validationGroup){
  Object source=event.getSource();
  Validator validator=getValidator(event);
  boolean isBeanConstrained=isBeanConstrained(source,validator);
  boolean noOptimization="String_Node_Str".equalsIgnoreCase((String)event.getSession().getProperty(PersistenceUnitProperties.BEAN_VALIDATION_NO_OPTIMISATION));
  boolean shouldValidate=noOptimization || isBeanConstrained;
  if (shouldValidate) {
    Set<ConstraintViolation<Object>> constraintViolations=validate(source,validationGroup,validator);
    if (constraintViolations.size() > 0) {
      throw new ConstraintViolationException(ExceptionLocalization.buildMessage("String_Node_Str",new Object[]{callbackEventName,source.getClass().getName()}),(Set<ConstraintViolation<?>>)(Object)constraintViolations);
    }
  }
}

Fixed version (ground truth):
private void validateOnCallbackEvent(DescriptorEvent event,String callbackEventName,Class[] validationGroup){
  Object source=event.getSource();
  Validator validator=getValidator(event);
  boolean isBeanConstrained=validator.getConstraintsForClass(source.getClass()).isBeanConstrained();
  boolean noOptimization="String_Node_Str".equalsIgnoreCase((String)event.getSession().getProperty(PersistenceUnitProperties.BEAN_VALIDATION_NO_OPTIMISATION));
  boolean shouldValidate=noOptimization || isBeanConstrained;
  if (shouldValidate) {
    Set<ConstraintViolation<Object>> constraintViolations=validate(source,validationGroup,validator);
    if (constraintViolations.size() > 0) {
      throw new ConstraintViolationException(ExceptionLocalization.buildMessage("String_Node_Str",new Object[]{callbackEventName,source.getClass().getName()}),(Set<ConstraintViolation<?>>)(Object)constraintViolations);
    }
  }
}
Program: 63285
Project: 63285
Buggy source:
/** 
 * Determine the load state of an entity belonging to the persistence unit. This method can be used to determine the load state of an entity passed as a reference. An entity is considered loaded if all attributes for which FetchType EAGER has been specified have been loaded. The isLoaded(Object, String) method should be used to determine the load state of an attribute. Not doing so might lead to unintended loading of state.
 * @param entity whose load state is to be determined
 * @return false if the entity has not been loaded, else true.
 */
public boolean isLoaded(Object entity){
  if (EntityManagerFactoryImpl.isLoaded(entity,session).equals(Boolean.TRUE)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determine the load state of an entity belonging to the persistence unit. This method can be used to determine the load state of an entity passed as a reference. An entity is considered loaded if all attributes for which FetchType EAGER has been specified have been loaded. The isLoaded(Object, String) method should be used to determine the load state of an attribute. Not doing so might lead to unintended loading of state.
 * @param entity whose load state is to be determined
 * @return false if the entity has not been loaded, else true.
 */
public boolean isLoaded(Object entity){
  if (Boolean.TRUE.equals(EntityManagerFactoryImpl.isLoaded(entity,session))) {
    return true;
  }
  return false;
}