diff --git a/docs/releasenotes.html b/docs/releasenotes.html index 35d73b063..37c2786ae 100644 --- a/docs/releasenotes.html +++ b/docs/releasenotes.html @@ -213,6 +213,9 @@ all previous versions of the configuration DTD locally, without accessing the internet (bug 909987). +
  • Fixed handling of imports for inner classes + in RedundantThrows (bug 925263)
  • +

    diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java index 161191c84..4e2ff8f67 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java @@ -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); + } + } } }