File tree 5 files changed +12
-10
lines changed
java/com/puppycrawl/tools/checkstyle/checks/imports
test/java/com/puppycrawl/tools/checkstyle/checks/imports
5 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 196
196
<property name =" format" value =" ^[a-z][a-zA-Z0-9]*$" />
197
197
</module >
198
198
<module name =" TypeName" />
199
- <module name =" UnusedImports" >
200
- < property name = " processJavadoc " value = " true " />
201
- </ module >
199
+ <module name =" UnusedImports" / >
200
+
201
+
202
202
<module name =" UpperEll" />
203
203
<module name =" VisibilityModifier" />
204
204
<module name =" WhitespaceAfter" />
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public class UnusedImportsCheck extends Check {
74
74
/** Flag to indicate when time to start collecting references. */
75
75
private boolean collect ;
76
76
/** Flag whether to process Javadoc comments. */
77
- private boolean processJavadoc ;
77
+ private boolean processJavadoc = true ;
78
78
79
79
/** Set of the imports. */
80
80
private final Set <FullIdent > imports = Sets .newHashSet ();
Original file line number Diff line number Diff line change 103
103
<module name =" AvoidStarImport" />
104
104
<module name =" IllegalImport" /> <!-- defaults to sun.* packages -->
105
105
<module name =" RedundantImport" />
106
- <module name =" UnusedImports" />
106
+ <module name =" UnusedImports" >
107
+ <property name =" processJavadoc" value =" false" />
108
+ </module >
107
109
108
110
<!-- Checks for Size Violations. -->
109
111
<!-- See http://checkstyle.sf.net/config_sizes.html -->
Original file line number Diff line number Diff line change @@ -46,8 +46,9 @@ protected String getNonCompilablePath(String filename) throws IOException {
46
46
}
47
47
48
48
@ Test
49
- public void testDefault () throws Exception {
49
+ public void testWithoutProcessJavadoc () throws Exception {
50
50
final DefaultConfiguration checkConfig = createCheckConfig (UnusedImportsCheck .class );
51
+ checkConfig .addAttribute ("processJavadoc" , "false" );
51
52
final String [] expected = {
52
53
"8:45: " + getCheckMessage (MSG_KEY ,
53
54
"com.puppycrawl.tools.checkstyle.checks.imports.InputImportBug" ),
@@ -86,7 +87,6 @@ public void testDefault() throws Exception {
86
87
@ Test
87
88
public void testProcessJavadoc () throws Exception {
88
89
final DefaultConfiguration checkConfig = createCheckConfig (UnusedImportsCheck .class );
89
- checkConfig .addAttribute ("processJavadoc" , "true" );
90
90
final String [] expected = {
91
91
"8:45: " + getCheckMessage (MSG_KEY ,
92
92
"com.puppycrawl.tools.checkstyle.checks.imports.InputImportBug" ),
Original file line number Diff line number Diff line change @@ -1031,7 +1031,7 @@ public class SomeClass { ... }
1031
1031
</li >
1032
1032
<li >
1033
1033
<b >Optionally:</b > it is referenced in Javadoc comments. This check
1034
- is off by default, as it is considered bad practice to introduce
1034
+ is on by default, but it is considered bad practice to introduce
1035
1035
a compile time dependency for documentation purposes only.
1036
1036
As an example, the import <code >java.util.Date</code > would be
1037
1037
considered referenced with the Javadoc comment
@@ -1070,7 +1070,7 @@ class FooBar {
1070
1070
<td >processJavadoc</td >
1071
1071
<td >whether to process Javadoc</td >
1072
1072
<td ><a href =" property_types.html#boolean" >boolean</a ></td >
1073
- <td ><code >false </code ></td >
1073
+ <td ><code >true </code ></td >
1074
1074
</tr >
1075
1075
</table >
1076
1076
</subsection >
@@ -1087,7 +1087,7 @@ class FooBar {
1087
1087
<subsection name =" Example of Usage" >
1088
1088
<ul >
1089
1089
<li >
1090
- <a href =" https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/sun_checks.xml#L106" >
1090
+ <a href =" https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/sun_checks.xml#L106-L108 " >
1091
1091
Sun Style</a >
1092
1092
</li >
1093
1093
<li >
You can’t perform that action at this time.
0 commit comments