OSDN Git Service

* java/nio/channels/FileLock.java (toString): Entirely avoid
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 May 2005 21:09:36 +0000 (21:09 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 4 May 2005 21:09:36 +0000 (21:09 +0000)
String "+".

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

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

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99230 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/java/nio/channels/FileLock.java

index 47a7ef5..8380e6c 100644 (file)
@@ -1,3 +1,13 @@
+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>
 
        * java/awt/ImageCapabilities.java: Document.
index a4af080..46c5d81 100644 (file)
@@ -1,5 +1,5 @@
 /* FileLock.java --
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -132,16 +132,19 @@ 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("[");
+    buf.append(position);
+    buf.append(":");
+    buf.append(size);
+    if (shared)
+      buf.append(" shared");
+    else
+      buf.append(" exclusive");
+    if (isValid())
+      buf.append(" valid]");
+    else
+      buf.append(" invalid]");
+    return buf.toString();
   }
 }