Skip to content

Commit

Permalink
Issue checkstyle#4586: Moved InputCorrectJavadocParagraph.java to jav…
Browse files Browse the repository at this point in the history
…adocparagraph subdirectory and Copied InputInCorrectJavadocParagraph.java to subdirectory
  • Loading branch information
djydewang committed Jul 8, 2017
1 parent 3a2a51d commit 4eb5e6c
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 6 deletions.
Expand Up @@ -47,7 +47,8 @@ public void setUp() {
@Override
protected String getPath(String filename) throws IOException {
return super.getPath("checks" + File.separator
+ "javadoc" + File.separator + filename);
+ "javadoc" + File.separator
+ "javadocparagraph" + File.separator + filename);
}

@Test
Expand All @@ -62,7 +63,7 @@ public void testGetRequiredTokens() {
public void testCorrect() throws Exception {
final String[] expected = CommonUtils.EMPTY_STRING_ARRAY;

verify(checkConfig, getPath("InputCorrectJavaDocParagraph.java"), expected);
verify(checkConfig, getPath("InputJavaDocParagraphCorrect.java"), expected);
}

@Test
Expand Down Expand Up @@ -105,7 +106,7 @@ public void testIncorrect() throws Exception {
"81: " + getCheckMessage(MSG_TAG_AFTER),
"82: " + getCheckMessage(MSG_TAG_AFTER),
};
verify(checkConfig, getPath("InputIncorrectJavaDocParagraph.java"), expected);
verify(checkConfig, getPath("InputJavaDocParagraphIncorrect.java"), expected);
}

@Test
Expand All @@ -132,6 +133,6 @@ public void testAllowNewlineParagraph() throws Exception {
"81: " + getCheckMessage(MSG_TAG_AFTER),
"82: " + getCheckMessage(MSG_TAG_AFTER),
};
verify(checkConfig, getPath("InputIncorrectJavaDocParagraph.java"), expected);
verify(checkConfig, getPath("InputJavaDocParagraphIncorrect.java"), expected);
}
}
@@ -0,0 +1,112 @@
package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocparagraph;

/**
* Some Javadoc.
*
* <p>Some Javadoc.
*
*/
class InputCorrectJavaDocParagraphCorrect {

/**
* Some Javadoc.
*
* <p>{@code function} will never be invoked with a null value.
*
* @since 8.0
*/
public static final byte NUL = 0;

/**
* Some Javadoc.
*
* <p>Some Javadoc.
*
* <pre>
* class Foo {
*
* void foo() {}
* }
* </pre>
*
* @see <a href="http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModules">
* Documentation about GWT emulated source</a>
*/
boolean emulated() {return false;}

/**
* Some Javadoc.
*
*<pre>
* Test
* </pre>
*
* <pre>
* Test
* </pre>
*/
boolean test() {return false;}

/**
* Some Javadoc.
*
* <p>Some Javadoc.
*
*/
class InnerInputCorrectJavaDocParagraphCheck {

/**
* Some Javadoc.
*
* <p>Some Javadoc.
*
* <p>Some Javadoc.
*
* @since 8.0
*/
public static final byte NUL = 0;

/**
* Some Javadoc.
*
* <p>Some Javadoc.
*
* @see <a href="http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModules">
* Documentation about GWT emulated source</a>
*/
boolean emulated() {return false;}
}

InnerInputCorrectJavaDocParagraphCheck anon = new InnerInputCorrectJavaDocParagraphCheck() {

/**
* Some Javadoc.
*
* <p>Some Javadoc.
*
* <p>Some Javadoc.
*
* @since 8.0
*/
public static final byte NUL = 0;

/**
* Some Javadoc with space at the end of first line.
*
* <p>Some Javadoc.
*
* <p>Some Javadoc.
*
* @see <a href="http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModules">
* Documentation about GWT emulated source</a>
*/
boolean emulated() {return false;}
};
}

/*
* This comment has paragraph without '<p>' tag.
*
* It's fine, because this is plain comment.
*/
class ClassWithPlainComment {}
@@ -1,4 +1,4 @@
package com.puppycrawl.tools.checkstyle.checks.javadoc;
package com.puppycrawl.tools.checkstyle.checks.javadoc.javadocparagraph;



Expand All @@ -8,7 +8,7 @@
* /^ WARN/ Some Javadoc.<p> //WARN
*
*/
class InputIncorrectJavaDocParagraph {
class InputJavaDocParagraphIncorrect {

/**
* Some Javadoc.<P> //WARN
Expand Down

0 comments on commit 4eb5e6c

Please sign in to comment.