Commit 5b3ceafe by Tom Tromey

FileLock.java (toString): Entirely avoid String "+".

	* java/nio/channels/FileLock.java (toString): Entirely avoid
	String "+".

2005-05-04  Andrew Overholt  <overholt@redhat.com>

	* java/nio/channels/FileLock.java (toString): Re-implement using
	StringBuffer.

From-SVN: r99230
parent 66d3fe47
2005-05-04 Tom Tromey <tromey@redhat.com>
* java/nio/channels/FileLock.java (toString): Entirely avoid
String "+".
2005-05-04 Andrew Overholt <overholt@redhat.com>
* java/nio/channels/FileLock.java (toString): Re-implement using
StringBuffer.
2005-05-04 Thomas Fitzsimmons <fitzsim@redhat.com> 2005-05-04 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/awt/ImageCapabilities.java: Document. * java/awt/ImageCapabilities.java: Document.
......
/* FileLock.java -- /* FileLock.java --
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
...@@ -132,16 +132,19 @@ public abstract class FileLock ...@@ -132,16 +132,19 @@ public abstract class FileLock
*/ */
public final String toString() public final String toString()
{ {
String toReturn = getClass().getName() + StringBuffer buf = new StringBuffer(getClass().getName());
"[" + position + ":" + size; buf.append("[");
if (shared) buf.append(position);
toReturn += " shared"; buf.append(":");
else buf.append(size);
toReturn += " exclusive"; if (shared)
if (isValid()) buf.append(" shared");
toReturn += " valid]"; else
else buf.append(" exclusive");
toReturn += " invalid]"; if (isValid())
return toReturn; buf.append(" valid]");
else
buf.append(" invalid]");
return buf.toString();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment