Incorrectly invoking a static method with 0 parameters yields a NoSuchFieldException:
Incorrectly invoking an instance method with 0 parameters yields a message about fields as well:
Cause: The decision about whether to check for field access is done based on the arity of the dot invocation so the call to a field and a 0-arg method invocation are conflated.
Approach: Instead of checking field/method based on the arity of the dot invocation, do a check for a field of that name. This avoids going down field-checking paths for 0-arity method calls and yields a better exception for those cases. Error message was improved to list class name and the arity
Screened by: Stuart Sierra