View Javadoc
1   /*
2   JavadocStyle
3   scope = protected
4   excludeScope = (default)null
5   checkFirstSentence = (default)true
6   endOfSentenceFormat = (default)([.?!][ \t\n\r\f<])|([.?!]$)
7   checkEmptyJavadoc = true
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 InputJavadocStyleScopeProtected4
19  {
20      /**
21       * Link to some page in two lines.
22       * <a
23       * href="someLink"/>
24       */
25      void tagInTwoLines() {}
26  
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      /**
46       * <p><b>Note:<b> it's unterminated tag.</p>
47       */
48      private void unterminatedTag() {}
49  
50      // violation below 'First sentence should end with a period.'
51      /**
52       * Javadoc without dot
53       */
54      public interface TestInterface {
55          // violation below 'First sentence should end with a period.'
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      // violation below 'First sentence should end with a period.'
89      /**
90       * /
91       *
92       **
93       * @param s
94       * @return Return
95       */
96      public int test(String s) { return 0; }
97  
98      /** Set of all class field names.*/
99      public String field;
100 
101     /**
102      * <p>Test.</p>
103      * <pre class="body">
104          for (
105           ; i &lt; j; i++, j--) {}
106        </pre>
107      */
108     public void test2() {}
109 
110     /**
111      * <p>Test.</p>
112      * <pre><code>&#064;ExtendWith(SpotBugsExtension.class)
113 public class SampleTest {
114 }</code></pre>
115      */
116     public void test3() {}
117 }