Program: 166212
Project: 166212
Buggy source:
@Transactional(readOnly=false,propagation=Propagation.REQUIRED) public VXUser createServiceConfigUser(String userName){
  if (userName == null || "String_Node_Str".equalsIgnoreCase(userName) || userName.trim().isEmpty()) {
    logger.error("String_Node_Str" + userName);
    throw restErrorUtil.createRESTException("String_Node_Str",MessageEnums.INVALID_INPUT_DATA);
  }
  VXUser vXUser=null;
  VXPortalUser vXPortalUser=null;
  XXUser xxUser=daoManager.getXXUser().findByUserName(userName);
  XXPortalUser xXPortalUser=daoManager.getXXPortalUser().findByLoginId(userName);
  String actualPassword="String_Node_Str";
  if (xxUser != null) {
    vXUser=xUserService.populateViewBean(xxUser);
    return vXUser;
  }
  if (xxUser == null) {
    vXUser=new VXUser();
    vXUser.setName(userName);
    vXUser.setUserSource(RangerCommonEnums.USER_EXTERNAL);
    vXUser.setDescription(vXUser.getName());
    actualPassword=vXUser.getPassword();
  }
  if (xXPortalUser == null) {
    vXPortalUser=new VXPortalUser();
    vXPortalUser.setLoginId(userName);
    vXPortalUser.setEmailAddress(vXUser.getEmailAddress());
    vXPortalUser.setFirstName(vXUser.getFirstName());
    vXPortalUser.setLastName(vXUser.getLastName());
    vXPortalUser.setPassword(vXUser.getPassword());
    vXPortalUser.setUserSource(RangerCommonEnums.USER_EXTERNAL);
    ArrayList<String> roleList=new ArrayList<String>();
    roleList.add(RangerConstants.ROLE_USER);
    vXPortalUser.setUserRoleList(roleList);
    xXPortalUser=userMgr.mapVXPortalUserToXXPortalUser(vXPortalUser);
    xXPortalUser=userMgr.createUser(xXPortalUser,RangerCommonEnums.STATUS_ENABLED,roleList);
  }
  VXUser createdXUser=null;
  if (xxUser == null && vXUser != null) {
    try {
      createdXUser=xUserService.createResource(vXUser);
    }
 catch (    Exception ex) {
      logger.error("String_Node_Str" + createdXUser.getName(),ex);
    }
  }
  if (createdXUser != null) {
    try {
      logger.info("String_Node_Str" + createdXUser.getName());
      createdXUser.setPassword(actualPassword);
      List<XXTrxLog> trxLogList=xUserService.getTransactionLog(createdXUser,"String_Node_Str");
      String hiddenPassword=PropertiesUtil.getProperty("String_Node_Str","String_Node_Str");
      createdXUser.setPassword(hiddenPassword);
      xaBizUtil.createTrxLog(trxLogList);
      if (xXPortalUser != null) {
        vXPortalUser=userMgr.mapXXPortalUserToVXPortalUserForDefaultAccount(xXPortalUser);
        assignPermissionToUser(vXPortalUser,true);
      }
    }
 catch (    Exception ex) {
      logger.error("String_Node_Str" + createdXUser.getName(),ex);
    }
  }
 else {
    xxUser=daoManager.getXXUser().findByUserName(userName);
    if (xxUser != null) {
      createdXUser=xUserService.populateViewBean(xxUser);
    }
  }
  return createdXUser;
}

Fixed version (ground truth):
@Transactional(readOnly=false,propagation=Propagation.REQUIRED) public VXUser createServiceConfigUser(String userName){
  if (userName == null || "String_Node_Str".equalsIgnoreCase(userName) || userName.trim().isEmpty()) {
    logger.error("String_Node_Str" + userName);
    throw restErrorUtil.createRESTException("String_Node_Str",MessageEnums.INVALID_INPUT_DATA);
  }
  VXUser vXUser=null;
  VXPortalUser vXPortalUser=null;
  XXUser xxUser=daoManager.getXXUser().findByUserName(userName);
  XXPortalUser xXPortalUser=daoManager.getXXPortalUser().findByLoginId(userName);
  String actualPassword="String_Node_Str";
  if (xxUser != null) {
    vXUser=xUserService.populateViewBean(xxUser);
    return vXUser;
  }
  if (xxUser == null) {
    vXUser=new VXUser();
    vXUser.setName(userName);
    vXUser.setUserSource(RangerCommonEnums.USER_EXTERNAL);
    vXUser.setDescription(vXUser.getName());
    actualPassword=vXUser.getPassword();
  }
  if (xXPortalUser == null) {
    vXPortalUser=new VXPortalUser();
    vXPortalUser.setLoginId(userName);
    vXPortalUser.setEmailAddress(vXUser.getEmailAddress());
    vXPortalUser.setFirstName(vXUser.getFirstName());
    vXPortalUser.setLastName(vXUser.getLastName());
    vXPortalUser.setPassword(vXUser.getPassword());
    vXPortalUser.setUserSource(RangerCommonEnums.USER_EXTERNAL);
    ArrayList<String> roleList=new ArrayList<String>();
    roleList.add(RangerConstants.ROLE_USER);
    vXPortalUser.setUserRoleList(roleList);
    xXPortalUser=userMgr.mapVXPortalUserToXXPortalUser(vXPortalUser);
    xXPortalUser=userMgr.createUser(xXPortalUser,RangerCommonEnums.STATUS_ENABLED,roleList);
  }
  VXUser createdXUser=null;
  if (xxUser == null && vXUser != null) {
    try {
      createdXUser=xUserService.createResource(vXUser);
    }
 catch (    Exception ex) {
      logger.error("String_Node_Str" + vXUser.getName(),ex);
    }
  }
  if (createdXUser != null) {
    try {
      logger.info("String_Node_Str" + createdXUser.getName());
      createdXUser.setPassword(actualPassword);
      List<XXTrxLog> trxLogList=xUserService.getTransactionLog(createdXUser,"String_Node_Str");
      String hiddenPassword=PropertiesUtil.getProperty("String_Node_Str","String_Node_Str");
      createdXUser.setPassword(hiddenPassword);
      xaBizUtil.createTrxLog(trxLogList);
      if (xXPortalUser != null) {
        vXPortalUser=userMgr.mapXXPortalUserToVXPortalUserForDefaultAccount(xXPortalUser);
        assignPermissionToUser(vXPortalUser,true);
      }
    }
 catch (    Exception ex) {
      logger.error("String_Node_Str" + createdXUser.getName(),ex);
    }
  }
 else {
    xxUser=daoManager.getXXUser().findByUserName(userName);
    if (xxUser != null) {
      createdXUser=xUserService.populateViewBean(xxUser);
    }
  }
  return createdXUser;
}