View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="RegexpSinglelineJava">
5         <property name="format" value="debug"/>
6         <property name="ignoreCase" value="true"/>
7         <property name="ignoreComments" value="true"/>
8       </module>
9     </module>
10  </module>
11  */
12  package com.puppycrawl.tools.checkstyle.checks.regexp.regexpsinglelinejava;
13  
14  import java.io.FileReader;
15  import java.io.FileWriter;
16  import java.io.IOException;
17  import java.util.logging.Logger;
18  
19  // xdoc section -- start
20  class Example3 {
21  
22    private void testMethod1() {
23      int debug = 0; // violation, 'Line matches the illegal pattern'
24      System.out.println("");
25      System.out.
26      println("");
27    }
28  
29    private void testMethod2() throws IOException {
30      FileReader in = new FileReader("path/to/input");
31      int ch = in.read();
32      while(ch != -1) {
33        System.out.print((char)ch);
34        ch = in.read();
35      }
36  
37      FileWriter out = new FileWriter("path/to/output");
38      out.write("something");
39    }
40  
41    public void testMethod3(){
42      final Logger logger = Logger.getLogger(Example3.class.getName());
43      logger.info("first");
44      logger.info("second");
45      logger.info("third");
46      System.out.println("fourth");
47      logger.info("fifth");
48    }
49  }
50  // xdoc section -- end