Community
Participate
Working Groups
In ASTConverter.convertImport(org.eclipse.jdt.internal.compiler.ast.ImportReference importReference) I found the following code: if (modifiers != ClassFileConstants.AccDefault) { switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : importDeclaration.setFlags(importDeclaration.getFlags() | ASTNode.MALFORMED); break; case AST.JLS3 : if (modifiers == ClassFileConstants.AccStatic) { importDeclaration.setStatic(true); } else { importDeclaration.setFlags(importDeclaration.getFlags() | ASTNode.MALFORMED); } //{ObjectTeams: base imports: if (modifiers == ExtraCompilerModifiers.AccBase) { importDeclaration.setBase(true); } else { importDeclaration.setFlags(importDeclaration.getFlags() | ASTNode.MALFORMED); } // SH} } } This will make all static imports malformed. Shouldn't this be an else if? thanks and greetings Jan Marc
Well spotted. Thanks. That's actually the kind of defect I would have hoped the original JDT test suite would detect. Maybe we can improve the JDT tests in this regard ...
(In reply to comment #1) > Well spotted. Thanks. > > That's actually the kind of defect I would have hoped the original > JDT test suite would detect. > Maybe we can improve the JDT tests in this regard ... Well its quite a special case. Its no wonder a test hasn't triggered this bug since its not that critical. But still I am hoping to run the GOT OT extension through the Eclipse + OT tests. :=)
Created attachment 184425 [details] fix This patch contains the (simple) fix. Corresponding improvements of the jdt tests are in bug 331736.
Fix has been committed to trunk (r1117). Please reopen if you need it fixed also in 0.7.x
Verified for M4 using build 201012150343 (using code inspection). Additionally, once we move towards M5 the extra checks from bug 331736 will be executed during all tests.
*** Bug 334355 has been marked as a duplicate of this bug. ***