mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
[300586] (comment#9) - Simplified tracking maximum status code value.
This commit is contained in:
parent
426d7eb9c5
commit
73f10c6e73
1 changed files with 6 additions and 12 deletions
|
@ -50,18 +50,12 @@ public class DsfMultiStatus extends MultiStatus {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getCode() {
|
||||
IStatus[] children = getChildren();
|
||||
if (children.length != 0) {
|
||||
int maxCode = Integer.MIN_VALUE;
|
||||
for (IStatus status : children) {
|
||||
if (status.getCode() > maxCode) {
|
||||
maxCode = status.getCode();
|
||||
}
|
||||
}
|
||||
return maxCode;
|
||||
} else {
|
||||
return super.getCode();
|
||||
public void add(IStatus status) {
|
||||
super.add(status);
|
||||
int newCode = status.getCode();
|
||||
if (newCode > getCode()) {
|
||||
setCode(newCode);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue