codeconsole opened a new pull request, #3258:
URL: https://github.com/apache/groovy/pull/3258

   https://issues.apache.org/jira/browse/GROOVY-12723
   
   `ModifiesASTTransformation` rejected a bare `@Modifies` ("@Modifies requires 
a closure listing the modifiable targets; use @Modifies({}) to declare that 
nothing is modified") but took any other value that is not a closure, a list of 
strings for one, as an empty frame: `extractFromAnnotation` returned on a 
non-closure member, and `visit` then replaced the member with a class 
reference, so the annotation verifier never saw the original value. With 
`ModifiesChecker` on, `@Modifies(['this.stock', 'this.log'])` on a method that 
assigns `stock` was reported as "@Modifies violation: assignment to 'stock' but 
'stock' is not declared in @Modifies", the opposite of what the source says; 
without the checker it compiled with a frame that declared nothing.
   
   Every value that is not a `ClosureExpression` now gets the bare form's 
error, at the annotation, with the value found appended ("; found [this.stock, 
this.log]").
   
   Test: 
`ModifiesTests.modifies_with_a_list_of_strings_is_rejected_like_a_bare_modifies`,
 beside the existing bare-annotation test. `ModifiesTests` (16) and 
`ModifiesCheckerTest` (26) pass locally.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to