Joseph D. Darcy Joe.Darcy at Sun.COM
Mon Apr 21 20:33:24 UTC 2008

Rémi Forax wrote:
> Hi all,
>  Is someone knows why package sun.reflect.generics is so complex ?

Because it was written by Gilad ;-)

>  This package (and subpackage) it used to reify a generics signatures
>  to a java.lang.reflect.Type tree.
>  It creates a parser, parse the signature to create an AST,
>  and use a visitor to create the tree.
>  This package, contains in my opinion, lot of unecessary garbage.
>  - It creates an AST even if the Type tree can be created in one pass.
>  - A bunch of interfaces has only one implementation like Visitor.
>  - Use a visitor even if there is only one operation.
>  - Use lots of generics can be removed because only one instanciation
>    is used.

While the code is a bit elaborate compared to the minimum needed for the 
task at hand, I think it is otherwise well-structured and there are no 
plans to refactor it.


More information about the core-libs-dev mailing list