Fix a very annoying bug

This commit is contained in:
Oliver Burn 2004-08-19 14:24:25 +00:00
parent 51848478fd
commit d86a9de35b
3 changed files with 20 additions and 9 deletions

View File

@ -91,14 +91,14 @@ checkstyle-user</a>).</li>
<li class="body">Added filter that suppresses audit events according to source file
comments, contributed by Mike McMahon (module SuppressionCommentFilter,
requests 732196 and 931327).</li>
<li class="body">Better information for unexpected char (request 666188).
</li>
<li class="body">Added charset property to TreeWalker and StrictDuplicateCode
check (addresses bug 975346).
</li>
<li class="body">French message translations,
contributed by Pierre Dittgen
(request 978916).</li>
@ -110,7 +110,7 @@ checkstyle-user</a>).</li>
<li class="body">FinalLocalVariable ignores parameters of interface methods
and abstract methods.
(request 993922 and bug 1002849).</li>
<li class="body">com.puppycrawl.tools.checkstyle.gui.Main accepts an
optional file name in the command line.
(request 1000102).</li>
@ -137,17 +137,24 @@ checkstyle-user</a>).</li>
<li class="body">StrictDuplicateCodeCheck did not find duplicates
within the same file.</li>
<li class="body">Unexpected char (bug 975346).</li>
<li class="body">MagicNumber check overly aggressive
(reported on user mailing list).</li>
<li class="body">Documentation error for naming convention checks
(bug 987503).</li>
<li class="body">FinalParametersCheck checks parameters of abstract methods.
<li class="body">FinalParametersCheck checks parameters of
abstract methods.
(bug 1002849).</li>
<li>Bug in ClassResolver where it was mismatching imports -
example would match SecurityDataException when looking for
DataException. Bug was visible in RedundantThrows check (no
known bug).</li>
</ul>
<p class="body">

View File

@ -74,7 +74,11 @@ public class ClassResolver
Iterator it = mImports.iterator();
while (it.hasNext()) {
final String imp = (String) it.next();
if (imp.endsWith(aName)) {
// Very important to add the "." in the check below. Otherwise you
// when checking for "DataException", it will match on
// "SecurityDataException". This has been the cause of a very
// difficult bug to resolve!
if (imp.endsWith("." + aName)) {
if (isLoadable(imp)) {
return safeLoad(imp);
}

View File

@ -193,7 +193,7 @@ public class SuppressionCommentFilter
if (mLine == other.mLine) {
return mColumn - other.mColumn;
}
return (mLine - other.mLine);
}