<div dir="ltr"><div>Hi,</div><div><br></div><div>Following previous discussions please find enclosed a patch for the issue referenced in JDK-8235457.</div><div><br></div><div>The com.sun.tools.javac.model.JavacElements#matchAnnoToTree() method (line 275) is invoked when reporting a message on an annotation on an element to return the tree for an annotation given the annotated element, this allows the compiler to output the correct line where the message should be displayed, however in the "Vis" class within the method the JCModuleDecl has probably been forgotten when modules were introduced in JDK-9 leading to an AssertionError crashing the compiler when an annotation processor tries to report a message on a module's annotation.</div><div><br></div><div>In order to fix the issue, I've simply implemented the missing method visitModuleDef() in the Vis class so that modules' annotations are properly returned.</div><div><br></div><div>You'll find a jtreg test in the patch as well, I've actually created three modules for the test: <br></div><div>- annotation: which defines a simple module annotation</div><div>- processor: which provides the annotation processor reporting a message on the module's annotation</div><div>- mod: which contains a module annotated with the previous annotation</div><div><br></div><div>The test is successful when the test run without error and the message is properly displayed by the compiler.</div><div><br></div><div>I didn't find a way to use jtreg tags to compile modules, so I've decided to compile everything programmatically in the test main() method.<br></div><div><br></div><div>Please let me know if I can be of <span class="gmail-text" lang="en">any further assistance.</span></div></div>