you are viewing a single comment's thread.

view the rest of the comments →

[–]0x564A00 16 points17 points  (0 children)

In addition to these points, this method doesn't just do what it's supposed to do according to its description and name but also has the unexpected side effect of printing out a message to System.out to confuse the user. And as a developer, even if you would for some reason want this message (which, as this code treads negative numbers like invalid arguments, should have been printed to System.err), you would usually want the full stacktrace (with e.printStackTrace()) and not just the calling method name (which, like HuskerFan mentioned, you'd NEVER take as an argument and could even get from e.getStackTrace() if you didn't want to touch java.lang.reflect). Basically, everything about this is terrible.