Source:
<code>private void setSessionToken(ResourceId resourceId, String collectionName, String token) { String partitionKeyRangeId; ISessionToken parsedSessionToken; String[] tokenParts = StringUtils.split(token, ':'); partitionKeyRangeId = tokenParts[0]; parsedSessionToken = SessionTokenHelper.parse(tokenParts[1]); if (logger.isTraceEnabled()) { logger.trace("UPDATE SESSION token {}", resourceId.getUniqueDocumentCollectionId(), collectionName, parsedSessionToken); } boolean isKnownCollection; this.readLock.lock(); try { isKnownCollection = this.collectionNameToCollectionResourceId.containsKey(collectionName) && this.collectionResourceIdToCollectionName.containsKey(resourceId.getUniqueDocumentCollectionId()) && this.collectionNameToCollectionResourceId.get(collectionName) == resourceId.getUniqueDocumentCollectionId() && this.collectionResourceIdToCollectionName.get(resourceId.getUniqueDocumentCollectionId()).equals(collectionName); if (isKnownCollection) { this.addSessionToken(resourceId, partitionKeyRangeId, parsedSessionToken); } } finally { this.readLock.unlock(); } if (!isKnownCollection) { this.writeLock.lock(); try { <START> if (resourceId.getUniqueDocumentCollectionId() != 0) { <END> this.collectionNameToCollectionResourceId.compute(collectionName, (k, v) -> resourceId.getUniqueDocumentCollectionId()); this.collectionResourceIdToCollectionName.compute(resourceId.getUniqueDocumentCollectionId(), (k, v) -> collectionName); } addSessionToken(resourceId, partitionKeyRangeId, parsedSessionToken); } finally { this.writeLock.unlock(); } } }</code><technical_language>making changes? removing sanity checks a bit uncomfortable</technical_language>

Target:
private void setSessionToken(ResourceId resourceId, String collectionName, String token) { String partitionKeyRangeId; ISessionToken parsedSessionToken; String[] tokenParts = StringUtils.split(token, ':'); partitionKeyRangeId = tokenParts[0]; parsedSessionToken = SessionTokenHelper.parse(tokenParts[1]); if (logger.isTraceEnabled()) { logger.trace("UPDATE SESSION token {}", resourceId.getUniqueDocumentCollectionId(), collectionName, parsedSessionToken); } boolean isKnownCollection; this.readLock.lock(); try { isKnownCollection = this.collectionNameToCollectionResourceId.containsKey(collectionName) && this.collectionResourceIdToCollectionName.containsKey(resourceId.getUniqueDocumentCollectionId()) && this.collectionNameToCollectionResourceId.get(collectionName) == resourceId.getUniqueDocumentCollectionId() && this.collectionResourceIdToCollectionName.get(resourceId.getUniqueDocumentCollectionId()).equals(collectionName); if (isKnownCollection) { this.addSessionToken(resourceId, partitionKeyRangeId, parsedSessionToken); } } finally { this.readLock.unlock(); } if (!isKnownCollection) { this.writeLock.lock(); try { if (collectionName != null && resourceId.getUniqueDocumentCollectionId() != 0) { this.collectionNameToCollectionResourceId.compute(collectionName, (k, v) -> resourceId.getUniqueDocumentCollectionId()); this.collectionResourceIdToCollectionName.compute(resourceId.getUniqueDocumentCollectionId(), (k, v) -> collectionName); } addSessionToken(resourceId, partitionKeyRangeId, parsedSessionToken); } finally { this.writeLock.unlock(); } } }