Bugs item #886544, was opened at 2004-01-28 16:42
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=886544&group_id=22866

Category: JBossMX
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeff Haynie (jhaynie)
Assigned to: Nobody/Anonymous (nobody)
Summary: serialized ObjectName canonical value not equal

Initial Comment:
If you serialize an ObjectName and de-serialize it, the 
canonical name (and toString()) are not equal - although 
the object equality is true.

Example to program illustrate problem:

public class foo
{
    public static void main (String args[])
    {
        try
        {
            ObjectName obj=new ObjectName
("vocalos:type=Service,foo=bar,bar=foo");
            System.out.println(obj);

            ByteArrayOutputStream bos=new 
ByteArrayOutputStream();
            ObjectOutputStream oos=new 
ObjectOutputStream(bos);
            oos.writeObject(obj);

            ByteArrayInputStream bis=new 
ByteArrayInputStream(bos.toByteArray());
            ObjectInputStream ois=new ObjectInputStream
(bis);
            ObjectName obj2 = (ObjectName)ois.readObject
();

            // obj1 != obj2 (from a string value sense)
            System.out.println(obj2);

            System.out.println(obj.equals(obj2));

        }
        catch (Exception ex)
        {
            ex.printStackTrace();
        }

    }
}


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=886544&group_id=22866


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to