Method calling createVisibilityPassBasedSatelliteCommand() should handle being return "null"

Issue #125 resolved
William Bourque created an issue

In our implementation of Apogy, we Override createVisibilityPassBasedSatelliteCommand().

In certain case, we are unable to create a command inside the method createVisibilityPassBasedSatelliteCommand().

The simplest example I could show would be like:

@Override
public VisibilityPassBasedSatelliteCommand createVisibilityPassBasedSatelliteCommand(
            ObservationConstellationRequest request, VisibilityPass visibilityPass) {

    VisibilityPassBasedSatelliteCommand command = null; 

    if (!(request instanceof ObservationConstellationRequest) ||  !(request instanceof MyOwnDefinedRequestType) ) {
         return command;
    }
    else {
        //...more code
    }
}

However, this doesn't work : returning "null" out of createVisibilityPassBasedSatelliteCommand() cause exception to be raised later on.

In the example shown about, we return "null" on an unexpected request type; however we have some other much more complex conditions (related to angles calculation, mostly) where we would like to return "null" commands as well.

Right now we create "dummy" command that we discriminate when plan() is called, but it more a hack than anything else.

Comments (1)

  1. Log in to comment