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