Community
Participate
Working Groups
20040430 ast.createInstance(Class nodeClass) declares to throw a runtime exception. It would be better to throw something more typed, like a IllegalArgumentException. Catching a 'RuntimeException' at the caller site is a very bad thing (it includes NullPointerException ect)
Actually, there are no exceptions that any client should catch; all are programming errors. I will revise specs for AST.createInstance(*) to clarify that IllegalArgumentException is thrown if client passes a bogus argument.
Also clarified spec for ASTNode.nodeClassForType(int) to say that it throws IllegalArgumentException when argument is bogus.
ok great. I was irritated by the Javadoc comment
Verified in 200405180816