Community
Participate
Working Groups
HEAD The the method parameter 'arg' misses its annotations in the model (ILocalVariable#getAnnotations() is empty): void m(@SuppressWarnings("unused") int arg) { // annotations missing @SuppressWarnings("unused") int local; // annotations OK }
Created attachment 82875 [details] Regression test
I assume that the ILocalVariable is obtained through a codeSelect(...). In this case it looks like a recovery problem. The SelectionOnLocalName node doesn't contain the annotation in the case of an argument. David can you please investigate?
> I assume that the ILocalVariable is obtained through a codeSelect(...). Yes, via the first toolbar button in the JavaElements View. If I open the IVariableBinding for the parameter in the ASTView, select the LocalVariable Java element (the last child of the binding), and then choose Navigate > Show In > JavaElement View, then the resulting input element has an IAnnotation.
Created attachment 82951 [details] Propose fix Annotations wasn't attached to the selection node inside SelectionParser#consumeFormalParameter()
Released for 3.4M4. Tests added ResolveTests_1_5#test0111() -> test0112() CompilationUnitTests#testAnnotations24()
Verified (using the JavaElement View) for 3.4 M4 using build I20071210-1800