Skip to content

Commit

Permalink
Issue checkstyle#3907: SummaryJavadoc no violation on javadoc where '…
Browse files Browse the repository at this point in the history
….' is used not as end of sentence
  • Loading branch information
sagarshah94 authored and sagar-shah94 committed Jun 24, 2017
1 parent 4a68bf5 commit c2652c6
Show file tree
Hide file tree
Showing 18 changed files with 310 additions and 144 deletions.
Expand Up @@ -56,15 +56,20 @@ public void testIncorrect() throws Exception {
"summary.first.sentence");
final String msgForbiddenFragment = getCheckMessage(SummaryJavadocCheck.class,
"summary.javaDoc");
final String msgMissingDoc = getCheckMessage(SummaryJavadocCheck.class,
"summary.javaDoc.missing");

final String[] expected = {
"14: " + msgFirstSentence,
"14: " + msgMissingDoc,
"32: " + msgMissingDoc,
"37: " + msgFirstSentence,
"47: " + msgForbiddenFragment,
"53: " + msgMissingDoc,
"58: " + msgForbiddenFragment,
"69: " + msgFirstSentence,
"58: " + msgMissingDoc,
"69: " + msgMissingDoc,
"83: " + msgForbiddenFragment,
"103: " + msgFirstSentence,
"103: " + msgMissingDoc,
};

final Configuration checkConfig = getCheckConfig("SummaryJavadoc");
Expand Down
Expand Up @@ -16,6 +16,7 @@ class InputCorrectSummaryJavaDocCheck {
void foo3() {}

/**
* This is valid.
* @throws Exception if an error occurs.
*/
void foo4() throws Exception {}
Expand All @@ -29,8 +30,9 @@ void foo5() {}
*/
void foo6() {}

/**
* <a href="mailto:vlad@htmlbook.ru"/>
/**
* This is valid.
* <a href="mailto:vlad@htmlbook.ru"/>
*/
class InnerInputCorrectJavaDocParagraphCheck {

Expand All @@ -39,18 +41,19 @@ class InnerInputCorrectJavaDocParagraphCheck {
*/
public static final byte NUL = 0;

/**
/**
* Some java@doc.
* This method returns.
*/
public static final byte NUL_2 = 0;

/**
* Returns the customer ID. This method returns
* Returns the customer ID. This method returns.
*/
int getId() {return 666;}

/**
* This is valid.
* <a href="mailto:vlad@htmlbook.ru"/>.
*/
void foo2() {}
Expand All @@ -62,74 +65,77 @@ void foo2() {}
void foo3() {}

/**
* This is valid.
* @throws Exception if an error occurs.
*/
void foo4() throws Exception {}

/**
/**
* JAXB Provider Use Only: Provides partial default
* implementations for some of the javax.xml.bind interfaces.
*/
void foo5() {}

/**
* An especially short (int... A) bit of Javadoc. This
* method returns
* method returns.
*/
void foo6() {}
}

/**
* Some
* javadoc. A {@code Foo} is a simple Javadoc.
*
* Some Javadoc. A {@code Foo}
* is a simple Javadoc.
*/
/**
* Some
* javadoc. A {@code Foo} is a simple Javadoc.
*
* Some Javadoc. A {@code Foo}
* is a simple Javadoc.
*/
InnerInputCorrectJavaDocParagraphCheck anon = new InnerInputCorrectJavaDocParagraphCheck() {

/**
* JAXB 1.0 only default validation event handler.
*/
public static final byte NUL = 0;

/**
* Returns the current state.
* This method returns.
*/
boolean emulated(String s) {return false;}

/**
* As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)}.
*/
void foo3() {}

/**
* This is valid.
* @throws Exception if an error occurs.
*/
void foo4() throws Exception {}

/** An especially short bit of Javadoc. */
void foo5() {}

/**
* An especially short bit of Javadoc.
*/
void foo6() {}

/**
* Some Javadoc. This method returns some javadoc.
*/
boolean emulated() {return false;}

/**
* Some Javadoc. This method returns some javadoc. Some Javadoc.
*/
boolean emulated1() {return false;}

/**
* This is valid.
* @return Some Javadoc the customer ID.
*/
int geId() {return 666;}
int geId() {return 666;}
};
}
Expand Up @@ -5,17 +5,17 @@
* is a simple Javadoc. Some javadoc.
*/
class InputIncorrectSummaryJavaDocCheck {

/**
* As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)}
*/
void foo3() {}

/*warn*//**
* @throws Exception if an error occurs
*/
void foo4() throws Exception {}

/** An especially short bit of Javadoc. */
void foo5() {}

Expand All @@ -29,17 +29,17 @@ void foo6() {}
*/
public static final byte NUL = 0;

/**
* <a href="mailto:vlad@htmlbook.ru"/>
/*warn*//**
* <a href="mailto:vlad@htmlbook.ru"/>
*/
class InnerInputCorrectJavaDocParagraphCheck {
class InnerInputCorrectJavaDocParagraphCheck {

/*warn*//**
* foooo@foooo
*/
* foooo@foooo
*/
public static final byte NUL = 0;

/**
/**
* Some java@doc.
*/
public static final byte NUL_2 = 0;
Expand All @@ -49,8 +49,8 @@ class InnerInputCorrectJavaDocParagraphCheck {
* returns some javadoc. Some javadoc.
*/
boolean emulated() {return false;}
/**

/*warn*//**
* <a href="mailto:vlad@htmlbook.ru"/>
*/
void foo2() {}
Expand All @@ -59,18 +59,18 @@ void foo2() {}
* @return the
* customer ID some javadoc.
*/
int geId() {return 666;}
int geId() {return 666;}

/**
* As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)}
* As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)}.
*/
void foo3() {}

/*warn*//**
* @throws Exception if an error occurs
*/
void foo4() throws Exception {}

/** An especially short bit of Javadoc. */
void foo5() {}

Expand All @@ -81,36 +81,36 @@ void foo6() {}
}

/*warn*//**
* A {@code InnerInputCorrectJavaDocParagraphCheck} is a simple code.
*/
* A {@code InnerInputCorrectJavaDocParagraphCheck} is a simple code.
*/
InnerInputCorrectJavaDocParagraphCheck anon = new InnerInputCorrectJavaDocParagraphCheck() {

/**
* Some Javadoc.
*/
public static final byte NUL = 0;
/**
* Some Javadoc.
*/
public static final byte NUL = 0;

/**
* Some Javadoc.
*/
void emulated(String s) {}

/**
* As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)}.
*/
void foo3() {}

/**
* Some Javadoc.
*/
void emulated(String s) {}

/**
* As of JDK 1.1, replaced by {@link #setBounds(int,int,int,int)}
*/
void foo3() {}

/*warn*//**
* @throws Exception if an error occurs
*/
void foo4() throws Exception {}

/** An especially short bit of Javadoc. */
void foo5() {}
* @throws Exception if an error occurs
*/
void foo4() throws Exception {}

/**
* An especially short bit of Javadoc.
*/
void foo6() {}
};
/** An especially short bit of Javadoc. */
void foo5() {}

/**
* An especially short bit of Javadoc.
*/
void foo6() {}
};
}

0 comments on commit c2652c6

Please sign in to comment.