From c7f77f40fa409e19bfffc9a455494ef877a399d2 Mon Sep 17 00:00:00 2001
From: tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 4 May 2005 21:09:36 +0000
Subject: [PATCH] 	* 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.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99230 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libjava/ChangeLog                       | 10 +++++++++
 libjava/java/nio/channels/FileLock.java | 27 ++++++++++++++-----------
 2 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 47a7ef53c9c1..8380e6ce5809 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -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.
diff --git a/libjava/java/nio/channels/FileLock.java b/libjava/java/nio/channels/FileLock.java
index a4af08091bb3..46c5d8122795 100644
--- a/libjava/java/nio/channels/FileLock.java
+++ b/libjava/java/nio/channels/FileLock.java
@@ -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();
   }
 }
-- 
GitLab