Originally posted by Mike Gershman:
Another way to think about this is that Java has several namespaces and the same identifier can have a different meaning in each namespace...
Exactly. In the above example, the
AmbiguousName is reclassified as an
ExpressionName because that variable is in scope.
Specifically (per 6.5.2), "the
AmbiguousName is a simple name, consisting of a single
Identifier, [and] ... the
Identifier appears within the scope ... of a local variable declaration..."