United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6255956 Descriptor should define equals method and specify how array values are compared
JDK-6255956 : Descriptor should define equals method and specify how array values are compared

Details
Type:
Enhancement
Submit Date:
2005-04-15
Status:
Resolved
Updated Date:
2010-07-29
Project Name:
JDK
Resolved Date:
2005-06-25
Component:
core-svc
OS:
generic
Sub-Component:
javax.management
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports

Sub Tasks

Description
The Descriptor interface should acquire an equals(Object) method that specifies how Descriptors are compared for equality.  This method should say:

Compare this descriptor to another one.  The objects are equal if they have the same field names (possibly differing in case) and the same associated values.  Values that are primitive arrays of the same type are equal if they have the same elements.  Values that are object arrays are equal if they compare equal with {@link Arrays#deepEquals(Object,Object)}.

The interface should also define hashCode() with a definition that is consistent with this definition of equals.

The implementation classes DescriptorSupport and ImmutableDescriptor should of course follow this specification.  ImmutableDescriptor could also provide static convenience methods equals(Descriptor,Descriptor) and hashCode(Descriptor), though that might be overkill.
###@###.### 2005-04-15 15:44:28 GMT

                                    

Comments
EVALUATION

Straightforward fix that would be consistent with practice in e.g. the Collections API.
###@###.### 2005-04-15 15:55:23 GMT
                                     
2005-04-15



Hardware and Software, Engineered to Work Together