Program: 63249
Project: 63249
Buggy source:
public void test() throws Exception {
  checkSelectForUpateSupported();
  if (getSession().getPlatform().isHANA()) {
    throw new TestWarningException("String_Node_Str");
  }
  if (this.lockMode == ObjectBuildingQuery.LOCK_NOWAIT) {
    checkNoWaitSupported();
  }
  uow=getSession().acquireUnitOfWork();
  this.employeeObject=(Employee)uow.registerObject(employeeObject);
  city=employeeObject.getAddress().getCity();
  employeeObject.getAddress().setCity("String_Node_Str");
  startTime=employeeObject.getStartTime();
  employeeObject.setStartTime(null);
  endDate=employeeObject.getPeriod().getEndDate();
  employeeObject.getPeriod().setEndDate(null);
  managerName=employeeObject.getManager().getFirstName();
  employeeObject.getManager().setFirstName("String_Node_Str");
  collectionSize=employeeObject.getPhoneNumbers().size();
  employeeObject.getPhoneNumbers().removeAllElements();
  responsibilityListSize=employeeObject.getResponsibilitiesList().size();
  employeeObject.getResponsibilitiesList().removeAllElements();
  uow.refreshAndLockObject(employeeObject,(short)this.lockMode);
  DatabaseSession session2=null;
  UnitOfWork uow2=null;
  try {
    if (getSession() instanceof org.eclipse.persistence.sessions.remote.RemoteSession) {
      session2=org.eclipse.persistence.testing.tests.remote.RemoteModel.getServerSession().getProject().createDatabaseSession();
    }
 else {
      session2=getSession().getProject().createDatabaseSession();
    }
    session2.setSessionLog(getSession().getSessionLog());
    session2.login();
    uow2=session2.acquireUnitOfWork();
    boolean isLocked=false;
    Object result=null;
    try {
      result=uow2.refreshAndLockObject(employeeObject,(short)lockMode);
    }
 catch (    EclipseLinkException exeception) {
      session2.logMessage(exeception.toString());
      isLocked=true;
    }
    if (result == null) {
      isLocked=true;
    }
    if (!isLocked) {
      throw new TestWarningException("String_Node_Str");
    }
  }
  finally {
    if (uow2 != null) {
      uow2.release();
    }
    if (session2 != null) {
      session2.logout();
    }
  }
}

Fixed version (ground truth):
public void test() throws Exception {
  checkSelectForUpateSupported();
  if (getSession().getPlatform().isHANA()) {
    throw new TestWarningException("String_Node_Str");
  }
  checkNoWaitSupported();
  uow=getSession().acquireUnitOfWork();
  this.employeeObject=(Employee)uow.registerObject(employeeObject);
  city=employeeObject.getAddress().getCity();
  employeeObject.getAddress().setCity("String_Node_Str");
  startTime=employeeObject.getStartTime();
  employeeObject.setStartTime(null);
  endDate=employeeObject.getPeriod().getEndDate();
  employeeObject.getPeriod().setEndDate(null);
  managerName=employeeObject.getManager().getFirstName();
  employeeObject.getManager().setFirstName("String_Node_Str");
  collectionSize=employeeObject.getPhoneNumbers().size();
  employeeObject.getPhoneNumbers().removeAllElements();
  responsibilityListSize=employeeObject.getResponsibilitiesList().size();
  employeeObject.getResponsibilitiesList().removeAllElements();
  uow.refreshAndLockObject(employeeObject,org.eclipse.persistence.queries.ObjectBuildingQuery.LOCK_NOWAIT);
  DatabaseSession session2=null;
  UnitOfWork uow2=null;
  try {
    if (getSession() instanceof org.eclipse.persistence.sessions.remote.RemoteSession) {
      session2=org.eclipse.persistence.testing.tests.remote.RemoteModel.getServerSession().getProject().createDatabaseSession();
    }
 else {
      session2=getSession().getProject().createDatabaseSession();
    }
    session2.setSessionLog(getSession().getSessionLog());
    session2.login();
    uow2=session2.acquireUnitOfWork();
    boolean isLocked=false;
    Object result=null;
    try {
      result=uow2.refreshAndLockObject(employeeObject,(short)lockMode);
    }
 catch (    EclipseLinkException exeception) {
      session2.logMessage(exeception.toString());
      isLocked=true;
    }
    if (result == null) {
      isLocked=true;
    }
    if (!isLocked) {
      throw new TestWarningException("String_Node_Str");
    }
  }
  finally {
    if (uow2 != null) {
      uow2.release();
    }
    if (session2 != null) {
      session2.logout();
    }
  }
}