javac: ending positions generation and DiagnosticListener

Jonathan Gibbons jonathan.gibbons at
Fri Dec 6 13:42:08 PST 2013

Hi, Per,

If you can donate the class, that would be great (lawyers permitting)
but even if not, the suggestion of such a class is a good one.

Knowing your work on the javac Scope class, I can almost guess the
implementation without reading the code!

-- Jon

On 12/06/2013 01:41 PM, Per Bothner wrote:
> It is of course possible to implement the 'end-pos-table' much
> more compactly.  Currently, it uses a Map<JCTree, Integer> (see
> class SimpleEndPosTable in  This is of course
> very space-inefficient, as it requires an Integer object and
> a Map.Entry object for each entry.
> Kawa has a class IntHashTable which maps Object to int in an
> optimized fashion, with no per-entry allocation:
> This code was written by Charles Turner (as a Google Summer of Code 
> student),
> based on my design/suggestions.  The Kawa project (led by me) would be 
> happy
> to donate this class as a much-more efficient re-implementation of
> SimpleEndPosTable.  (If there is interest, as a courtesy I'll check 
> with Charles.)
> The code could probably be simplified a bit, as long as we don't
> care about general deletions, though replaceTree needs special handling.

More information about the compiler-dev mailing list