You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Documentation differs from implementation as nowhere it is specified that this method returns null if playerNum doesn't match the case value. Which will also lead to the following method being affected also :
@Override
public String getPlayer(ConnectFourState state) {
return getPlayer(state.getPlayerToMove());
}
Referred snippet of code in this issue:
/**
* Returns the player corresponding to the specified player number. For
* efficiency reasons, <code>ConnectFourState</code>s use numbers
* instead of strings to identify players.
*/
public String getPlayer(int playerNum) {
switch (playerNum) {
case 1:
return players[0];
case 2:
return players[1];
}
return null;
}
The text was updated successfully, but these errors were encountered:
@roychowdhuryrohit-dev considering your point of @Nullable annotation addition makes the method String getPlayer(ConnectFourState state) {...} of same return type. Which is quite wrong as the method it is overriding from is of @nonnull return type method in aima.core.search.adversarial.Game. Here is the following error message :
The issue of ambiguity in specification is substantiated with is illustration. Sure, specification doesn't forbid null value type in return. But it is expected to return some value when called, which is inferred from it's usage in code.
Documentation differs from implementation as nowhere it is specified that this method returns
null
ifplayerNum
doesn't match the case value. Which will also lead to the following method being affected also :Referred snippet of code in this issue:
The text was updated successfully, but these errors were encountered: