Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6402254
Votes 0
Synopsis Revisit ModelMBean DescriptorSupport implementation of equals and hashCode.
Category jmx:classes
Reported Against
Release Fixed 7(b33)
State 10-Fix Delivered, request for enhancement
Priority: 5-Very Low
Related Bugs
Submit Date 22-MAR-2006
Description
The ModelMBean DescriptorSupport implementation of equals & hascode is sub optimal.

   // XXXX TODO: This is not very efficient! 
    public synchronized boolean equals(Object o) {
        if (o == this)
            return true;
        
        return new ImmutableDescriptor(descriptorMap).equals(o);
    }

    // XXXX TODO: This is not very efficient! 
    public synchronized int hashCode() {
        return new ImmutableDescriptor(descriptorMap).hashCode();
    }
Posted Date : 2006-03-22 17:30:29.0
Work Around
N/A
Evaluation
I am not sure that DescriptorSupport instances will often be compared against objects that are not Descriptors.  However, the equals and hashCode implementations from ImmutableDescriptor could be factored out so that DescriptorSupport can use them without having to construct an ImmutableDescriptor.
Posted Date : 2006-03-23 15:21:55.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang