View Javadoc
1   /*
2   MissingJavadocMethod
3   minLineCount = (default)-1
4   allowedAnnotations = (default)Override
5   scope = anoninner
6   excludeScope = (default)null
7   allowMissingPropertyJavadoc = (default)false
8   ignoreMethodNamesRegex = (default)null
9   tokens = (default)METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF
10  
11  
12  */
13  
14  package com.puppycrawl.tools.checkstyle.checks.javadoc.missingjavadocmethod;
15  
16  import java.awt.event.MouseEvent;
17  import java.awt.event.MouseAdapter;
18  import javax.swing.JButton;
19  
20  /**
21   * Tests for anonymous inner types
22   */
23  public class InputMissingJavadocMethodScopeAnonInner2
24  {
25      /**
26       * button.
27       */
28      private JButton mButton = new JButton();
29  
30      /**
31       * anon inner in member variable initialization.
32       */
33      private Runnable mRunnable = new Runnable() { // ok
34          public void run() // violation
35          {
36              System.identityHashCode("running");
37          }
38      };
39  
40      /**
41       * anon inner in constructor.
42       */
43      InputMissingJavadocMethodScopeAnonInner2() // ok
44      {
45          mButton.addMouseListener( new MouseAdapter()
46          {
47              public void mouseClicked( MouseEvent aEv ) // violation
48              {
49                  System.identityHashCode("click");
50              }
51          } );
52      }
53  
54      /**
55       * anon inner in method
56       */
57      public void addInputAnonInner() // ok
58      {
59          mButton.addMouseListener( new MouseAdapter()
60          {
61              public void mouseClicked( MouseEvent aEv ) // violation
62              {
63                  System.identityHashCode("click");
64              }
65          } );
66      }
67  }