Permalink
Browse files

Issue #1627: Make 'processJavadoc' property 'true' by default

  • Loading branch information...
1 parent 8f5317d commit afbb944fe23b1be090ed69bfb97641be9dc2842c @Vladlis Vladlis committed Nov 3, 2015
@@ -196,9 +196,9 @@
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
</module>
<module name="TypeName"/>
- <module name="UnusedImports">
- <property name="processJavadoc" value="true"/>
- </module>
+ <module name="UnusedImports"/>
+
+
<module name="UpperEll"/>
<module name="VisibilityModifier"/>
<module name="WhitespaceAfter"/>
@@ -74,7 +74,7 @@
/** Flag to indicate when time to start collecting references. */
private boolean collect;
/** Flag whether to process Javadoc comments. */
- private boolean processJavadoc;
+ private boolean processJavadoc = true;
/** Set of the imports. */
private final Set<FullIdent> imports = Sets.newHashSet();
@@ -103,7 +103,9 @@
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
- <module name="UnusedImports"/>
+ <module name="UnusedImports">
+ <property name="processJavadoc" value="false"/>
+ </module>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
@@ -46,8 +46,9 @@ protected String getNonCompilablePath(String filename) throws IOException {
}
@Test
- public void testDefault() throws Exception {
+ public void testWithoutProcessJavadoc() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(UnusedImportsCheck.class);
+ checkConfig.addAttribute("processJavadoc", "false");
final String[] expected = {
"8:45: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports.InputImportBug"),
@@ -86,7 +87,6 @@ public void testDefault() throws Exception {
@Test
public void testProcessJavadoc() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(UnusedImportsCheck.class);
- checkConfig.addAttribute("processJavadoc", "true");
final String[] expected = {
"8:45: " + getCheckMessage(MSG_KEY,
"com.puppycrawl.tools.checkstyle.checks.imports.InputImportBug"),
@@ -1031,7 +1031,7 @@ public class SomeClass { ... }
</li>
<li>
<b>Optionally:</b> it is referenced in Javadoc comments. This check
- is off by default, as it is considered bad practice to introduce
+ is on by default, but it is considered bad practice to introduce
a compile time dependency for documentation purposes only.
As an example, the import <code>java.util.Date</code> would be
considered referenced with the Javadoc comment
@@ -1070,7 +1070,7 @@ class FooBar {
<td>processJavadoc</td>
<td>whether to process Javadoc</td>
<td><a href="property_types.html#boolean">boolean</a></td>
- <td><code>false</code></td>
+ <td><code>true</code></td>
</tr>
</table>
</subsection>
@@ -1087,7 +1087,7 @@ class FooBar {
<subsection name="Example of Usage">
<ul>
<li>
- <a href="https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/sun_checks.xml#L106">
+ <a href="https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/sun_checks.xml#L106-L108">
Sun Style</a>
</li>
<li>

0 comments on commit afbb944

Please sign in to comment.