Source:
<code>public void handleDataChange(String dataPath, Object data) throws Exception { Stat stat = new Stat(); ZNRecord readData = _baseDataAccessor.get(dataPath, stat, AccessOption.THROW_EXCEPTION_IFNOTEXIST); LockInfo lockInfo = new LockInfo(readData); if (lockInfo.getOwner().equals(_userId)) { if (lockInfo.getRequestorId() == null || lockInfo.getPriority() > lockInfo .getRequestorPriority()) { LOG.info("We do not need to handle this data change"); } else { _lockListener.onCleanupNotification(); readData = _baseDataAccessor.get(dataPath, stat, AccessOption.THROW_EXCEPTION_IFNOTEXIST); if (lockInfo.getOwner().equals(_userId)) { ZNRecord znRecord = new ZNRecord(readData); <START> znRecord.setSimpleField(LockInfo.LockInfoAttribute.OWNER.name(), ""); znRecord.setSimpleField(LockInfo.LockInfoAttribute.MESSAGE.name(), ""); znRecord.setLongField(LockInfo.LockInfoAttribute.TIMEOUT.name(), -1); znRecord.setIntField(LockInfo.LockInfoAttribute.PRIORITY.name(), -1); znRecord.setLongField(LockInfo.LockInfoAttribute.WAITING_TIMEOUT.name(), -1); znRecord.setLongField(LockInfo.LockInfoAttribute.CLEANUP_TIMEOUT.name(), -1); <END> _baseDataAccessor .update(_lockPath, new ZNRecordUpdater(znRecord), AccessOption.PERSISTENT); } else { LOG.info("We are not current lock owner"); } } } else if (lockInfo.getRequestorId().equals(_userId)) { if (lockInfo.getOwner().isEmpty()) { ZNRecord znRecord = composeNewOwnerRecord(); _baseDataAccessor.update(_lockPath, new ZNRecordUpdater(znRecord), AccessOption.PERSISTENT); onAcquiredLockNotification(); } else { LOG.info("We do not need to handle this data change"); } } else if (lockInfo.getRequestorId() != null && !lockInfo.getRequestorId().equals(_userId) && _isPending) { onDeniedPendingLockNotification(); } }</code><technical_language>refer DEFAULT lock values in constant class</technical_language>

Target:
public void handleDataChange(String dataPath, Object data) throws Exception { Stat stat = new Stat(); ZNRecord readData = _baseDataAccessor.get(dataPath, stat, AccessOption.THROW_EXCEPTION_IFNOTEXIST); LockInfo lockInfo = new LockInfo(readData); if (isCurrentOwner(lockInfo)) { if (lockInfo.getRequestorId().equals(LockConstants.DEFAULT_USER_ID) || lockInfo.getPriority() > lockInfo.getRequestorPriority()) { LOG.debug("We do not need to handle this data change"); } else { _lockListener.onCleanupNotification(); CleanupUpdater cleanupUpdater = new CleanupUpdater(); boolean res = _baseDataAccessor.update(_lockPath, cleanupUpdater, AccessOption.PERSISTENT); if (!res) { throw new HelixException( String.format("User %s failed to update lock path %s", _userId, _lockPath)); } } } else if (lockInfo.getRequestorId().equals(_userId)) { if (lockInfo.getOwner().equals(LockConstants.DEFAULT_USER_ID)) { ZNRecord znRecord = composeNewOwnerRecord(); LockUpdater updater = new LockUpdater(new LockInfo(znRecord)); _baseDataAccessor.update(_lockPath, updater, AccessOption.PERSISTENT); onAcquiredLockNotification(); } else { LOG.info("We do not need to handle this data change"); } } else if (!lockInfo.getRequestorId().equals(LockConstants.DEFAULT_USER_ID) && !lockInfo .getRequestorId().equals(_userId) && _lockStatus == LockConstants.LockStatus.PENDING) { onDeniedPendingLockNotification(); } }