View Javadoc
1   ////////////////////////////////////////////////////////////////////////////////
2   // Test case file for checkstyle.
3   // Created: 2001
4   ////////////////////////////////////////////////////////////////////////////////
5   package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocmethod;
6   
7   import java.awt.event.MouseEvent;
8   import java.awt.event.MouseAdapter;
9   import javax.swing.JButton;
10  
11  /**
12   * Tests for anonymous inner types
13   * @author Lars K├╝hne
14   **/
15  public class InputJavadocMethodScopeAnonInner
16  {
17      /**
18         button.
19      */
20      private JButton mButton = new JButton();
21  
22      /**
23         anon inner in member variable initialization.
24      */
25      private Runnable mRunnable = new Runnable() {
26          public void run() // should not have to be documented, class is anon.
27          {
28              System.identityHashCode("running");
29          }
30      };
31  
32      /**
33         anon inner in constructor.
34      */
35      InputJavadocMethodScopeAnonInner()
36      {
37          mButton.addMouseListener( new MouseAdapter()
38              {
39                  public void mouseClicked( MouseEvent aEv )
40                  {
41                      System.identityHashCode("click");
42                  }
43              } );
44      }
45  
46      /**
47         anon inner in method
48      */
49      public void addInputAnonInner()
50      {
51          mButton.addMouseListener( new MouseAdapter()
52              {
53                  public void mouseClicked( MouseEvent aEv )
54                  {
55                      System.identityHashCode("click");
56                  }
57              } );
58      }
59  }