Program: 64778
Project: 64778
Buggy source:
public void testGetLockModeType(){
  if (getPlatform(Employee.class).isSymfoware()) {
    getDatabaseSession().logMessage("String_Node_Str" + "String_Node_Str");
    return;
  }
  if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
    return;
  }
  if (isSelectForUpateSupported()) {
    EntityManager em=createEntityManager();
    try {
      beginTransaction(em);
      Employee emp=new Employee();
      Employee emp1=new Employee();
      Employee emp2=new Employee();
      Employee emp3=new Employee();
      Employee emp4=new Employee();
      Employee emp5=new Employee();
      Employee emp6=new Employee();
      Employee emp7=new Employee();
      emp.setFirstName("String_Node_Str");
      emp.setLastName("String_Node_Str");
      emp1.setFirstName("String_Node_Str");
      emp1.setLastName("String_Node_Str");
      emp2.setFirstName("String_Node_Str");
      emp2.setLastName("String_Node_Str");
      emp3.setFirstName("String_Node_Str");
      emp3.setLastName("String_Node_Str");
      emp4.setFirstName("String_Node_Str");
      emp4.setLastName("String_Node_Str");
      emp5.setFirstName("String_Node_Str");
      emp5.setLastName("String_Node_Str");
      emp6.setFirstName("String_Node_Str");
      emp6.setLastName("String_Node_Str");
      emp7.setFirstName("String_Node_Str");
      emp7.setLastName("String_Node_Str");
      em.persist(emp);
      em.persist(emp1);
      em.persist(emp2);
      em.persist(emp3);
      em.persist(emp4);
      em.persist(emp5);
      em.persist(emp6);
      em.persist(emp7);
      commitTransaction(em);
      beginTransaction(em);
      emp=em.find(Employee.class,emp.getId());
      emp1=em.find(Employee.class,emp1.getId());
      emp2=em.find(Employee.class,emp2.getId());
      emp3=em.find(Employee.class,emp3.getId());
      emp4=em.find(Employee.class,emp4.getId());
      emp5=em.find(Employee.class,emp5.getId());
      emp6=em.find(Employee.class,emp6.getId());
      emp7=em.find(Employee.class,emp7.getId());
      em.lock(emp,LockModeType.OPTIMISTIC);
      LockModeType lt=em.getLockMode(emp);
      em.lock(emp1,LockModeType.OPTIMISTIC_FORCE_INCREMENT);
      LockModeType lt1=em.getLockMode(emp1);
      em.lock(emp2,LockModeType.PESSIMISTIC_READ);
      LockModeType lt2=em.getLockMode(emp2);
      em.lock(emp3,LockModeType.PESSIMISTIC_WRITE);
      LockModeType lt3=em.getLockMode(emp3);
      em.lock(emp4,LockModeType.PESSIMISTIC_FORCE_INCREMENT);
      LockModeType lt4=em.getLockMode(emp4);
      em.lock(emp5,LockModeType.READ);
      LockModeType lt5=em.getLockMode(emp5);
      em.lock(emp6,LockModeType.WRITE);
      LockModeType lt6=em.getLockMode(emp6);
      em.lock(emp7,LockModeType.NONE);
      LockModeType lt7=em.getLockMode(emp7);
      assertEquals("String_Node_Str",LockModeType.OPTIMISTIC,lt);
      assertEquals("String_Node_Str",LockModeType.OPTIMISTIC_FORCE_INCREMENT,lt1);
      assertTrue("String_Node_Str",lt2 == LockModeType.PESSIMISTIC_WRITE || lt2 == LockModeType.PESSIMISTIC_READ);
      assertEquals("String_Node_Str",LockModeType.PESSIMISTIC_WRITE,lt3);
      assertEquals("String_Node_Str",LockModeType.PESSIMISTIC_FORCE_INCREMENT,lt4);
      assertEquals("String_Node_Str",LockModeType.OPTIMISTIC,lt5);
      assertEquals("String_Node_Str",LockModeType.OPTIMISTIC_FORCE_INCREMENT,lt6);
      assertEquals("String_Node_Str",LockModeType.NONE,lt7);
    }
 catch (    UnsupportedOperationException use) {
      return;
    }
 finally {
      rollbackTransaction(em);
      closeEntityManager(em);
    }
  }
}

Fixed version (ground truth):
public void testGetLockModeType(){
  if (getPlatform(Employee.class).isSymfoware()) {
    getDatabaseSession().logMessage("String_Node_Str" + "String_Node_Str");
    return;
  }
  if (getPlatform(Employee.class).isHANA()) {
    return;
  }
  if (isSelectForUpateSupported()) {
    EntityManager em=createEntityManager();
    try {
      beginTransaction(em);
      Employee emp=new Employee();
      Employee emp1=new Employee();
      Employee emp2=new Employee();
      Employee emp3=new Employee();
      Employee emp4=new Employee();
      Employee emp5=new Employee();
      Employee emp6=new Employee();
      Employee emp7=new Employee();
      emp.setFirstName("String_Node_Str");
      emp.setLastName("String_Node_Str");
      emp1.setFirstName("String_Node_Str");
      emp1.setLastName("String_Node_Str");
      emp2.setFirstName("String_Node_Str");
      emp2.setLastName("String_Node_Str");
      emp3.setFirstName("String_Node_Str");
      emp3.setLastName("String_Node_Str");
      emp4.setFirstName("String_Node_Str");
      emp4.setLastName("String_Node_Str");
      emp5.setFirstName("String_Node_Str");
      emp5.setLastName("String_Node_Str");
      emp6.setFirstName("String_Node_Str");
      emp6.setLastName("String_Node_Str");
      emp7.setFirstName("String_Node_Str");
      emp7.setLastName("String_Node_Str");
      em.persist(emp);
      em.persist(emp1);
      em.persist(emp2);
      em.persist(emp3);
      em.persist(emp4);
      em.persist(emp5);
      em.persist(emp6);
      em.persist(emp7);
      commitTransaction(em);
      beginTransaction(em);
      emp=em.find(Employee.class,emp.getId());
      emp1=em.find(Employee.class,emp1.getId());
      emp2=em.find(Employee.class,emp2.getId());
      emp3=em.find(Employee.class,emp3.getId());
      emp4=em.find(Employee.class,emp4.getId());
      emp5=em.find(Employee.class,emp5.getId());
      emp6=em.find(Employee.class,emp6.getId());
      emp7=em.find(Employee.class,emp7.getId());
      em.lock(emp,LockModeType.OPTIMISTIC);
      LockModeType lt=em.getLockMode(emp);
      em.lock(emp1,LockModeType.OPTIMISTIC_FORCE_INCREMENT);
      LockModeType lt1=em.getLockMode(emp1);
      em.lock(emp2,LockModeType.PESSIMISTIC_READ);
      LockModeType lt2=em.getLockMode(emp2);
      em.lock(emp3,LockModeType.PESSIMISTIC_WRITE);
      LockModeType lt3=em.getLockMode(emp3);
      em.lock(emp4,LockModeType.PESSIMISTIC_FORCE_INCREMENT);
      LockModeType lt4=em.getLockMode(emp4);
      em.lock(emp5,LockModeType.READ);
      LockModeType lt5=em.getLockMode(emp5);
      em.lock(emp6,LockModeType.WRITE);
      LockModeType lt6=em.getLockMode(emp6);
      em.lock(emp7,LockModeType.NONE);
      LockModeType lt7=em.getLockMode(emp7);
      assertEquals("String_Node_Str",LockModeType.OPTIMISTIC,lt);
      assertEquals("String_Node_Str",LockModeType.OPTIMISTIC_FORCE_INCREMENT,lt1);
      assertTrue("String_Node_Str",lt2 == LockModeType.PESSIMISTIC_WRITE || lt2 == LockModeType.PESSIMISTIC_READ);
      assertEquals("String_Node_Str",LockModeType.PESSIMISTIC_WRITE,lt3);
      assertEquals("String_Node_Str",LockModeType.PESSIMISTIC_FORCE_INCREMENT,lt4);
      assertEquals("String_Node_Str",LockModeType.OPTIMISTIC,lt5);
      assertEquals("String_Node_Str",LockModeType.OPTIMISTIC_FORCE_INCREMENT,lt6);
      assertEquals("String_Node_Str",LockModeType.NONE,lt7);
    }
 catch (    UnsupportedOperationException use) {
      return;
    }
 finally {
      rollbackTransaction(em);
      closeEntityManager(em);
    }
  }
}