From 576680b7c99bed9b49bb6f4c6b636e0b5aaca6b3 Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Wed, 16 Nov 2005 21:21:19 +0000 Subject: [PATCH] CPD no longer skips header files when checking C/C++ code. git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@3990 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/etc/changelog.txt | 4 +++- pmd/src/net/sourceforge/pmd/cpd/CPPLanguage.java | 2 +- pmd/xdocs/credits.xml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index bfd88aeb77..02e06dad67 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -18,7 +18,7 @@ Fixed bug 1314086 - Added logging-jakarta-commons as a short name for rulesets/l Fixed bug 1351498 - Improved UnnecessaryCaseChange warning message. Fixed bug 1351706 - CompareObjectsWithEquals now catches more cases. Fixed bug 1277373 - InefficientStringBuffering now flags fewer false positives. -Fixed bug 1347286 - InefficientStringBuffering now flags fewer false positives. +Fixed bug 1347286 - InefficientStringBuffering now flags fewer false positives. Implemented RFE 1311309 - Suppressed RuleViolation counts are now included in the reports. Implemented RFE 1220371 - Rule violation suppression via annotations. Per the JLS, @SuppressWarnings can be placed before the following nodes: TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE. Implemented RFE 1275547 - OverrideBothEqualsAndHashcode now skips Comparator implementations. @@ -26,6 +26,8 @@ Applied patch 1306999 - Renamed CloseConnection to CloseResource and added suppo Applied patch 1344754 - EmptyCatchBlock now skips catch blocks that contain comments. This is also requested in RFE 1347884. Renamed AvoidConcatenatingNonLiteralsInStringBuffer to InefficientStringBuffering; new name is a bit more concise. Modified LongVariable; now it has a property which can be used to override the minimum reporting value. +Improved CPD XML report. +CPD no longer skips header files when checking C/C++ code. September 15, 2005 - 3.3: New rules: PositionLiteralsFirstInComparisons (in the design ruleset), UnnecessaryLocalBeforeReturn (design ruleset), ProperLogger (logging-jakarta-commons ruleset), UselessOverridingMethod (basic ruleset), PackageCase (naming ruleset), NoPackage (naming ruleset), UnnecessaryCaseChange (strings ruleset) diff --git a/pmd/src/net/sourceforge/pmd/cpd/CPPLanguage.java b/pmd/src/net/sourceforge/pmd/cpd/CPPLanguage.java index 5221e31965..9765e621bc 100644 --- a/pmd/src/net/sourceforge/pmd/cpd/CPPLanguage.java +++ b/pmd/src/net/sourceforge/pmd/cpd/CPPLanguage.java @@ -10,7 +10,7 @@ public class CPPLanguage implements Language { public static class CPPFileOrDirectoryFilter implements FilenameFilter { public boolean accept(File dir, String filename) { - return filename.endsWith(".c") || filename.endsWith(".cpp") || filename.endsWith(".cxx") || (new File(dir.getAbsolutePath() + System.getProperty("file.separator") + filename).isDirectory()); + return filename.endsWith(".h") || filename.endsWith(".c") || filename.endsWith(".cpp") || filename.endsWith(".cxx") || (new File(dir.getAbsolutePath() + System.getProperty("file.separator") + filename).isDirectory()); } } diff --git a/pmd/xdocs/credits.xml b/pmd/xdocs/credits.xml index 9bd465975e..4d09ae36b6 100644 --- a/pmd/xdocs/credits.xml +++ b/pmd/xdocs/credits.xml @@ -45,6 +45,7 @@