View Javadoc
1   /*
2   JavadocMethod
3   allowedAnnotations = (default)Override
4   validateThrows = (default)false
5   accessModifiers = (default)public, protected, package, private
6   allowMissingParamTags = (default)false
7   allowMissingReturnTag = (default)false
8   tokens = (default)METHOD_DEF, CTOR_DEF, ANNOTATION_FIELD_DEF, COMPACT_CTOR_DEF
9   
10  
11  */
12  
13  package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocmethod;
14  
15  public class InputJavadocMethod_01 {
16  
17      /** Do 1.
18       * @throws TestException1 when problem occurs.
19       */
20      public void doStuff1() throws TestException1 { // ok
21          try {
22              doStuff2(); // ok
23          } catch (final TestException2 e) { }
24          throw new InputJavadocMethod_01().new TestException1(""); // ok
25      }
26      /** Do 2.
27       * @throws TestException2 when problem occurs.
28       */
29      private static void doStuff2() throws TestException2 { // ok
30          throw new TestException2(""); // ok
31      }
32      /** Exception 1.
33       */
34      class TestException1 extends Exception { // ok
35          /** Exception 1.
36           * @param messg message
37           */
38          TestException1(String messg) { // ok
39              super(messg);
40          }
41      }
42      /** Exception 2.
43       */
44      public static class TestException2 extends Exception { // ok
45          /** Exception 2.
46           * @param messg message
47           */
48          TestException2(String messg) { // ok
49              super(messg);
50          }
51      }
52  }