I am concerned about the initial check: if (letterGrade == null || letterGrade.trim().length() == 0) return true;
... in which case we are saying that a null or zero length string is a valid grade. I looked as some of the calling functions and they inconsistently check the passed in letterGrade value for null and or empty string. Judging from this it seems that the initial check should return "false" but we need further investigate this to make sure that this is not an expected side effect.
Currently the GradeCalculations.isValidLetterGrade(String letterGrade) is implemented as follows:
public boolean isValidLetterGrade(String letterGrade) {
if (letterGrade == null || letterGrade.trim().length() == 0)
return true;
return letterGradeMap.containsKey(letterGrade.toUpperCase());
}
I am concerned about the initial check:
if (letterGrade == null || letterGrade.trim().length() == 0)
return true;
... in which case we are saying that a null or zero length string is a valid grade. I looked as some of the calling functions and they inconsistently check the passed in letterGrade value for null and or empty string. Judging from this it seems that the initial check should return "false" but we need further investigate this to make sure that this is not an expected side effect.