[ mx4j-Bugs-938635 ] DescriptorSupport does not preserve case

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.java.mx4j.devel
Message-ID <[email protected]>
Bugs item #938635, was opened at 2004-04-20 17:10
Message generated for change (Comment added) made by biorn_steedom
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=938635&group_id=47745

Category: JMX implementation
>Group: Release 2.0.1
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Eamonn McManus (emcmanus)
>Assigned to: Simone Bordet (biorn_steedom)
Summary: DescriptorSupport does not preserve case

Initial Comment:
The JMX specification states (p96):

"Field names are not case sensitive. The field
descriptorType can also be referred to as
DescriptorType or DESCRIPTORTYPE. The case used when a
descriptor is created or updated is preserved."

The current MX4J implementation does not preserve case
as specified here. Instead, it forces the name of each
field to lowercase when the field is defined. This is
observable because e.g. getFieldNames() returns
all-lower-case names.

Fixing this bug is not as straightforward as it might
seem. The serial form must still contain a field
"descriptor" of type HashMap with keys of type String.
But the keys in this descriptor must preserve case.
Thus, the HashMap on its own is not enough to find the
value associated with a key (unless you search it
linearly).

Possible implementation strategies include having an
auxiliary data structure to translate from field names
to their canonical case as used in the HashMap; or
replacing the HashMap with a Map that is indexed with a
CaseInsensitiveString class that has the right
semantics. In the latter case, serialization magic is
needed to ensure that the serial form still has a
HashMap called "descriptor" where the keys are strings.

Fixing this bug unfortunately breaks serial
compatibility with implementations that have the bug
(include RI versions up to 1.2.1). Field names that are
not all-lower-case will not be gettable when
deserialized in such an implementaiton. It may
therefore be useful to specify a system property that
causes the field names to be forced to lower case when
serializing. (The RI uses jmx.serial.form=1.2.0 or 1.2.1)

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

>Comment By: Simone Bordet (biorn_steedom)
Date: 2004-09-07 17:04

Message:
Logged In: YES 
user_id=128193

Fixed.
I see that JMXRI 1.2.1 have this bug, while the JMX
implementation in JDK 5.0 does not.
I did not pay any attention to serialization compatibility
for now.
If many people complain, I will eventually add it.
Thanks for reporting it !

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=938635&group_id=47745


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
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.