This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: javax.naming.CompoundName serialization fixlet
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: classpath-patches at gnu dot org
- Date: 12 Sep 2004 17:12:11 -0600
- Subject: Patch: FYI: javax.naming.CompoundName serialization fixlet
- Reply-to: tromey at redhat dot com
I'm checking this in to both libgcj and classpath.
This fixes a bug in javax.naming.CompoundName that would cause an
infinite loop in some situations. This prevented the Mauve
serialization tests from completing.
The code in CompoundName could still use some work. In particular,
the documentation for "flat" names is now better than it was when this
code was originally written, and so the class could be cleaned up to
reflect that. Also this class needs readObject and writeObject
methods; the serialized form isn't documented so ...
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* javax/naming/CompoundName.java (CompoundName): Don't check for
separator in "flat" case.
Index: javax/naming/CompoundName.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/naming/CompoundName.java,v
retrieving revision 1.7
diff -u -r1.7 CompoundName.java
--- javax/naming/CompoundName.java 5 May 2004 08:32:19 -0000 1.7
+++ javax/naming/CompoundName.java 12 Sep 2004 23:11:57 -0000
@@ -55,6 +55,8 @@
* direction is never described. If it means that the CompoundName
* can only have a single element, then the Enumeration-based
* constructor ought to throw InvalidNameException.
+ *
+ * @since 1.3
*/
public class CompoundName implements Name, Cloneable, Serializable
{
@@ -158,7 +160,7 @@
i += special.length ();
continue;
}
- else if (special == separator)
+ else if (direction != FLAT && special == separator)
{
elts.add (new_element.toString ());
new_element.setLength (0);