Fix for issue #119 "HTML comments break the Javadoc style HTML check" error in TagParser
This commit is contained in:
parent
208e0208ca
commit
2ed89e1e58
|
|
@ -209,7 +209,7 @@ class TagParser
|
|||
to = findChar(aText, '>', to);
|
||||
while ((to.getLineNo() < aText.length)
|
||||
&& !aText[to.getLineNo()]
|
||||
.substring(0, to.getColumnNo()).endsWith("-->"))
|
||||
.substring(0, to.getColumnNo() + 1).endsWith("-->"))
|
||||
{
|
||||
to = findChar(aText, '>', getNextCharPos(aText, to));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,6 +128,19 @@ public class JavadocStyleCheckTest
|
|||
verify(checkConfig, getPath("InputJavadocStyleCheck.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testHtmlComment() throws Exception
|
||||
{
|
||||
final DefaultConfiguration checkConfig = createCheckConfig(JavadocStyleCheck.class);
|
||||
checkConfig.addAttribute("checkFirstSentence", "false");
|
||||
checkConfig.addAttribute("checkHtml", "true");
|
||||
final String[] expected =
|
||||
{
|
||||
};
|
||||
|
||||
verify(checkConfig, getPath("InputJavadocStyleCheckHtmlComment.java"), expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScopePublic()
|
||||
throws Exception
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Test case file for checkstyle.
|
||||
// Created: 2014
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
package com.puppycrawl.tools.checkstyle;
|
||||
|
||||
/**
|
||||
* Test input for the JavadocStyleCheck. This check is used to perform
|
||||
* some additional Javadoc validations.
|
||||
*
|
||||
* @author Tobias Geyer
|
||||
* @version 1.0
|
||||
*/
|
||||
public class InputJavadocStyleCheckHtmlComment
|
||||
{
|
||||
/**
|
||||
* sometimes a tag starts
|
||||
* <pre>
|
||||
* somewhere and has a comment in the middle
|
||||
* <!-- ignore this -->
|
||||
* and ends afterwards
|
||||
* </pre>
|
||||
*/
|
||||
private void method1()
|
||||
{ // JavadocStyle should not report any error for this method
|
||||
}
|
||||
|
||||
/**
|
||||
* sometimes a tag starts
|
||||
* <pre>
|
||||
* somewhere and has a multiline comment in the middle
|
||||
* <!-- ignore this
|
||||
* spanning
|
||||
* multiple lines -->
|
||||
* and ends afterwards
|
||||
* </pre>
|
||||
*/
|
||||
private void method2()
|
||||
{ // JavadocStyle should not report any error for this method
|
||||
}
|
||||
|
||||
/**
|
||||
* sometimes a tag starts
|
||||
* <pre>
|
||||
* somewhere and has a multiline comment in the middle
|
||||
* <!-- ignore this
|
||||
* spanning
|
||||
* multiple lines --></pre>
|
||||
* and ends on the same line
|
||||
*/
|
||||
private void method3()
|
||||
{ // JavadocStyle should not report any error for this method
|
||||
}
|
||||
|
||||
/**
|
||||
* sometimes a tag starts
|
||||
* <pre>
|
||||
* somewhere and has a comment in the middle
|
||||
* <!-- ignore this --> with text following
|
||||
* and ends afterwards
|
||||
* </pre>
|
||||
*/
|
||||
private void method4()
|
||||
{ // JavadocStyle should not report any error for this method
|
||||
}
|
||||
|
||||
/**
|
||||
* sometimes a tag starts
|
||||
* <pre><!-- ignore this --></pre>
|
||||
* and ends with a comment in the middle
|
||||
*/
|
||||
private void method5()
|
||||
{ // JavadocStyle should not report any error for this method
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue