View Javadoc
1   /*
2   JavadocStyle
3   scope = (default)private
4   excludeScope = (default)null
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 InputJavadocStyleDefaultSettingsFour
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      // violation below 'First sentence should end with a period.'
54      /**
55       * Javadoc without dot
56       */
57      public interface TestInterface {
58          // violation below 'First sentence should end with a period.'
59          /**
60           * Javadoc without dot
61           */
62          void method();
63      }
64  
65      static class TestStaticClass {
66          // violation below 'First sentence should end with a period.'
67          /**
68           * Javadoc without dot
69           */
70          public int field;
71      }
72  
73      /**
74       * .
75       * @throws Exception if an error occurs
76       */
77      void foo() throws Exception {}
78  
79      // violation below 'First sentence should end with a period.'
80      /**
81       * text /
82       * @throws Exception if an error occurs
83       */
84      void bar() throws Exception {}
85  
86      /**
87       * {@inheritDoc}
88       * <p>
89       * @throws IllegalArgumentException with errMsg as its message
90       */
91      void inheritDocWithThrows() {}
92  
93      // violation below 'First sentence should end with a period.'
94      /**
95       * /
96       *
97       **
98       * @param s
99       * @return Return
100      */
101     public int test(String s) { return 0; }
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 }