∞ “Duplicate field expected”
In my recent programming adventures, I separately encountered two perplexing error messages:
RuntimeException: Variable is used without definition!IllegalArgumentException: Duplicate field expected
Inspection of the underlying code brought clarity:
throw new RuntimeException("Variable " + m + " used without definition!");throw new IllegalArgumentException("Duplicate field " + fieldName);
The former was reporting a problem with a variable declared as InputStream is, the latter a problem with JUnit’s @Test annotation which defines a parameter java.lang.Class<? extends java.lang.Throwable> expected.
Tip from the pros: always wrap identifiers in quotes when including them in error messages.

For some reason (maybe the early hour) I found those examples hysterical. There is a related issue which comes up in scala all the time when people do something like shadow a type parameter: “Error: type ‘T’ expected but type ‘T’ found.” “WTF” people say, but it’s super noisy to fully qualify everything all the time, and the errors emerge from all kinds of different places, so now some places selectively expand but it’s a mixed bag.
P.S. Don’t name your variables “is”.