RE: Question: Duplicate strings

"Tim Anderson" <tima-k+1zm/[email protected]>
Newsgroups gmane.comp.java.openjms.devel
Message-ID <[email protected]>
I'd agree but for the fact that it states that all message property
methods must copy their objects, even though there are no set*Property
methods
which take mutable objects.

Regards,

Tim

> -----Original Message-----
> [mailto:openjms-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org]On Behalf Of ¿ÀÁö¿õ
> Subject: RE: [openjms-developer] Question: Duplicate strings
> > From: openjms-developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org [mailto:openjms-
> > developer-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org]On Behalf Of Tim Anderson
> >
> > It's done for specification compliance. From section 3.12 of
> > the JMS spec:
> >
> > "The JMS message interfaces provide write/set methods for
> > setting object
> >  values in a message body and message properties. All of
> > these methods must
> >  be implemented to copy their input objects into the message."
> >
> > Off the top of my head, I can't think of a truly compelling
> > reason why this
> > is stated,
> > other than to ensure provider interoperability eg, it would
> > be wrong given
> > the above for
> > a client to make assumptions about the memory addresses of
> > properties added:
> >
> >   String foo = "foo";
> >   message.setStringProperty("bar", foo);
> >   if (message.getStringProperty("bar") == foo) {
> >       // should always be false on a compliant provider
> >   }
>
> Strictly speaking, you're right.
> But the purpose of the spec MAY BE mutable objects (particularly
> byte[]), not immutables.
> These get(set) methods are related:
> 	getJMSCorrelationIDAsBytes, getJMSReplyTo,
> getJMSDestination, getBytes, getObject
>
> --
> OH Jiung   [email protected]
> Samsung SDS
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by:
> SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
> http://www.vasoftware.com
> _______________________________________________
> openjms-developer mailing list
> openjms-developer-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/openjms-developer
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.