JDK-5095277 : CompositeDataSupport.equals does not compare arrays element-by-element
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-09-01
  • Updated: 2017-05-16
  • Resolved: 2005-05-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b37Fixed
Related Reports
Relates :  
Description
If you call cd1.equals(cd2), where cd1 is a CompositeDataSupport and cd2 is an object implementing CompositeData (e.g. another CompositeDataSupport), and if cd1 and cd2 have the same CompositeType that includes at least one item of type ArrayType, then the contents of each such array should be compared element by element.  Currently only the array identities are compared, which means that equals returns true if the two objects refer to the same array but not if they refer to different arrays with the same contents.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
02-09-2004

PUBLIC COMMENTS .
02-09-2004

EVALUATION Straightforward to fix using java.util.Arrays.deepEquals. ###@###.### 2004-09-01
01-09-2004

WORK AROUND Test equality yourself by using a loop that compares the items in each CompositeData, using Arrays.equals for array items. ###@###.### 2004-09-01
01-09-2004

SUGGESTED FIX Use Arrays.equals to compare the array contents. ###@###.### 2004-09-01
01-09-2004