- priority: 5 --> 2
- assigned_to: nobody --> jmccarter2005
May places in the code don't use collection interfaces as the type of a variable but instead use a concrete implementation as the type. So for example within ConcreteStateModel we see:
public Transition[] getTransitionsFromState(State state) {
ArrayList resultsList = new ArrayList();
A better Java idiom is use the interface as the type of the variable:
public Transition[] getTransitionsFromState(State state) {
List resultsList = new ArrayList();
The worst place to use the concrete type of a list is in method declaration such as StandardEngines method definition here:
protected Fork addStatesFromForkPathToList(StateModel model, Transition toJoinTransition, ArrayList<State> stateList) {
As the type of the list is ArrayList<State> you lock any future use of a different type of list being passed in the future e.g. Collections.synchronisedList(someArrayList). It is recommended that the method signature is
protected Fork addStatesFromForkPathToList(StateModel model, Transition toJoinTransition, List<State> stateList) {