minor formatting and mini refactoring

This commit is contained in:
Axel Uhl committed 2015-07-02 10:13:03 +02:00
1 parent 861138c139
commit b7fb1d6dd6
3 files changed
+11 -18

No files matched your search

@@ -391,20 +391,17 @@ public class RaceLogRaceTracker implements RaceTracker, GPSFixReceivedListener {
}
private void onCourseDesignChangedEvent(RaceLogCourseDesignChangedEvent event) {
if (trackedRace == null)
return;
CourseBase base = new LastPublishedCourseDesignFinder(params.getRaceLog()).analyze();
List<Util.Pair<ControlPoint, PassingInstruction>> update = new ArrayList<>();
for (Waypoint waypoint : base.getWaypoints()) {
update.add(new Util.Pair<>(waypoint.getControlPoint(), waypoint.getPassingInstructions()));
}
try {
trackedRace.getRace().getCourse().update(update, params.getDomainFactory());
} catch (PatchFailedException e) {
logger.log(Level.WARNING, "Could not update course for race " + trackedRace.getRace().getName());
if (trackedRace != null) {
CourseBase base = new LastPublishedCourseDesignFinder(params.getRaceLog()).analyze();
List<Util.Pair<ControlPoint, PassingInstruction>> update = new ArrayList<>();
for (Waypoint waypoint : base.getWaypoints()) {
update.add(new Util.Pair<>(waypoint.getControlPoint(), waypoint.getPassingInstructions()));
}
try {
trackedRace.getRace().getCourse().update(update, params.getDomainFactory());
} catch (PatchFailedException e) {
logger.log(Level.WARNING, "Could not update course for race " + trackedRace.getRace().getName());
}
}
}
@@ -23,7 +23,6 @@ public class CourseDataImpl extends NamedImpl implements CourseBase {
@Override
public List<Leg> getLegs() {
// TODO Auto-generated method stub
return null;
}
@@ -72,7 +71,6 @@ public class CourseDataImpl extends NamedImpl implements CourseBase {
@Override
public Leg getFirstLeg() {
// TODO Auto-generated method stub
return null;
}