View Javadoc
1   /*
2   JavadocStyle
3   scope = (default)private
4   excludeScope = (default)null
5   checkFirstSentence = false
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 InputJavadocStyleHtml4 {
19      /**
20       * Link to some page in two lines.
21       * <a
22       * href="someLink"/>
23       */
24      void tagInTwoLines() {}
25  
26      // violation 3 lines below 'Unclosed HTML tag found: <code>'
27      /**
28       * This Javadoc contains unclosed tag.
29       * <code>unclosed 'code' tag<code>
30       */
31      private void unclosedTag() {}
32  
33      void javadocLikeCommentInMethod() {
34          /**
35           * It pretends to be Javadoc without dot, but it's just comment in method
36           */
37          final int i = 0;
38      }
39  
40      /**
41       * {@inheritDoc}
42       */
43      private void inheritDoc() {}
44  
45      // violation 2 lines below 'Unclosed HTML tag found: <b>'
46      /**
47       * <p><b>
48       * </p>
49       */
50      private void unterminatedTag() {}
51  
52      /**
53       * Javadoc without dot
54       */
55      public interface TestInterface {
56          /**
57           * Javadoc without dot
58           */
59          void method();
60      }
61  
62      static class TestStaticClass {
63          /**
64           * Javadoc without dot
65           */
66          public int field;
67      }
68  
69      /**
70       * .
71       * @throws Exception if an error occurs
72       */
73      void foo() throws Exception {}
74  
75      /**
76       * text /
77       * @throws Exception if an error occurs
78       */
79      void bar() throws Exception {}
80  
81      /**
82       * {@inheritDoc}
83       * <p>
84       * @throws IllegalArgumentException with errMsg as its message
85       */
86      void inheritDocWithThrows() {}
87  
88      /**
89       * /
90       *
91       **
92       * @param s
93       * @return Return
94       */
95      public int test(String s) { return 0; }
96  
97      /** Set of all class field names.*/
98      public String field;
99  
100     /**
101      * <p>Test.</p>
102      * <pre class="body">
103          for (
104           ; i &lt; j; i++, j--) {}
105        </pre>
106      */
107     public void test2() {}
108 
109     /**
110      * <p>Test.</p>
111      * <pre><code>&#064;ExtendWith(SpotBugsExtension.class)
112 public class SampleTest {
113 }</code></pre>
114      */
115     public void test3() {}
116 }