View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="ModifiedControlVariable">
5         <property name="skipEnhancedForLoopVariable" value="true"/>
6       </module>
7     </module>
8   </module>
9   */
10  package com.puppycrawl.tools.checkstyle.checks.coding.modifiedcontrolvariable;
11  
12  // xdoc section -- start
13  class Example2 {
14    void InvalidExample() {
15      for(int i=0;i < 8;i++) {
16        i++; // violation, control variable modified
17      }
18      String args1[]={"Coding", "block"};
19      for (String arg: args1) {
20        arg = arg.trim();
21      }
22    }
23  }
24  // xdoc section -- end