Fix for 925263 (Redundant throws, exceptions as nested classes)

This commit is contained in:
Oleg Sukhodolsky 2004-04-04 15:56:04 +00:00
parent 5b07a9df8a
commit e5f09c7fd2
2 changed files with 17 additions and 2 deletions

View File

@ -213,6 +213,9 @@
all previous versions of the configuration DTD locally, without
accessing the internet (bug 909987).</li>
<li class="body">Fixed handling of imports for inner classes
in RedundantThrows (bug 925263)</li>
</ul>
<p class="body">

View File

@ -74,8 +74,20 @@ public class ClassResolver
Iterator it = mImports.iterator();
while (it.hasNext()) {
final String imp = (String) it.next();
if (imp.endsWith(aName) && isLoadable(imp)) {
return safeLoad(imp);
if (imp.endsWith(aName)) {
if (isLoadable(imp)) {
return safeLoad(imp);
}
// perhaps this is a import for inner class
// let's try load it.
int dot = imp.lastIndexOf(".");
if (dot != -1) {
final String innerName = imp.substring(0, dot) + "$"
+ imp.substring(dot + 1);
if (isLoadable(innerName)) {
return safeLoad(innerName);
}
}
}
}