View Javadoc
1   package com.google.checkstyle.test.chapter7javadoc.rule712paragraphs;
2   
3   // 2 violations 5 lines below:
4   //  '<p> tag should be placed immediately before the first word'
5   //  '<p> tag should be preceded with an empty line.'
6   /**
7    * Some Javadoc.
8    * <p>
9    * Some Javadoc.<p>
10   */
11  // 2 violations 2 lines above:
12  //  '<p> tag should be placed immediately before the first word'
13  //  '<p> tag should be preceded with an empty line.'
14  
15  class InputIncorrectJavadocParagraph {
16  
17    // 2 violations 4 lines below:
18    //  '<p> tag should be placed immediately before the first word'
19    //  '<p> tag should be preceded with an empty line.'
20    /**
21     * Some Javadoc.<p>
22     *
23     * <p>  Some Javadoc.
24     *
25     * @since 8.0
26     */
27    // violation 4 lines above '<p> tag should be placed immediately before the first word'
28    public static final byte NUL = 0;
29  
30    // violation 2 lines below '<p> tag should be preceded with an empty line.'
31    /**
32     * Some <p>Javadoc.
33     *
34     * <p>Some Javadoc.
35     *
36     * @see <a href="example.com">Documentation about GWT emulated source</a>
37     */
38    boolean emulated() {
39      return false;
40    }
41  
42    // violation 4 lines below 'Redundant <p> tag.'
43    // 2 violations 4 lines below:
44    //  '<p> tag should be placed immediately before the first word'
45    //  '<p> tag should be preceded with an empty line.'
46    /**<p>Some Javadoc.
47     * <p>
48     * <p><p>
49     * <p> Some Javadoc.<p>
50     */
51    // 3 violations 3 lines above:
52    //  '<p> tag should be preceded with an empty line.'
53    //  '<p> tag should be placed immediately before the first word'
54    //  '<p> tag should be preceded with an empty line.'
55    // 4 violations 6 lines above:
56    //  '<p> tag should be placed immediately before the first word'
57    //  '<p> tag should be preceded with an empty line.'
58    //  '<p> tag should be placed immediately before the first word'
59    //  '<p> tag should be preceded with an empty line.'
60    class InnerInputCorrectJavaDocParagraphCheck {
61  
62      // 2 violations 4 lines below:
63      //  '<p> tag should be placed immediately before the first word'
64      //  '<p> tag should be preceded with an empty line.'
65      /**
66       * Some Javadoc.<p>
67       *
68       * @since 8.0
69       */
70      public static final byte NUL = 0;
71  
72      // 2 violations 5 lines below:
73      //  '<p> tag should be placed immediately before the first word'
74      //  'Redundant <p> tag.'
75      // violation 5 lines below '<p> tag should be placed immediately before the first word'
76      // violation 6 lines below '<p> tag should be placed immediately before the first word'
77      /**<p>
78       *  Some Javadoc.
79       *
80       * <P>
81       *
82       * <p>
83       *   Some Javadoc.<p>
84       * @see <a href="example.com">Documentation about GWT emulated source</a>
85       */
86      // 2 violations 3 lines above:
87      //  '<p> tag should be placed immediately before the first word'
88      //  '<p> tag should be preceded with an empty line.'
89      // violation 5 lines above 'Javadoc tag '@see' should be preceded with an empty line.'
90      boolean emulated() {
91        return false;
92      }
93    }
94  
95    InnerInputCorrectJavaDocParagraphCheck anon =
96        new InnerInputCorrectJavaDocParagraphCheck() {
97  
98          // violation 2 lines below 'Redundant <p> tag.'
99          /**
100          * <p>Some Javadoc.
101          *
102          * <p>Some Javadoc.
103          *
104          * @since 8.0
105          */
106         public static final byte NUL = 0;
107 
108         // 2 violations 5 lines below:
109         //  '<p> tag should be placed immediately before the first word'
110         //  '<p> tag should be preceded with an empty line.'
111         // violation 4 lines below '<p> tag should be placed immediately before the first word'
112         /**
113          *   Some Javadoc.<p>
114          *
115          *  <p>  Some Javadoc.
116          *
117          * @see <a href="example.com">Documentation about <p> GWT emulated source</a>
118          */
119         boolean emulated() {
120           return false;
121         }
122       };
123 
124   /**
125    * Some summary.
126    *
127    * <p><h1>Testing...</h1></p>
128    */
129   // violation 2 lines above '<p> tag should not precede HTML block-tag '<h1>''
130   class InnerPrecedingPtag {
131     // 2 violations 6 lines below:
132     //  '<p> tag should be placed immediately before the first word'
133     //  '<p> tag should not precede HTML block-tag '<ul>''
134     /**
135      * Some summary.
136      *
137      *<p>
138      *  <ul>
139      *    <p>
140      *      <li>1</li> should NOT give violation as there is not empty line before
141      *    </p>
142      *  </ul>
143      *</p>
144      */
145     public void foo() {}
146 
147     // 2 violations 6 lines below:
148     //  '<p> tag should be placed immediately before the first word'
149     //  '<p> tag should not precede HTML block-tag '<table>''
150     /**
151      *  Some summary.
152      *
153      * <p>
154      *  <table>
155      *  </table>
156      * </p>
157      */
158     public void fooo() {}
159 
160     // 2 violations 6 lines below:
161     //  '<p> tag should be placed immediately before the first word'
162     //  '<p> tag should not precede HTML block-tag '<pre>''
163     /**
164      * Some summary.
165      *
166      * <p>
167      *   <pre>testing...</pre>
168      *   <pre>testing...</pre>
169      * </p>
170      */
171     public void foooo() {}
172   }
173 }