Skip to content

Commit

Permalink
pmd: pmd#1031 false DontImportJavaLang
Browse files Browse the repository at this point in the history
  • Loading branch information
adangel committed Oct 21, 2012
1 parent d1d4fca commit ce8a166
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions pmd/etc/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Fixed bug 1025: Regression of Crash in PMDTask due to multithreading (Eclipse an
Fixed bug 1017: Type resolution very slow for big project. Thanks to Roman for the patch.
Fixed bug 1036: Documentation: default threshold values removed from v5.0
Fixed bug 1035: UseObjectForClearerAPI has misspelled message
Fixed bug 1031: false DontImportJavaLang
Improved JSP parser to be less strict with not valid XML documents (like HTML). Thanks to Victor Bucutea.
Fixed bgastviewer not working. Thanks to Victor Bucutea.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public Object visit(ASTImportDeclaration node, Object data) {
if (img.startsWith("java.lang")) {
if (img.startsWith("java.lang.ref") || img.startsWith("java.lang.reflect")
|| img.startsWith("java.lang.annotation") || img.startsWith("java.lang.instrument")
|| img.startsWith("java.lang.management") || img.startsWith("java.lang.Thread.")) {
|| img.startsWith("java.lang.management") || img.startsWith("java.lang.Thread.")
|| img.startsWith("java.lang.ProcessBuilder.")) {
return data;
}
addViolation(data, node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,13 @@ import java.lang.Thread.UncaughtExceptionHandler;
public class Foo {}
]]></code>
</test-code>
<test-code>
<description>import java.lang.ProcessBuilder.Redirect: #1031 false DontImportJavaLang</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
import java.lang.ProcessBuilder.Redirect;
public class Foo {}
]]></code>
</test-code>
</test-data>

0 comments on commit ce8a166

Please sign in to comment.