summaryrefslogtreecommitdiffstats
path: root/libjava/java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-03 22:38:17 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-03 22:38:17 +0000
commita2295b1c5cfa37ba98570b051e631dd799d3ffc3 (patch)
treed6cc1093a809e003aab0e160015f13e1f04bca5f /libjava/java
parent0b25db2159a2082ba5b70c17bd8ca2800036e50c (diff)
downloadppe42-gcc-a2295b1c5cfa37ba98570b051e631dd799d3ffc3.tar.gz
ppe42-gcc-a2295b1c5cfa37ba98570b051e631dd799d3ffc3.zip
2005-05-03 Andrew Overholt <overholt@redhat.com>
PR libgcj/21372: * gnu/java/nio/channels/FileChannelImpl.java: Return null if lock could not be acquired. * java/nio/channels/FileLock.java (toString): Re-implement to be in line with other implementations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99188 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java')
-rw-r--r--libjava/java/nio/channels/FileLock.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/libjava/java/nio/channels/FileLock.java b/libjava/java/nio/channels/FileLock.java
index 629f5ef79ec..a4af08091bb 100644
--- a/libjava/java/nio/channels/FileLock.java
+++ b/libjava/java/nio/channels/FileLock.java
@@ -132,6 +132,16 @@ public abstract class FileLock
*/
public final String toString()
{
- return "file-lock:pos=" + position + "size=" + size;
+ String toReturn = getClass().getName() +
+ "[" + position + ":" + size;
+ if (shared)
+ toReturn += " shared";
+ else
+ toReturn += " exclusive";
+ if (isValid())
+ toReturn += " valid]";
+ else
+ toReturn += " invalid]";
+ return toReturn;
}
}
OpenPOWER on IntegriCloud