Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 0.11.0
-
Component/s: scufl parser
-
Labels:None
-
Environment:Any - Noticed in Windows and Java 7
Description
BlockingControlLink allows both block and untilFinished to be null.
methond compareTo(Object o) calls copare(Object o) without first checking if they are null
This causes a null pointer exception.
Fix:
public int compareTo(Object o) {
if (!(o instanceof BlockingControlLink))
BlockingControlLink o1 = this;
BlockingControlLink o2 = (BlockingControlLink) o;
if ( o1.getUntilFinished() == null){
if (o2.getUntilFinished() == null)
} else {
int untilFinished = o1.getUntilFinished().compareTo(o2.getUntilFinished());
if (untilFinished != 0) { return untilFinished; }
}
if (o1.getBlock() == null) {
if (o2.getBlock() == null){ return 0; } else { return 1; }
}
int block = o1.getBlock().compareTo(o2.getBlock());
return block;
}
Activity
Field | Original Value | New Value |
---|---|---|
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Fix Version/s | 0.11.0 [ 10432 ] |