diff --git a/docs/releasenotes.html b/docs/releasenotes.html index a465189ab..491a283a5 100644 --- a/docs/releasenotes.html +++ b/docs/releasenotes.html @@ -91,14 +91,14 @@ checkstyle-user).
  • Added filter that suppresses audit events according to source file comments, contributed by Mike McMahon (module SuppressionCommentFilter, requests 732196 and 931327).
  • - +
  • Better information for unexpected char (request 666188).
  • - +
  • Added charset property to TreeWalker and StrictDuplicateCode check (addresses bug 975346).
  • - +
  • French message translations, contributed by Pierre Dittgen (request 978916).
  • @@ -110,7 +110,7 @@ checkstyle-user).
  • FinalLocalVariable ignores parameters of interface methods and abstract methods. (request 993922 and bug 1002849).
  • - +
  • com.puppycrawl.tools.checkstyle.gui.Main accepts an optional file name in the command line. (request 1000102).
  • @@ -137,17 +137,24 @@ checkstyle-user).
  • StrictDuplicateCodeCheck did not find duplicates within the same file.
  • - +
  • Unexpected char (bug 975346).
  • MagicNumber check overly aggressive (reported on user mailing list).
  • - +
  • Documentation error for naming convention checks (bug 987503).
  • -
  • FinalParametersCheck checks parameters of abstract methods. +
  • FinalParametersCheck checks parameters of + abstract methods. (bug 1002849).
  • + +
  • 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).
  • +

    diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java index 4e2ff8f67..8c48736a8 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/checks/ClassResolver.java @@ -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); } diff --git a/src/checkstyle/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java b/src/checkstyle/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java index 0a46785ef..9f7932127 100644 --- a/src/checkstyle/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java +++ b/src/checkstyle/com/puppycrawl/tools/checkstyle/filters/SuppressionCommentFilter.java @@ -193,7 +193,7 @@ public class SuppressionCommentFilter if (mLine == other.mLine) { return mColumn - other.mColumn; } - + return (mLine - other.mLine); }