1   package com.puppycrawl.tools.checkstyle.checks.coding.declarationorder;
2   
3   import java.util.ArrayList;
4   import java.util.List;
5   
6   import com.puppycrawl.tools.checkstyle.api.TokenTypes;
7   
8   public class InputDeclarationOrderForwardReference {
9   
10      public static final int TAB_LENGTH = 4;
11      private static final ArrayList<String> EMPTY_ARRAY_LIST = new ArrayList<String>();
12      public static final int MAX_INT = Integer.MAX_VALUE; // violation
13      public static final int MAX_BYTE = Byte.MIN_VALUE; // violation
14      public static final int ROWS = 18; // violation
15      public static final int COLUMNS = 18; // violation
16      public static final int TYPE_SIZE = 12; // violation
17      public static final int TABLE_SIZE = 184; // violation
18      public static final int INFRASTRUCTURE_SIZE = TYPE_SIZE
19          + MAX_BYTE
20          + TABLE_SIZE;
21      public  static final int MAX_LINE_LENGTH = 96 + TAB_LENGTH;
22  
23      public static final double MIN_MATCH = 0.60; // violation
24      public static final double EXACT_CLASS_NAME_MATCH = MIN_MATCH + 0.1;
25  
26      private static final String COMMON_PART = "common_part";
27      public static final String FIRST = COMMON_PART + "2";
28  
29      private static final String SECOND = String.valueOf(TokenTypes.ELIST) + FIRST;
30      public static final String THIRD = FIRST;
31  
32      private static int ID = 5;
33      public static final String FOURTH = "1"
34          + ID
35          + COMMON_PART;
36  
37      private int a = 1;
38      public int b = a + 2;
39  
40      public static void foo1() {}
41      public static final double MAX = 0.60; // violation
42      public static void foo2() {}
43  
44      void foo3() {
45          int i = 5;
46      }
47  }
48  class InputDeclarationOrderFieldAnonymousClass {
49  
50      private static final String[] REQUIRED_WORKDS = new String[] { "copyright" };
51  
52      enum RequiredHeaderPlacement {
53          TEMP;
54          
55          public static String[] labels() {
56              String[] labels = new String[values().length];
57              return labels;
58          }
59      }
60  
61      public static final String[] HEADER_PLACEMENT_DESCRIPTOR = RequiredHeaderPlacement.labels();
62  }