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
Currently, the methods verifyDatesRangeIsCorrect and verifySinceDateIsValid in the TimeUtil class are throwing ParseException which is a side effect that might not make sense when the methods are reused.
The exception thrown should be in the ArgsParser::parse method itself where they are used. Since these methods have been changed since when they were written to be a simple compareTo call, we can consider removing these methods and replacing the equivalent lines in ArgsParser::parse with the appropriate compareTo check and throw a ParseException if necessary.
The text was updated successfully, but these errors were encountered:
…thod (#2075)
ArgsParser::parse uses the methods verifyDatesRangeIsCorrect
and verifySinceDateIsValid from TimeUtil to throw a
ParseException if either of the checks fail. The throwing
of an exception in a utility method is a side effect
that makes the methods less reusable.
Let's move the throwing of ParseException from TimeUtil
into ArgsParser.
Currently, the methods
verifyDatesRangeIsCorrect
andverifySinceDateIsValid
in theTimeUtil
class are throwingParseException
which is a side effect that might not make sense when the methods are reused.RepoSense/src/main/java/reposense/util/TimeUtil.java
Lines 176 to 193 in 53d5197
The exception thrown should be in the
ArgsParser::parse
method itself where they are used. Since these methods have been changed since when they were written to be a simplecompareTo
call, we can consider removing these methods and replacing the equivalent lines inArgsParser::parse
with the appropriatecompareTo
check and throw aParseException
if necessary.The text was updated successfully, but these errors were encountered: