192 Commits

Author SHA1 Message Date
Andreas Dangel
e9149551b7 [maven-release-plugin] prepare for next development iteration 2017-01-28 13:15:11 +01:00
Andreas Dangel
12758ef777 [maven-release-plugin] prepare release pmd_releases/5.4.4 2017-01-28 13:15:10 +01:00
Juan Martín Sotuyo Dodero
c2d22a1bdf Make Mark's code snippet lazy
- This greatly reduces the memory footprint during analysis,
    addressing part of the issues raised ay #185
 - Rendering is still done to a single String which is then either printed
    to STDOUT or a file, this stiill needs refactoring.
2017-01-27 12:01:46 +01:00
Juan Martín Sotuyo Dodero
3caa71b94b Resolve #180 - refactor pmd processors
- SourceCodeProcessor now consistently calls rule sets start / end
    if cache is not up to date
 - Both Mono and MultiThread Processors rely on PmdRunnable, just using
    different execution strategies
 - This also fixes https://sourceforge.net/p/pmd/bugs/1511/
2017-01-22 19:19:21 +01:00
Andreas Dangel
4c1890d56c Add unit test to verify encoding of XML formatter 2017-01-21 11:58:59 +01:00
pyxide
43a38d3144 Console encoding only when interactive 2017-01-10 09:54:44 -03:00
pyxide
d7c503bee4 checkstyle fixes 2017-01-10 09:54:44 -03:00
pyxide
958f8df5f5 Reflection detection code for console encoding
Note: calling the static native method `String Console.encoding()` returns the current console encoding, even if `System.console()` is null because the console is not interactive (pipe or redirection).
2017-01-10 09:54:44 -03:00
pyxide
89600bfcc4 checkstyle fixes 2017-01-10 09:54:44 -03:00
pyxide
abf65acb63 Bug fix and enhanced console output encoding
- due to some rewriting without testing, the encoding property was not added to the renderer properties.
- better console encoding: use system property `sun.stdout.encoding` in interactive console, and `file.encoding` in piped or redirected output
2017-01-10 09:54:44 -03:00
pyxide
4c71b0da4a checkstyle fixes 2017-01-10 09:54:44 -03:00
pyxide
368313fd8f Update Formatter.java 2017-01-10 09:54:44 -03:00
pyxide
74583d003a Ant Task Formatter encoding issue with XMLRenderer
Hi,

The writers in the Ant task's formatter uses the default platform's encoding (for instance cp1252 on Western Windows) and the XMLRenderer sets the default XML encoding to UTF-8. This may lead to incorrect XML encoding, detected for instance when the XML file is sent to a XSLT task.
This goes undetected as long as the characters in the XML file are in the ASCII subset, which is frequently the case with code, usually in plain Latin language. In my case, the issue was raised because of the localized formatting of some line numbers greater than 999, due to localized thousand separator 0xA0, which is out of the ASCII subset.

I modified the Formatter class to always use a charset for writers. When no encoding is specified, UTF-8 is used instead of the default platform's encoding.

I strongly recommend to *always set the encoding parameter* of the formatter element. It should be reflected as so in the Ant Task documentation.

```xml
<pmd encoding="cp1252"> <!-- source encoding -->
  <formatter type="xml" toFile="pmd.xml">
    <param name="encoding" value="UTF-8" /> <!-- report encoding -->
  </formatter>
  <fileset dir="src/main/java">
    <include name="**/*.java"/>
  </fileset>
</pmd>
```
Note: when digging into sourceforge issues for similar bugs, I found [Bug 877: Output with encoding CP1252](https://sourceforge.net/p/pmd/bugs/877/) . Not the same task, but the same symptoms, probably the same cause ?
2017-01-10 09:54:44 -03:00
Juan Martín Sotuyo Dodero
eca1f7c8ef Remove synchronization from RuleContext 2016-11-26 17:07:05 +01:00
Juan Martín Sotuyo Dodero
87f26e57e7 Use a LRU cache in SaxonXPathRuleQuery 2016-11-26 17:07:05 +01:00
Juan Martín Sotuyo Dodero
49e3de4a06 Allow concurrency in AttributeAxisIterator 2016-11-26 17:03:32 +01:00
Andreas Dangel
e78f80416a [maven-release-plugin] prepare for next development iteration 2016-11-04 21:01:18 +01:00
Andreas Dangel
5019eb11e4 [maven-release-plugin] prepare release pmd_releases/5.4.3 2016-11-04 21:01:18 +01:00
Andreas Dangel
7578875cbd #1508 - Only close the classloader if its ours 2016-07-26 21:49:33 +02:00
Andreas Dangel
42a5c6a537 Merge branch 'bug-1508' into pmd/5.4.x 2016-07-26 21:42:55 +02:00
Andreas Dangel
d76b689c07 Fixes #1508 [core] [java] PMD is leaking file handles
Closes class loader after PMD has processed all files
2016-07-25 21:42:21 +02:00
Andreas Dangel
293731f009 Fixes #1508 [core] [java] PMD is leaking file handles
Closes class loader after ant task is finished
2016-07-25 21:34:40 +02:00
Andreas Dangel
88d1823c2e Fixes #1508 [core] [java] PMD is leaking file handles
Fixes InputStreams and Readers
2016-07-25 21:25:34 +02:00
Andreas Dangel
e25bd5e9c1 Merge branch 'bug-1499' into pmd/5.4.x 2016-07-02 16:54:50 +02:00
Andreas Dangel
553cafff6e Fixes #1499 [core] CPD test break PMD 5.5.1 build on Windows 2016-07-02 16:48:46 +02:00
Andreas Dangel
4512da8f3f [maven-release-plugin] prepare for next development iteration 2016-05-29 20:04:35 +02:00
Andreas Dangel
5fa4b309ed [maven-release-plugin] prepare release pmd_releases/5.4.2 2016-05-29 20:04:34 +02:00
Andreas Dangel
dc1d942241 Merge branch 'bug-1481' into pmd/5.4.x 2016-05-28 11:42:01 +02:00
Andreas Dangel
13f7675b67 Fixes #1481 no problems found results in blank file instead of empty xml 2016-05-28 11:27:22 +02:00
Andreas Dangel
6cd0ca309f Merge branch 'issue-1360-ruleset-compatibility' into pmd/5.4.x 2016-05-18 20:57:53 +02:00
Andreas Dangel
f32beeb726 Provide a command line option for #1360 - "-noRuleSetCompatibility" 2016-05-18 20:38:44 +02:00
Andreas Dangel
fadd6a9a1c Merge branch 'issue-1360-ruleset-compatibility' into pmd/5.4.x 2016-05-13 19:02:53 +02:00
Andreas Dangel
1b65c7fe91 References #1360 Provide backwards combatibility for PMD configuration file
Handle exclusions
2016-05-13 18:53:00 +02:00
Andreas Dangel
44ee51d5a6 References #1360 Provide backwards combatibility for PMD configuration file
Add test cases for excluded rules
2016-05-06 11:08:25 +02:00
Andreas Dangel
15fd444b7a References #1360 Provide backwards combatibility for PMD configuration file 2016-05-06 10:52:43 +02:00
Andreas Dangel
2afd30c283 [maven-release-plugin] prepare for next development iteration 2016-04-30 23:15:13 +02:00
Andreas Dangel
d89549f994 [maven-release-plugin] prepare release pmd_releases/5.3.7 2016-04-30 23:15:13 +02:00
Andreas Dangel
395a40a7ae Merge branch 'pr-33' into pmd/5.4.x 2016-03-29 20:06:23 +02:00
Andreas Dangel
e58feea9cd Merge branch 'bug-1461-doc' into pmd/5.4.x 2016-03-13 15:29:10 +01:00
Andreas Dangel
c571abdb1d Merge branch 'bug-1461-doc' into pmd/5.3.x 2016-03-13 15:28:58 +01:00
Andreas Dangel
0725586b9a Update documentation about thread safety of rules (see #1461) 2016-03-13 15:28:37 +01:00
Andreas Dangel
3dd8156014 Merge branch 'bug-1461' into pmd/5.4.x 2016-03-10 20:23:43 +01:00
Andreas Dangel
ccbb372a4f Fix compile error (pmd 5.3.x is on java6) 2016-03-10 20:19:30 +01:00
Andreas Dangel
4a0802a269 Revert "RuleSetFactory Performance Enhancement:-"
This reverts commit 9da51952efb1671d664b20ffb3d49506e34d0818.
2016-03-10 20:11:06 +01:00
Andreas Dangel
3de70426cf Revert "Update changelog, keep backwards compatible createRuleSets methods by overloading"
This reverts commit b753cc5ec5d2240e907b60f78925f78c2f682bf5.
2016-03-10 20:10:58 +01:00
Andreas Dangel
54ce3036b2 Add unit test to verify concurrency issue #1461
References pr #75
2016-03-10 20:10:51 +01:00
Andreas Dangel
a42cb1b0c2 Merge branch 'pr-31' into pmd/5.4.x 2016-01-21 20:30:39 +01:00
Andreas Dangel
04527bc4cb Update changelog 2016-01-21 20:23:02 +01:00
Andreas Dangel
82178809fa Merge branch 'detect_file_encoding_using_UTF_BOM' of https://github.com/tiobe/pmd into pr-31 2016-01-21 20:10:22 +01:00
Andreas Dangel
bd64e4fdc6 Merge branch 'pr-30' into pmd/5.4.x 2016-01-20 22:24:08 +01:00