View Javadoc
1   /*
2   MethodLength
3   max = (default)150
4   countEmpty = (default)true
5   tokens = (default)METHOD_DEF , CTOR_DEF , COMPACT_CTOR_DEF
6   
7   
8   */
9   
10  package com.puppycrawl.tools.checkstyle.checks.sizes.methodlength;
11  
12  strictfp final class InputMethodLengthModifierOne
13  {
14  
15      /** Illegal order of modifiers for variables */
16      static private boolean sModifierOrderVar = false;
17  
18      /**
19       * Illegal order of modifiers for methods. Make sure that the
20       * first and last modifier from the JLS sequence is used.
21       */
22      strictfp private void doStuff()
23      {
24      }
25  
26      /** Single annotation without other modifiers */
27      @MyAnnotation2 void someMethod()
28      {
29      }
30  
31      /** Illegal order of annotation - must come first */
32      private @MyAnnotation2 void someMethod2()
33      {
34      }
35  
36      /** Annotation in middle of other modifiers otherwise in correct order */
37      private @MyAnnotation2 strictfp void someMethod3()
38      {
39      }
40  
41      /** Correct order */
42      @MyAnnotation2 private strictfp void someMethod4()
43      {
44      }
45  
46      /** Annotation in middle of other modifiers otherwise in correct order */
47      @MyAnnotation2 private static @MyAnnotation4 strictfp void someMethod5()
48      {
49      }
50  
51      /** holder for redundant 'public' modifier check. */
52      public static interface InputRedundantPublicModifier
53      {
54          /** redundant 'public' modifier */
55          public void a();
56  
57          /** all OK */
58          void b();
59  
60          /** redundant abstract modifier */
61          abstract void c();
62  
63          /** redundant 'public' modifier */
64          public float PI_PUBLIC = (float) 3.14;
65  
66          /** redundant 'abstract' modifier (field can not be abstract) */
67  //        abstract float PI_ABSTRACT = (float) 3.14;
68  
69          /** redundant 'final' modifier */
70          final float PI_FINAL = (float) 3.14;
71  
72          /** all OK */
73          float PI_OK = (float) 3.14;
74      }
75  
76      /** redundant 'final' modifier */
77      private final void method()
78      {
79      }
80  }