Annotation processing with m2eclipse and m2e-apt

85 views
Skip to first unread message

thomas....@gmail.com

unread,
Sep 29, 2016, 10:55:24 AM9/29/16
to Checker Framework discussion
Hello Group,

I'd like to execute the Checker Framework annotation processors within Eclipse using m2eclipse and the m2e-apt connector. I'm getting an IllegalArgumentException I guess because of the Eclipse compiler being used instead of Javac :

java.lang.IllegalArgumentException
    at com
.sun.source.util.JavacTask.instance(JavacTask.java:66)
    at org
.checkerframework.javacutil.AbstractTypeProcessor.init(AbstractTypeProcessor.java:116)

Is this intentional ? Is the Checker Eclipse plugin the only way to go in Eclipse then ?

Thank you and kind regards,

Thomas

Michael Ernst

unread,
Sep 29, 2016, 11:14:00 AM9/29/16
to thomas friedli, Checker Framework Discussions
Thomas-

Unfortunately, ejc/eclipsec represents a Java program differently than
javac does. The Checker Framework currently uses the javac
representation, so it only works as a plug-in to javac, not ejc/eclipsec.
(This is mentioned in the manual:
http://types.cs.washington.edu/checker-framework/current/checker-framework-manual.html#eclipse
.) It would take significant engineering work to adapt the Checker
Framework to the Eclipse representation, and other priorities are more
pressing at the moment.

-Mike


> Subject: Annotation processing with m2eclipse and m2e-apt
> From: thomas....@gmail.com
> To: Checker Framework discussion
> <checker-fram...@googlegroups.com>
> Date: Thu, 29 Sep 2016 07:02:33 -0700 (PDT)
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Checker Framework discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to checker-framework-...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

thomas....@gmail.com

unread,
Sep 30, 2016, 2:09:28 PM9/30/16
to Checker Framework discussion, thomas....@gmail.com
Thank you Mike,

Has such a project to adapt/extend the Checker Framework started yet and is there a way to contribute ?

Thomas

Michael Ernst

unread,
Sep 30, 2016, 2:13:38 PM9/30/16
to thomas friedli, Checker Framework Discussions
Thomas-

> Has such a project to adapt/extend the Checker Framework started yet

I'm not aware of one.

I think the cleanest way to do this would be to create an abstraction of
the AST (including type resolution information), making both Eclipse and
javac support it, and then implementing the analysis in terms of that
common API.

As mentioned in the Checker Framework manual at
http://types.cs.washington.edu/checker-framework/current/checker-framework-manual.html#eclipse
, there was even a Java Specification Request about this: JSR 198, A
Standard Extension API for Integrated Development Environments
(https://jcp.org/en/jsr/detail?id=198). Although it was originally
submitted by Oracle, Oracle seems to have cooled on the idea and it has
never been implemented, so far as I know.

-Mike


> Subject: Re: Annotation processing with m2eclipse and m2e-apt
> From: thomas....@gmail.com
> To: Checker Framework discussion
> <checker-fram...@googlegroups.com>
> Date: Thu, 29 Sep 2016 23:15:41 -0700 (PDT)
> > an email to checker-framework-...@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Checker Framework discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to checker-framework-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages