View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="RegexpMultiline">
4       <property name="format" value="System\.(out)|(err)\.print(ln)?\("/>
5     </module>
6   </module>
7   */
8   package com.puppycrawl.tools.checkstyle.checks.regexp.regexpmultiline;
9   
10  // xdoc section -- start
11  class Example2 {
12    void testMethod1() {
13      // violation below, 'Line matches the illegal pattern'
14      System.out.print("Example");
15      // violation below, 'Line matches the illegal pattern'
16      System.err.println("Example");
17      System
18        .out.print("Example");
19      System
20        .err.println("Example"); // violation, 'Line matches the illegal pattern'
21      System.
22        out.print("Example");
23      System.
24        err.println("Example"); // violation, 'Line matches the illegal pattern'
25    }
26  
27    void testMethod2() {
28      // violation below, 'Line matches the illegal pattern'
29      System.out.println("Test #1: this is a test string");
30      // violation below, 'Line matches the illegal pattern'
31      System.out.println("TeSt #2: This is a test string");
32      // violation below, 'Line matches the illegal pattern'
33      System.out.println("TEST #3: This is a test string");
34      int i = 5;
35      // violation below, 'Line matches the illegal pattern'
36      System.out.println("Value of i: " + i);
37      // violation below, 'Line matches the illegal pattern'
38      System.out.println("Test #4: This is a test string");
39      // violation below, 'Line matches the illegal pattern'
40      System.out.println("TEst #5: This is a test string");
41    }
42  }
43  // xdoc section -- end