View Javadoc
1   package com.sun.checkstyle.test.chapter6declarations.rule61numberperline;
2   
3   public class InputMultipleVariableDeclarations
4   {
5       int i, j; //warn
6       int i1; int j1; //warn
7   
8       void method1() {
9           String str, str1; //warn
10          java.lang.Object obj; Object obj1; //warn
11      }
12      // second definition is wrapped
13      // line of VARIABLE_DEF is not the same as first line of the definition
14      java.lang.String string; java.lang.String //warn
15          strings[];
16      //both definitions are wrapped
17      java.lang. //warn
18          String string1; java.lang.String
19              strings1[];
20  
21      void method2() {
22          for (int i=0, j=0; i < 10; i++, j--) { //ok
23          }
24  
25          for(int i=0; i<4;i++) {
26  
27          }
28      }
29  
30      class Inner {
31          int i, j; //warn
32          int i1; int j1; //warn
33  
34          void method1() {
35              String str, str1; //warn
36              java.lang.Object obj; Object obj1; //warn
37          }
38          // second definition is wrapped
39          // line of VARIABLE_DEF is not the same as first line of the definition
40          java.lang.String string; java.lang.String //warn
41              strings[];
42          //both definitions are wrapped
43          java.lang. //warn
44              String string1; java.lang.String
45                  strings1[];
46  
47          void method2() {
48              for (int i=0, j=0; i < 10; i++, j--) { //ok
49              }
50  
51              for(int i=0; i<4;i++) {
52  
53              }
54          }
55          Inner anon = new Inner()
56          {
57              int i, j; //warn
58              int i1; int j1; //warn
59  
60              void method1() {
61                  String str, str1; //warn
62                  java.lang.Object obj; Object obj1; //warn
63              }
64              // second definition is wrapped
65              // line of VARIABLE_DEF is not the same as first line of the definition
66              java.lang.String string; java.lang.String //warn
67                  strings[];
68              //both definitions are wrapped
69              java.lang. //warn
70                  String string1; java.lang.String
71                      strings1[];
72  
73              void method2() {
74                  for (int i=0, j=0; i < 10; i++, j--) { //ok
75                  }
76  
77                  for(int i=0; i<4;i++) {
78  
79                  }
80              }
81          };
82      }
83  }
84  
85  class Suppress {
86      @SuppressWarnings("unused") //warn
87      long q1, q2, q3;
88  
89      @SuppressWarnings("unused") long q4, q5, q6;  //warn
90  }