Ignore all annotations in all scopes if source is missing#10021
Ignore all annotations in all scopes if source is missing#10021niloc132 merged 1 commit intogwtproject:mainfrom
Conversation
| String code = Joiner.on('\n').join( | ||
| "package test;", | ||
| "import com.google.gwt.dev.jjs.impl.*;", | ||
| "public class EntryPoint<T extends " + annotations + " Object> {", |
There was a problem hiding this comment.
Should we go all-in here and add annotations everywhere allowed in source code so the test is basically a catch all test and not tailored to the available methods of JDT ASTVisitor (BinaryTypeReferenceVisitor)?
JDT knows additional scopes (Module, CompilationUnit, Method) and if we update JDT some visitor might change and we might not detect it here given visitors have default implementations. For example block scope could become method scope.
There was a problem hiding this comment.
Worth considering, but the ASTVisitor doesn't check those, so the particular code in question that is actively looking for binary type refs so that it can complain about them in the logs (and throw an exception) isn't going to fail, at least as I read it.
Would you contribute a test that does that? I'm guessing there is an example out there of all the different ways you can stack annotations that can be used to extend this. We'd need (at least) three instances of every location, to hit marker/normal/single.
…#10021) JDT supports three kinds of annotations, and the ASTVisitor lets them be encountered in two different scopes. This patch ensures that all six cases are handled, and adds a test that uses each of the six cases - removing any one of the `visit` implementations will fail the test by incorrectly reporting the annotation as not having sources available. Fixes gwtproject#10020
JDT supports three kinds of annotations, and the ASTVisitor lets them be encountered in two different scopes. This patch ensures that all six cases are handled, and adds a test that uses each of the six cases - removing any one of the `visit` implementations will fail the test by incorrectly reporting the annotation as not having sources available. Fixes #10020 See #10021
JDT supports three kinds of annotations, and the ASTVisitor lets them be encountered in two different scopes. This patch ensures that all six cases are handled, and adds a test that uses each of the six cases - removing any one of the
visitimplementations will fail the test by incorrectly reporting the annotation as not having sources available.Fixes #10020