1613807 - false DontImportJavaLang

Allowing java.lang.Thread.* inner classes


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@5026 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Allan Caplan
2007-02-01 01:14:36 +00:00
parent 4c384e35c1
commit e95199385f
3 changed files with 13 additions and 1 deletions

View File

@ -7,6 +7,7 @@ Fixed bug 1531216 - ImmutableField. NameOccurrence.isSelfAssignment now recogniz
Fixed bug 1634078 - StringToString now recognizes toString on a String Array, rather than an element.
Fixed bug 1631646 - UselessOperationOnImmutable doesn't throw on variable.method().variable.
Fixed bug 1627830 - UseLocaleWithCaseConversions now works with compound string operations
Fixed bug 1613807 - DontImportJavaLang rule allows import to Thread inner classes
Applied patch 1612455 - RFE 1411022 CompareObjectsWithEquals now catches the case where comparison is against new Object
Implemented RFE 1627581 - SuppressWarnings("unused") now suppresses all warnings in unusedcode.xml
XPath rules are now chained together for an extra speedup in processing

View File

@ -45,4 +45,14 @@ public class Foo {}
]]></code>
<source-type>java 1.5</source-type>
</test-code>
<test-code>
<description><![CDATA[
Importing java.lang.Thread.UncaughtExceptionHandler
]]></description>
<expected-problems>0</expected-problems>
<code><![CDATA[
import java.lang.Thread.UncaughtExceptionHandler;
public class Foo {}
]]></code>
</test-code>
</test-data>

View File

@ -16,7 +16,8 @@ public class DontImportJavaLang extends AbstractRule {
|| img.startsWith("java.lang.reflect")
|| img.startsWith("java.lang.annotation")
|| img.startsWith("java.lang.instrument")
|| img.startsWith("java.lang.management")) {
|| img.startsWith("java.lang.management")
|| img.startsWith("java.lang.Thread.")) {
return data;
}