summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/java/nio/channels/FileLock.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/luni/src/main/java/java/nio/channels/FileLock.java b/luni/src/main/java/java/nio/channels/FileLock.java
index 360f826..037537c 100644
--- a/luni/src/main/java/java/nio/channels/FileLock.java
+++ b/luni/src/main/java/java/nio/channels/FileLock.java
@@ -108,14 +108,23 @@ public abstract class FileLock implements AutoCloseable {
/**
* Returns the lock's {@link FileChannel}.
- *
- * @return the channel.
*/
public final FileChannel channel() {
return channel;
}
/**
+ * Returns the {@link Channel} that holds this lock.
+ *
+ * @since 1.7
+ * @hide Until ready for an API update
+ */
+ // TODO: unhiding, add to channel(): This method has been superseded by {@link #acquiredBy()}.
+ public Channel acquiredBy() {
+ return channel;
+ }
+
+ /**
* Returns the lock's starting position in the file.
*
* @return the lock position.