summaryrefslogtreecommitdiff
path: root/java/nio
diff options
context:
space:
mode:
Diffstat (limited to 'java/nio')
-rw-r--r--java/nio/channels/FileLock.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/java/nio/channels/FileLock.java b/java/nio/channels/FileLock.java
index a4af08091..7f4a89ced 100644
--- a/java/nio/channels/FileLock.java
+++ b/java/nio/channels/FileLock.java
@@ -132,16 +132,16 @@ public abstract class FileLock
*/
public final String toString()
{
- String toReturn = getClass().getName() +
- "[" + position + ":" + size;
- if (shared)
- toReturn += " shared";
- else
- toReturn += " exclusive";
- if (isValid())
- toReturn += " valid]";
- else
- toReturn += " invalid]";
- return toReturn;
+ StringBuffer buf = new StringBuffer(getClass().getName());
+ buf.append("[" + position + ":" + size);
+ if (shared)
+ buf.append(" shared");
+ else
+ buf.append(" exclusive");
+ if (isValid())
+ buf.append(" valid]");
+ else
+ buf.append(" invalid]");
+ return buf.toString();
}
}