View Javadoc
1   /*
2   UpperEll
3   
4   
5   */
6   
7   package com.puppycrawl.tools.checkstyle.checks.upperell;
8   
9   /**
10   * Test case for detecting simple semantic violations.
11   * @author Lars Kühne
12   **/
13  class InputUpperEllSemantic
14  {
15      /* Boolean instantiation in a static initializer */
16      static {
17          Boolean x = new Boolean(true);
18      }
19  
20      static {
21          int a = 0;
22      }
23  
24      static {
25  
26      }
27  
28      /** test **/
29      private static final long IGNORE = 666l + 666L; // violation 'Should use uppercase 'L'.'
30  
31  
32      public void triggerEmptyBlockWithoutBlock()
33      {
34          // an if statement without a block to increase test coverage
35          if (true)
36              return;
37      }
38  
39      synchronized void foo() {
40          synchronized (this) {} // not OK
41          synchronized (Class.class) {
42              synchronized (new Object()) {
43                  // not OK if checking statements
44              }
45          }
46      }
47  }