From 6984c07d0839ba256a020aef7f32ecf180fcc68b Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Tue, 28 Nov 2006 14:04:12 +0000 Subject: [PATCH] Fixed bug 1560944 - CPD now skips symlinks. git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4836 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/etc/changelog.txt | 1 + pmd/src/net/sourceforge/pmd/cpd/CPD.java | 5 +++++ pmd/xdocs/credits.xml | 1 + 3 files changed, 7 insertions(+) diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index 30df3951fc..9cb3d3263b 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -17,6 +17,7 @@ Fixed bug 1580859 - AvoidDecimalLiteralsInBigDecimalConstructor now catches more Fixed bug 1581123 - False +: UnnecessaryWrapperObjectCreation. Fixed bug 1592710 - VariableNamingConventions no longer reports false positives on certain enum declarations. Fixed bug 1593292 - The CPD GUI now works with the 'by extension' option selected. +Fixed bug 1560944 - CPD now skips symlinks. Applied patch 1551189 - SingularField false + for initialization blocks Applied patch 1573981 - false + in CloneMethodMustImplementCloneable Applied patch 1574988 - false + in OverrideBothEqualsAndHashcode diff --git a/pmd/src/net/sourceforge/pmd/cpd/CPD.java b/pmd/src/net/sourceforge/pmd/cpd/CPD.java index b3564be06d..ade7f60e2e 100644 --- a/pmd/src/net/sourceforge/pmd/cpd/CPD.java +++ b/pmd/src/net/sourceforge/pmd/cpd/CPD.java @@ -87,6 +87,11 @@ public class CPD { current.add(signature); } + if (!file.getCanonicalPath().equals(file.getAbsolutePath())) { + System.out.println("Skipping " + file + " since it appears to be a symlink"); + return; + } + listener.addedFile(fileCount, file); SourceCode sourceCode = new SourceCode(new SourceCode.FileCodeLoader(file)); language.getTokenizer().tokenize(sourceCode, tokens); diff --git a/pmd/xdocs/credits.xml b/pmd/xdocs/credits.xml index 6605a0597e..7ea3460753 100644 --- a/pmd/xdocs/credits.xml +++ b/pmd/xdocs/credits.xml @@ -54,6 +54,7 @@