There are few areas in Resolve.java that need some cleanup. In fact, when overload resolution was first implemented in gjc there was no support for autoboxing, enums, varargs - in other words, overload resolution was a lot easier than it is now.
Today Resolve has become more complex (overload resolution done in 3-step process) and the main reason for which resolution diagnostic look so outdated is that the diagnostic-related part of Resolve.java hasn't really been restructured in order to accomodate the new changes in method resolution (coming from other JSRs).
Just a snapshot of the current situation:
we have 5 kinds of symbol we might want to resolve:
-VARIABLE
-TYPE
-METHOD
-CONSTRUCTOR
-OPERATOR
and we have 3 possible outcomes for resolution
-SYMBOL NOT FOUND
-WRONG SYMBOL FOUND
-MANY WRONG SYMBOLS FOUND
With a simple calculation it seems like we'd need to be able to deal with 15 possible error conditions (well some of them aren't really valid, as [FIELD, MANY WRONG SYMBOLS FOUND] - but you got the idea].
In Resolve.java error messages are generated by means of ResolveError and its subclasses - where each subclass is meant to represent a different error category.
-ResolveError extends Symbol
-AccessError extends ResolveError
-AmbiguityError extends ResolveError
-StaticError extends ResolveError
All the 15 erroneous conditions above are mapped into the very same ResolveError base class - in other words the hierarchy of erroneous symbols is highly unbalanced. ResolveError has a lot of stuff to do when a diagnostic is to be generated, while other classes are significantly simpler. This is bad because (i) ResolveError is forced to generate high-level error messages that could apply (with slight variations) to all the 15 cases listed above.
Because of this design problem, any work on resolution diagnostic is likely to be hard (see 5088624).