View Javadoc
1   package com.puppycrawl.tools.checkstyle.grammar.antlr4;
2   
3   public class InputAntlr4AstRegressionSingleLineBlocks {
4   
5       public void testMethod() {}; // ok
6   
7       public void testMethod1() {
8       }; // violation
9   
10      public class TestClass {}; // ok
11  
12      public class TestClass1 {
13      }; // violation
14  
15      public class TestClass2 {
16          public TestClass2() {}; // ok
17  
18          public TestClass2(String someValue) {
19          }; // violation
20      }
21  
22      public void testMethod11() {
23      }
24      ;
25  
26      public @interface TestAnnnotation5 {
27          String someValue(); }; // violation
28  
29      public @interface TestAnnotation6 {}; // ok
30  
31      public @interface TestAnnotation7 {
32          String someValue();
33      }; // violation
34  
35      public @interface TestAnnotation8 { String someValue();
36      }; // violation
37  
38      public @interface TestAnnotation9 { String someValue(); }; // ok
39  
40      enum TestEnum{}; // ok
41  
42      enum TestEnum1{
43          SOME_VALUE;}; // violation
44  
45      enum TestEnum2 { SOME_VALUE; }; // ok
46  
47      enum TestEnum3{
48          SOME_VALUE;
49      }; // violation
50  
51      enum TestEnum4{ SOME_VALUE;
52      }; // violation
53  
54      interface Interface1
55      {
56          int i = 1;
57          public void meth1(); }; // violation
58  
59      interface Interface2
60      { int i = 1; public void meth1(); };
61  
62      interface Interface3 {
63          void display();
64          interface Interface4 {
65              void myMethod();
66          };}; // 2 violations
67  
68      interface InterfaceEndingWithSemiColon2 {
69          public void fooEmpty();
70      }; // violation
71  }