1   package com.google.checkstyle.test.chapter4formatting.rule488numericliterals;
2   
3   class InputUpperEll
4   {
5       /** test **/
6       private final long IGNORE = 666l + 666L; //warn
7   
8       private String notWarn = "666l"; //ok
9   
10      private long foo()
11      {
12          processUpperEll(66l); //warn
13          processUpperEll(66L); //ok
14          processUpperEll("s", 66l); //warn
15          processUpperEll("s", 66L); //ok
16  
17          return 666l + 666L; //warn
18      }
19  
20      private void processUpperEll(long aLong) {
21          long bad = (4+5*7^66l/7+890) //warn
22                  & (88l + 78 * 4); //warn
23          long good = (4+5*7^66L/7+890) & (88L + 78 * 4); //ok
24          long[] array = {
25              66l, //warn
26              66L, //ok
27          };
28      }
29  
30      private void processUpperEll(String s, long l) {}
31  
32      class Inner {
33          /** test **/
34          private static final long IGNORE = 666l + 666L; //warn
35  
36          private static final String notWarn = "666l"; //ok
37  
38          private long foo()
39          {
40              processUpperEll(66l); //warn
41              processUpperEll(66L); //ok
42              processUpperEll("s", 66l); //warn
43              processUpperEll("s", 66L); //ok
44  
45              return 666l + 666L; //warn
46          }
47  
48          private void processUpperEll(long aLong)
49          {
50              long bad = (4+5*7^66l/7+890) //warn
51                      & (88l + 78 * 4); //warn
52              long good = (4+5*7^66L/7+890) & (88L + 78 * 4); //ok
53          }
54          private void processUpperEll(String s, long l) {
55              long[] array = {
56                      66l, //warn
57                      66L, //ok
58                  };
59          }
60  
61          void fooMethod()
62          {
63              Foo foo = new Foo() {
64                  /** test **/
65                  private final long IGNORE = 666l + 666L; //warn
66  
67                  private String notWarn = "666l"; //ok
68  
69                  private long foo()
70                  {
71                      processUpperEll(66l); //warn
72                      processUpperEll(66L); //ok
73                      processUpperEll("s", 66l); //warn
74                      processUpperEll("s", 66L); //ok
75  
76                      return 666l + 666L; //warn
77                  }
78  
79                  private void processUpperEll(long aLong) {
80                      long bad = (4+5*7^66l/7+890) //warn
81                              & (88l + 78 * 4); //warn
82                      long good = (4+5*7^66L/7+890) & (88L + 78 * 4); //ok
83                      long[] array = {
84                          66l, //warn
85                          66L, //ok
86                      };
87                  }
88  
89                  private void processUpperEll (String s, long aLong) {}
90              };
91          }
92      }
93  
94      class Foo {}
95  
96      interface Long {
97          public static final long IGNORE = 666l + 666L; //warn
98          public static final String notWarn = "666l"; //ok
99          long bad = (4+5*7^66l/7+890) //warn
100                 & (88l + 78 * 4); //warn
101         long good = (4+5*7^66L/7+890) & (88L + 78 * 4); //ok
102     }
103 }
104 
105 
106