View Javadoc
1   /*
2   SummaryJavadoc
3   violateExecutionOnNonTightHtml = (default)false
4   forbiddenSummaryFragments = ^@return the *|^This method returns |^A \
5                               [{]@code [a-zA-Z0-9]+[}]( is a )
6   period = (default).
7   
8   
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.javadoc.summaryjavadoc;
12  
13  /**
14   * A {@code Foo. Foo}
15   * is a simple Javadoc. Some javadoc.
16   */
17  class InputSummaryJavadocIncorrect {
18  
19      /**
20       * As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)}
21       */
22      void foo3() {}
23      // violation below 'Summary javadoc is missing.'
24      /**
25       * @throws Exception if a problem occurs
26       */
27      void foo4() throws Exception {}
28  
29      /** An especially short bit of Javadoc. */
30      void foo5() {}
31  
32      /**
33       * An especially short bit of Javadoc.
34       */
35      void foo6() {}
36  
37      /**
38       * Some Javadoc.
39       */
40      public static final byte NUL = 0;
41      // violation below 'Summary javadoc is missing.'
42      /**
43       * <a href="mailto:vlad@htmlbook.ru"/>
44       */
45       class InnerInputCorrectJavaDocParagraphCheck {
46      // violation below 'First sentence .* missing an ending period.'
47           /**
48            * foooo@foooo
49            */
50          public static final byte NUL = 0;
51  
52          /**
53           * Some java@doc.
54           */
55          public static final byte NUL_2 = 0;
56      // violation below 'Forbidden summary fragment.'
57          /**
58           * This method
59           * returns some javadoc. Some javadoc.
60           */
61          boolean emulated() {return false;}
62      // violation below 'Summary javadoc is missing.'
63          /**
64           * <a href="mailto:vlad@htmlbook.ru"/>
65           */
66          void foo2() {}
67      // violation below 'Summary javadoc is missing.'
68          /**
69           * @return the
70           * customer ID some javadoc.
71           */
72          int geId() {return 666;}
73  
74          /**
75           * As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)}.
76           */
77          void foo3() {}
78      // violation below 'Summary javadoc is missing.'
79          /**
80           * @throws Exception if a problem occurs
81           */
82          void foo4() throws Exception {}
83  
84          /** An especially short bit of Javadoc. */
85          void foo5() {}
86  
87          /**
88           * An especially short bit of Javadoc.
89           */
90          void foo6() {}
91      }
92      // violation below 'Forbidden summary fragment.'
93       /**
94        * A {@code InnerInputCorrectJavaDocParagraphCheck} is a simple code.
95        */
96      InnerInputCorrectJavaDocParagraphCheck anon = new InnerInputCorrectJavaDocParagraphCheck() {
97  
98          /**
99           * Some Javadoc.
100          */
101         public static final byte NUL = 0;
102 
103         /**
104          * Some Javadoc.
105          */
106         void emulated(String s) {}
107 
108         /**
109          * As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)}.
110          */
111         void foo3() {}
112     // violation below 'Summary javadoc is missing.'
113         /**
114          * @throws Exception if a problem occurs
115          */
116         void foo4() throws Exception {}
117 
118         /** An especially short bit of Javadoc. */
119         void foo5() {}
120 
121         /**
122          * An especially short bit of Javadoc.
123          */
124         void foo6() {}
125     // violation below 'First sentence .* missing an ending period.'
126          /**
127           * mm{@inheritDoc}
128           */
129          void foo7() {}
130     // violation below 'Summary javadoc is missing.'
131          /**
132           * {@link #setBounds(int,int,int,int)}
133           */
134          void foo8() {}
135     // violation below 'Summary javadoc is missing.'
136          /**
137           *
138           */
139          void foo10() {}
140     };
141     // violation below 'First sentence .* missing an ending period.'
142     /**
143      * M m m m {@inheritDoc}
144      */
145     void foo7() {}
146     // violation below 'Summary javadoc is missing.'
147     /** */
148     <T> T foo8(T t) {return null;}
149     // violation below 'Summary javadoc is missing.'
150     /** */
151     String[] foo9() {return null;}
152 
153     /**
154      * This is the summary.
155      * {@summary This is NOT summary according to javadoc tool}
156      */
157     void testMethod() {
158     }
159 }