A facility for getting the current method's name

Sebastian Sickelmann sebastian.sickelmann at gmx.de
Sat Oct 1 15:08:46 PDT 2011


Am 01.10.2011 23:40, schrieb Michael Ernst:
>> I think about this @NotNull annotation, how are these implemented?
> (This is slightly off the original topic of the thread.)
>
> A tool that checks a nullness annotation can be written as an annotation
> processor, which is invoked as part of running javac.  Or, the annotation
> can be checked by a separate tool that is not integrated with compilation.
>
> There are many different nullness annotations, and as many different tools
> for processing them.  You can see a list of nullness annotations at
> http://types.cs.washington.edu/checker-framework/current/checkers-manual.html#nullness-related-work
>
> 		    -Mike
Oh, i am sorry. I didn't meant "how the @NotNull" is implemented. Maybe 
the misunderstanding is caused by me weak English.

Isn't there a JSR for some annotations and standard processing of them? 
I only remember the @NotNull as an example.
Is it implemented as an extra annotation-processor so that everybody 
that want to use them has to specify it's usage.

Or is there a convenient way to plugin some Annotation Processors by 
default in javac?

I read something about sevice-style lookup in javadoc of 
javax.annotation.processing.Processor, is there a way to deliver
some default Processors(maybe @NotNull or @CurrentMethodName) within 
openjdk's javac?

-- Sebastian


More information about the jdk8-dev mailing list