I'm guessing OP's code used to return an error message
Actually, no. The code here was originally
meant to be called similarly to the Guava library
. So, something like this:
String checked = Preconditions.checkNotNull(argv, "the input was null"); // throws NullPointerException
String thing = validator.validateThing(argv, "thing", "thingy"); // throws IllegalArgumentException
But, the other Guava precondition check methods in that class don't return their argument, and in the code that calls our validators the return value is always discarded. So, I think I should just make them
return types, like _leonardo_ suggests...
My WTF, perhaps?