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