-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation error when using Eclipse Neon with Plugin Development and with Enabled Null Anotations #229
Comments
I do see this error with JDT Core 3.12.0 but not with 3.12.1 (aka Neon.1). I plan to update to the latest 4.6 maintenance branch state this weekend. Hopefully I can get enough time. |
Hi, I actually see this in Neon .1 -> |
Well, I was only able to recreate with JDT 3.12.0. I'm not sure what is bundled with your Neon 20161007. You could look at the Installation Details for the org.eclipse.jdt.core plug-in. |
Hi, you are correct I am actually using org.eclipse.jdt.core 3.12.0. The strange thing is the following. |
That's the Groovy-Eclipse JDT patch. When I update this patch to 3.12.1, I believe your issue will be fixed. |
Can you retest with the latest snapshot? |
Confirmed. It works now. Thank you for all the help. |
Hi, since I updated my workspace to use Eclipse Neon I have a compilation error.
It goes away after I uninstall my latest Groovy-Eclipse plugin.
In my whole workspace I have many plugins, only one of which has groovy files and I used the Groovy-Eclipse plugin to work with that one.
The compilation error is completelly unrelated to the groovy plugin and it turns out that it is caused by the following compination of settings:
Plug-in Dev Environment, Groovy-Eclipse + Enabled Null annotations and some special classes.
I managed to isolate the problem in a dummy project containing 2 plugins with plugin2 depending on plugin1, which I attach here:
ws.zip
Bellow, the steps to reproduce:
1.I installed Neon (4.6.1 - Build id: 20161007-1200 ) from .zip file
2. I installed Eclipse Plug-in Development Environment from http://download.eclipse.org/releases/neon
3. I created 2 plugins. They are attached in ws.zip
4. Inside plugin1 I have the interface C.java:
public interface C {
A something();
}
With A and B being in a single java file:
import plugin1.test1.A.B;;
public interface A {
void method1();
interface B {
//
}
public static class B1 implements B {
public int b1;
}
}
I have an implementation of C in plugin1:
public class C1 implements C {
@OverRide
public A something() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
}
and an implementation of C in plugin2:
public class C2 implements C {
@OverRide
public A something() {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
}
Plugin2 requires Plugin1
my test package (containing all my classes) from plugin1 is exported at runtime
Install the groovy-eclipse plugin from http://dist.springsource.org/snapshot/GRECLIPSE/e4.6/
Version: 2.9.2.xx-201611151358-e46
clean&build the 2 plugins
If i enable the tracing (I enabled it on everything)
I see the following errors:
java.lang.IllegalStateException: Bad AST node structure:
typeArguments [161, 163] org.eclipse.jdt.core.dom.SimpleType
----------------------------------- SOURCE BEGIN -------------------------------------
package plugin2.test2;
import plugin1.test1.A;
import plugin1.test1.A.B1;
import plugin1.test1.C;
public class C2 implements C{
}
----------------------------------- SOURCE END -------------------------------------
at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:1486)
at org.eclipse.jdt.core.dom.CompilationUnitResolver.convert(CompilationUnitResolver.java:302)
at org.eclipse.jdt.core.dom.ASTParser.internalCreateAST(ASTParser.java:1216)
at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:812)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider$1.run(ASTProvider.java:551)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.createAST(ASTProvider.java:543)
at org.eclipse.jdt.internal.ui.javaeditor.ASTProvider.getAST(ASTProvider.java:486)
at org.eclipse.jdt.ui.SharedASTProvider.getAST(SharedASTProvider.java:128)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup.calculateASTandInform(SelectionListenerWithASTManager.java:173)
at org.eclipse.jdt.internal.ui.viewsupport.SelectionListenerWithASTManager$PartListenerGroup$3.run(SelectionListenerWithASTManager.java:158)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
But in the end i have no actual compilation error (altough the above is logged)
Enable null based anotations:
/instance/org.eclipse.jdt.core/org.eclipse.jdt.core.compiler.annotation.nullanalysis=enabled
Btw, In this dummy test project I do not use at all null annotations.
Clean and build
The result is that i will get a compilation error in C2:
"The return type is incompatible with C.something() C2.java"
and the previous error in error log.
This compiles fine when I uninstall the Groovy-Eclipse plugin OR when I disable the null annotations.
Also, If I extract the nested class B1 to separate file , the compilation error is also not there. But I would prefer not to do that (because in the real workspace, there might be many more examples like that).
In Eclipse Mars+corresponding groovy plugin, I didn't have this error.
It is very strange to me that the test projects I attach does not even use groovy .
The null annotations are also not used, that is why I assumed it is a bug.
In our real environment, our workaround for the moment is to uninstall the Groovy-Eclipse plugin, until it is actually needed.
Thank you.
The text was updated successfully, but these errors were encountered: