Expressions for annotation values and parameterized types.
Joe Darcy
Joe.Darcy at Sun.COM
Wed Jun 17 15:39:11 PDT 2009
Hello.
Gavin King wrote:
> Hi folks,
>
> something that has come up in JSR-299 is the fact that Java provides
> no easy expression syntax for:
>
> * annotation values
> * parameterized types
>
> We have to jump through hoops instead of being able to write:
>
> Named named = @Named( getName() );
>
> or:
>
> ParameterizedType<Set<Employee>> type = Set<Employee>.class;
>
> These problems certainly have (ugly) workarounds, and that's why 299
> introduces AnnotationLiteral and TypeLiteral, but it would be great if
> these helper classes could be hidden by the compiler.
>
> These issues are becoming more important as Java APIs move in the
> direction of greater typesafety.
>
> I'm happy to work on a more formal proposal if there is interest in
> addressing these issues.
The window to submit small language change proposals for JDK 7 expired
several months ago and we won't be accepting any more now. However, it
is still possible for library changes to be made in JDK 7 so if some
form of the improvements can be expressed as libraries, they might still
get in.
-Joe
More information about the coin-dev
mailing list