Changed constructors of WaypointImpl: PassingInstruction cannot be null, an IllegalArgumentException is thrown. If only a ControlPoint is used, the PassingInstructions are None.

This commit is contained in:
Nick Klose committed 2014-01-29 15:55:45 +01:00
1 parent 1116bb9440
commit 5e959a7a26
1 file changed
+4 -1
@@ -16,7 +16,7 @@ public class WaypointImpl implements Waypoint {
private final Bearing fixedBearing;
public WaypointImpl(ControlPoint controlPoint) {
this(controlPoint, /*ControlPoint*/null, /*Bearing*/null);
this(controlPoint, PassingInstruction.None, /*Bearing*/null);
}
public WaypointImpl(ControlPoint controlPoint, PassingInstruction passingInstructions) {
@@ -24,6 +24,9 @@ public class WaypointImpl implements Waypoint {
}
public WaypointImpl(ControlPoint controlPoint, PassingInstruction passingInstructions, Bearing fixedBearing) {
if (passingInstructions == null){
throw new IllegalArgumentException("PassingInstructions cannot be null");
}
this.controlPoint = controlPoint;
this.passingInstructions = passingInstructions;
this.fixedBearing=fixedBearing;