summaryrefslogtreecommitdiffstats
path: root/luni/src
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2014-04-29 10:06:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-04-29 10:06:23 +0000
commit97e35de30fcddd7eaa0d6eb7a100bcf9bdd824a1 (patch)
tree847cb961e33e00d078d521b9d61ce7a2ed53ee02 /luni/src
parent6d4959fccde3bcddb42ca0d0bb16eef294ac09b4 (diff)
parenta10637a26dc17501789edde0f4675e1639741f71 (diff)
downloadlibcore-97e35de30fcddd7eaa0d6eb7a100bcf9bdd824a1.zip
libcore-97e35de30fcddd7eaa0d6eb7a100bcf9bdd824a1.tar.gz
libcore-97e35de30fcddd7eaa0d6eb7a100bcf9bdd824a1.tar.bz2
Merge "1.7 interoperability changes for FileLock"
Diffstat (limited to 'luni/src')
-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.