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

Bug 363505

Summary: MultiStatus matches does not include children statuses
Product: [Eclipse Project] Equinox Reporter: Malgorzata Janczarska <malgorzata.tomczyk>
Component: ComponentsAssignee: equinox.components-inbox <equinox.components-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, pwebster, remy.suen, tjwatson
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 363074    

Description Malgorzata Janczarska CLA 2011-11-10 12:03:35 EST
MultiStatus#matches method should return true if any of the children matches the severityMask.
This way if MultiStatus contains a mixture of statuses of a different severity we could simply check for given severity. An example use of it is bug 363074.
Comment 1 Thomas Watson CLA 2011-11-10 12:35:04 EST
CC'ing John for his opinion on this behavior change request.  It may have made more sense to have the severity of a MultiStatus be an or'ing of all of its children statuses.  Unfortunately we cannot do that since the javadoc of org.eclipse.core.runtime.IStatus.getSeverity() clearly states that only one of the status type bits is set (e.g OK, INFO, WARNING, ERROR or CANCEL)
Comment 2 John Arthorne CLA 2011-11-10 14:09:25 EST
I don't think it is safe to change this. Currently the severity of a MultiStatus is the max of the severity of its children. Which means a test like MultiStatus.matches(IStatus.WARNING | IStatus.INFO) implies that no errors occurred. This is a pretty reasonable test for a client do to and I have seen this kind of code in various places. They would be broken if a MultiStatus containing an ERROR and an INFO now returns true for matches(IStatus.INFO) where it didn't before.
Comment 3 Thomas Watson CLA 2011-11-10 14:44:37 EST
(In reply to comment #1)
> CC'ing John for his opinion on this behavior change request.  It may have made
> more sense to have the severity of a MultiStatus be an or'ing of all of its
> children statuses.  Unfortunately we cannot do that since the javadoc of
> org.eclipse.core.runtime.IStatus.getSeverity() clearly states that only one of
> the status type bits is set (e.g OK, INFO, WARNING, ERROR or CANCEL)

Thanks John, I agree this is not a safe change.