GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — [cpd] AnyTokenizer doesn't count columns correctly · Issue #2760 · pmd/pmd Closed DescriptionAffects PMD Version: 6.25.0+ Description: With 6.25.0 AnyTokenizer now supports columns (b976d65), but the columns are not reset when a new line starts. So the beginColumn/endColumn property is always incrementing... Code Sample demonstrating the issue: Create two files file1.txt file2.txt Steps to reproduce:
The output is this: <?xml version="1.0" encoding="UTF-8"?> <pmd-cpd> <duplication lines="2" tokens="4"> <file column="10" endcolumn="33" endline="3" line="2" path="/.../file1.txt"/> <file column="6" endcolumn="33" endline="3" line="2" path="/.../file2.txt"/> <codefragment><![CDATA[This is some duplication.]]></codefragment> </duplication> </pmd-cpd> The begin column should be for both occurrences "1", the endcolumn in file 1 should be 12 and in file 2 it should be 16. Running PMD through: CLI I guess, we simply need to reset the var
Maybe we can also leverage the new tokenizer test method ("CpdTextComparisonTest") for the AnyTokenizer. Relates to #2758 Activity
| ||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |