compare() on command.getTime() should handle null

Issue #126 resolved
William Bourque created an issue

Internally, Apogy implements compare() method that it uses on command.getTime() to sort/order commands. The method is implemented in AbstractConstellationPlanner, around line 652 (method getRequestBasedSatelliteCommandsComparator() ).

However, it does not handles "null" values for Date(), which result in exception in some cases.

In our case, we sometime end up with "null" time when we create dummy command in our overriden createVisibilityPassBasedSatelliteCommand() (see: https://bitbucket.org/apogy/ca.gc.asc_csa.apogy/issues/125/method-calling).

The easy workaround is to make sure to do something like "command.setTime(new Date(0L))". However, my feeling is that for robustness' sake, null should be handled in the comparator instead.

Comments (2)

  1. Log in to comment