[ 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 (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=450647&aid=938635&group_id=47745

Category: JMX implementation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Eamonn McManus (emcmanus)
Assigned to: Nobody/Anonymous (nobody)
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)

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

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: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&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.