class CodenarcViolationService { def violate(arg) { println 'foo bar' } }
-> Println Violation
import org.gcontracts.annotations.Requires class CodenarcViolationService { @Requires({arg}) def violate(arg) { println 'foo bar' } }
-> No Violation
I am so far unable to reproduce this problem. I added the test below to PrintlnRuleTest, and it produces the violation as expected.
@Test void testApplyTo_Println_AnnotatedMethod() { final SOURCE = ''' import org.gcontracts.annotations.Requires class CodenarcViolationService { @Requires({arg}) def violate(arg) { println 'foo bar' } } ''' assertSingleViolation(SOURCE, 6, "println 'foo bar'") }
Please reopen if this problem can be reproduced.
Log in to post a comment.
I am so far unable to reproduce this problem. I added the test below to PrintlnRuleTest, and it produces the violation as expected.
Please reopen if this problem can be reproduced.