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 = false 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 InputJavadocStyleFirstSentenceFour 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 // violation below 'First sentence should end with a period.' 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 // violation below 'First sentence should end with a period.' 64 /** 65 * Javadoc without dot 66 */ 67 public int field; 68 } 69 70 /** 71 * . 72 * @throws Exception if an error occurs 73 */ 74 void foo() throws Exception {} 75 76 // violation below 'First sentence should end with a period.' 77 /** 78 * text / 79 * @throws Exception if an error occurs 80 */ 81 void bar() throws Exception {} 82 83 /** 84 * {@inheritDoc} 85 * <p> 86 * @throws IllegalArgumentException with errMsg as its message 87 */ 88 void inheritDocWithThrows() {} 89 90 // violation below 'First sentence should end with a period.' 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 < j; i++, j--) {} 108 </pre> 109 */ 110 public void test2() {} 111 112 /** 113 * <p>Test.</p> 114 * <pre><code>@ExtendWith(SpotBugsExtension.class) 115 public class SampleTest { 116 }</code></pre> 117 */ 118 public void test3() {} 119 }