Bug 390451 - org.eclipse.jface.util.Util.equals(null, []) returns false - causes CommandContributionItem update churn
Summary: org.eclipse.jface.util.Util.equals(null, []) returns false - causes CommandCo...
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks: 390379
  Show dependency tree
 
Reported: 2012-09-26 10:52 EDT by Karen Butzke CLA
Modified: 2012-11-22 19:18 EST (History)
4 users (show)

See Also:


Attachments
proposed patch against 4_2_maintenance (539 bytes, patch)
2012-09-26 10:55 EDT, Karen Butzke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2012-09-26 10:52:28 EDT
Util.equals(Object[], Object[] is returning false if one Object is null and the other is an empty array.

See bug 390379 for the performance problem that this causes in 4.2.
Comment 1 Karen Butzke CLA 2012-09-26 10:55:48 EDT
Created attachment 221515 [details]
proposed patch against 4_2_maintenance

This patch adds an additional check for one Object being null and the other being an empty array. Thus it will return true for this use case.

I think the javadoc comment of Util.equals should be updated as well. It claims that the "must not be <code>null</code>". But then the javadoc for each parameter says they can be null.
Comment 2 Paul Webster CLA 2012-10-26 09:20:50 EDT
That's an API method, and I'm loathe to change it's behaviour.  Perhaps we should fix it in BindingManagerEvent

PW
Comment 3 Paul Webster CLA 2012-10-26 09:25:27 EDT
back to bug 390379
Comment 4 Dani Megert CLA 2012-10-26 09:33:35 EDT
(In reply to comment #2)
> That's an API method, and I'm loathe to change it's behaviour.  Perhaps we
> should fix it in BindingManagerEvent
> 
> PW

+1.
Comment 5 Karen Butzke CLA 2012-10-26 09:49:58 EDT
+1 your fix in BindingManagerEvent looks good to me