Closed GoogleCodeExporter closed 9 years ago
Note also that, after the quick fix, both Eclipse and (the original) javac can
compile the code without problems.
Original comment by ClovisSe...@gmail.com
on 25 Sep 2014 at 7:58
Hello,
Thank you for the report. When encountering bugs in Eclipse please do the
following.
Go to Eclipse->preferences->Checker Framework
Check the box "Show verbose output"
Then when you run the Checker Framework plugin, you will see command line
output appear in Eclipse's console window. Please copy and paste that to the
original issue.
I believe the issue is that we have a clean room implementation of this
annotation that differs from the version shown. This annotation appears on the
class path in front of Eclipse's when the Checker Framework is run.
I still get the error message:
/Users/jburke/Documents/workspace/Test/src/Test.java:16: error: annotation type
not applicable to this kind of declaration
abstract <F> Foo<@NonNull F> foo(F newValue);
Original comment by Jonathan...@gmail.com
on 25 Sep 2014 at 8:07
> "%JAVA_HOME%/bin/javac" -cp
C:\eclipse\plugins\org.eclipse.jdt.annotation_2.0.0.v20140415-1436.jar Foo.
java
(no error)
>c:\checker-framework-1.8.6\checker\bin\javac -cp
C:\eclipse\plugins\org.eclipse.jdt.annotation_2.0.0.v2
0140415-1436.jar Foo.java
Foo.java:10: error: annotation type not applicable to this kind of declaration
abstract <F> Foo<@NonNull F> foo(F newValue);
^
1 error
Original comment by ClovisSe...@gmail.com
on 25 Sep 2014 at 9:20
It appears that Eclipse has made a breaking, non-backward-compatible change to
their definition of the @NonNull annotation. It's a good change! But it's a
breaking one nonetheless.
The Checker Framework ships with a cleanroom reimplementation of Eclipse's old
@NonNull annotation, and it puts that on the classpath.
Here are some options:
* the Checker Framework continues to include its current reimplementation; this does not work for people expecting the new version of the Eclipse annotations.
* the Checker Framework updates its reimplementation; this does not work for people expecting the old version of the Eclipse annotations.
* the Checker Framework drops its reimplementation from its jar file; this leads to compilation errors for people who try to run the Checker Framework on code that includes the Eclipse annotations. They must manually include the appropriate cleanroom or real annotation implementations on the classpath.
* the Checker Framework has some way of detecting what version of the Eclipse annotations a developer was expecting to use and automatically chooses that one. I don't know how to implement this, and it sounds tricky.
I lean toward option #2, on the theory that very few people are currently using
the Eclipse annotations and those people are in the process of switching to the
newer ones.
An alternative that could give the best of all worlds (but is extra work, and
I'm not sure it's worth it!) is to add a flag to the Checker Framework javac to
enable putting user-specified items before checker.jar on the classpath.
A user can work around the problem by following the instructions in section
25.1, "Javac compiler" and ensuring that the appropriate items are on the
classpath before checker.jar, but that is not trivial to do.
Thoughts?
Original comment by michael.ernst@gmail.com
on 29 Sep 2014 at 9:53
Original comment by michael.ernst@gmail.com
on 10 Nov 2014 at 7:27
Original comment by jtha...@cs.washington.edu
on 20 Dec 2014 at 2:16
Original issue reported on code.google.com by
ClovisSe...@gmail.com
on 25 Sep 2014 at 7:54