View Javadoc
1   /*
2   JavadocStyle
3   scope = (default)private
4   excludeScope = protected
5   checkFirstSentence = (default)true
6   endOfSentenceFormat = (default)([.?!][ \t\n\r\f<])|([.?!]$)
7   checkEmptyJavadoc = (default)false
8   checkHtml = (default)true
9   tokens = (default)ANNOTATION_DEF, ANNOTATION_FIELD_DEF, CLASS_DEF, CTOR_DEF, \
10           ENUM_CONSTANT_DEF, ENUM_DEF, INTERFACE_DEF, METHOD_DEF, PACKAGE_DEF, \
11           VARIABLE_DEF, RECORD_DEF, COMPACT_CTOR_DEF
12  
13  
14  */
15  
16  package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocstyle;
17  
18  public class InputJavadocStyleExcludeScope4
19  {
20      /**
21       * Link to some page in two lines.
22       * <a
23       * href="someLink"/>
24       */
25      void tagInTwoLines() {}
26  
27      // violation 3 lines below 'Unclosed HTML tag found: <code>'
28      /**
29       * This Javadoc contains unclosed tag.
30       * <code>unclosed 'code' tag<code>
31       */
32      private void unclosedTag() {}
33  
34      void javadocLikeCommentInMethod() {
35          /**
36           * It pretends to be Javadoc without dot, but it's just comment in method
37           */
38          final int i = 0;
39      }
40  
41      // violation below 'First sentence should end with a period.'
42      /**
43       * {@inheritDoc}
44       */
45      private void inheritDoc() {}
46  
47      // violation 2 lines below 'Unclosed HTML tag found: <b>Note:<b> it's unterminated tag.</p>'
48      /**
49       * <p><b>Note:<b> it's unterminated tag.</p>
50       */
51      private void unterminatedTag() {}
52  
53      /**
54       * Javadoc without dot
55       */
56      public interface TestInterface {
57          /**
58           * Javadoc without dot
59           */
60          void method();
61      }
62  
63      static class TestStaticClass {
64          // violation below 'First sentence should end with a period.'
65          /**
66           * Javadoc without dot
67           */
68          public int field;
69      }
70  
71      /**
72       * .
73       * @throws Exception if an error occurs
74       */
75      void foo() throws Exception {}
76  
77      // violation below 'First sentence should end with a period.'
78      /**
79       * text /
80       * @throws Exception if an error occurs
81       */
82      void bar() throws Exception {}
83  
84      /**
85       * {@inheritDoc}
86       * <p>
87       * @throws IllegalArgumentException with errMsg as its message
88       */
89      void inheritDocWithThrows() {}
90  
91      /**
92       * /
93       *
94       **
95       * @param s
96       * @return Return
97       */
98      public int test(String s) { return 0; }
99  
100     /** Set of all class field names.*/
101     public String field;
102 
103     /**
104      * <p>Test.</p>
105      * <pre class="body">
106          for (
107           ; i &lt; j; i++, j--) {}
108        </pre>
109      */
110     public void test2() {}
111 
112     /**
113      * <p>Test.</p>
114      * <pre><code>&#064;ExtendWith(SpotBugsExtension.class)
115 public class SampleTest {
116 }</code></pre>
117      */
118     public void test3() {}
119 }