StorageLockContext (@Nullable StorageLockContext storageLockContext) { StorageLockContext threadLocalContext = THREAD_LOCAL_STORAGE_LOCK_CONTEXT.get(); if (threadLocalContext != null) { if (storageLockContext != null && storageLockContext != threadLocalContext) { throw new IllegalStateException("Context(" + storageLockContext + ") != THREAD_LOCAL_STORAGE_LOCK_CONTEXT(" + threadLocalContext + ")"); } return threadLocalContext; } else if (storageLockContext != null) { return storageLockContext; } else { return StorageLockContext.DEFAULT_CONTEXT; } }