diff --git a/src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java b/src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java index 4663e1374..62868736c 100644 --- a/src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java +++ b/src/main/java/org/apache/commons/lang3/concurrent/locks/LockingVisitors.java @@ -82,12 +82,35 @@ public class LockingVisitors { */ public static class LockVisitor { + /** + * The lock object, untyped, since, for example {@link StampedLock} does not implement a locking interface in + * Java 8. + */ private final L lock; - + + /** + * The guarded object. + */ private final O object; + + /** + * Supplies the read lock, usually from the lock object. + */ private final Supplier readLockSupplier; + + /** + * Supplies the write lock, usually from the lock object. + */ private final Supplier writeLockSupplier; + /** + * Constructs an instance. + * + * @param object The object to guard. + * @param lock The locking object. + * @param readLockSupplier Supplies the read lock, usually from the lock object. + * @param writeLockSupplier Supplies the write lock, usually from the lock object. + */ protected LockVisitor(final O object, L lock, Supplier readLockSupplier, Supplier writeLockSupplier) { super(); this.object = Objects.requireNonNull(object, "object"); @@ -210,7 +233,7 @@ public class LockingVisitors { } /** - * Gets the object. + * Gets the guarded object. * * @return the object. */