Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363505 - MultiStatus matches does not include children statuses
Summary: MultiStatus matches does not include children statuses
Status: RESOLVED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Components (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: equinox.components-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 363074
  Show dependency tree
 
Reported: 2011-11-10 12:03 EST by Malgorzata Janczarska CLA
Modified: 2011-11-11 10:29 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.