forked from phoedos/pmd
pmd: #1031 false DontImportJavaLang
This commit is contained in:
@ -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.
|
||||
|
||||
|
@ -23,7 +23,8 @@ public class DontImportJavaLangRule extends AbstractJavaRule {
|
||||
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);
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user