Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 255466

Summary: [Forms]MessageManager.Message.equals() returns incorrect results because of missing parentheses
Product: [Eclipse Project] Platform Reporter: Benjamin Cabé <contact>
Component: User AssistanceAssignee: Adam Archer <agarcher>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: caniszczyk, dejan
Version: 3.4.1   
Target Milestone: 3.5 M4   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 255460    
Attachments:
Description Flags
Patch
agarcher: iplog+
mylyn/context/zip none

Description Benjamin Cabé CLA 2008-11-16 13:49:11 EST
 
Comment 1 Benjamin Cabé CLA 2008-11-16 13:54:22 EST
Created attachment 118000 [details]
Patch

I don't know how it hasn't been reported sooner, because this is very annoying and can lead to the removal of a wrong message when calling removeMessage()
Comment 2 Benjamin Cabé CLA 2008-11-16 13:54:26 EST
Created attachment 118001 [details]
mylyn/context/zip
Comment 3 Chris Aniszczyk CLA 2008-11-16 17:54:41 EST
Adam, can you investigate?
Comment 4 Benjamin Cabé CLA 2008-11-17 00:21:10 EST
Since == > && > ?/   (see http://leepoint.net/notes-java/data/expressions/precedence.html for example)

msg.getPrefix() == null ? getPrefix() == null : msg.getPrefix().equals(getPrefix()) && msg.getControl() ...
is equivalent to
msg.getPrefix() == null ? getPrefix() == null : (msg.getPrefix().equals(getPrefix()) && msg.getControl() ...)
and this is bad :)
Comment 5 Chris Aniszczyk CLA 2008-11-24 11:55:43 EST
Adam, ping!
Comment 6 Chris Aniszczyk CLA 2008-11-24 12:02:01 EST
Dejan to the rescue?
Comment 7 Chris Aniszczyk CLA 2008-11-30 14:53:24 EST
Adam, ping.

Do you have time for this simple fix in 3.5M4? Please ;)?
Comment 8 Adam Archer CLA 2008-12-02 13:00:53 EST
Fix looks good. Patch applied to HEAD for M4.