Direct extension method use warning

Thomas Jung thomas.andreas.jung at googlemail.com
Tue Dec 7 00:22:56 PST 2010


> (A further problem with use-site extension methods is the lack of reflective
> discovery.  Consumers of classfiles (such as non-Java compilers like JRuby, as
> well as templating mechanism such as JSP EL) cannot easily find these
> extension methods.)

Wouldn't it be useful to annotate a method (e.g. Collection.sort) as
an extension method implementation? Users that invoke the method
directly would get a (deprecation) warning. (The annotation is not
strictly necessary as the extension method declaration makes it
implicitly an extension method implementation.) This warning could
help to move to the "new style".

Thomas


More information about the lambda-dev mailing list