9089 Commits

Author SHA1 Message Date
Sergey Gorbaty
3079ce26a8 Bug fix 2017-01-24 14:27:29 -03:00
Juan Martín Sotuyo Dodero
291698cdbc Update changelog 2017-01-16 18:26:10 -03:00
Sergey
ba325eb8a2 Dead code removal 2017-01-16 18:25:33 -03:00
Juan Martín Sotuyo Dodero
549274f852 Update changelog 2017-01-16 17:36:59 -03:00
Sergey
1bbd10f01b Detection of sharing violation when Database. methods are used 2017-01-16 17:36:20 -03:00
Sergey
fb25329e0d Bug fix to improve detection of concatenated vars 2017-01-16 15:23:26 -03:00
Sergey
7e83147a61 Unit test bug 2017-01-16 15:02:43 -03:00
Juan Martín Sotuyo Dodero
15336017ef Fix typo in PMD-Groovy's pom 2017-01-16 14:49:18 -03:00
Andreas Dangel
2fdfa26e4c Update changelog 2017-01-15 19:24:02 +01:00
Juan Martín Sotuyo Dodero
80b2792db5 Fix #183 - Count whole expressions as 1 line
- This is consistent with how we count "lines" in other languages.
 - Notice we are not actually counting lines, so multiline expressions are
    counted as 1.
 - Having multiple variable declarations together is still counting 1 per variable.
2017-01-15 18:33:06 +01:00
Juan Martín Sotuyo Dodero
4055a79e4c Update changelog 2017-01-12 22:35:09 -03:00
Juan Martín Sotuyo Dodero
16b9d566f3 Merge branch 'pr-184' into pmd/5.5.x 2017-01-12 22:35:05 -03:00
Sergey
79121c42cc Comment to warn future folks to check Apex compiler implementation first 2017-01-12 22:28:45 -03:00
Sergey Gorbaty
edabb22f37 Improving detection for assignment operator 2017-01-12 22:28:45 -03:00
Sergey Gorbaty
a38526544a Improving open redirect detection for static fields 2017-01-12 22:28:45 -03:00
Juan Martín Sotuyo Dodero
174ffa9461 Update changelog 2017-01-12 22:03:34 -03:00
Juan Martín Sotuyo Dodero
9b0839a46c Merge branch 'pr-181' into pmd/5.5.x 2017-01-12 21:38:21 -03:00
Sergey
608c9139be Bug fix #3 for else statements 2017-01-12 21:32:07 -03:00
Sergey
9db4b2503d Bug fixes part 2 2017-01-12 21:32:07 -03:00
Sergey
9d384f404c Bug fixes 2017-01-12 21:32:07 -03:00
Sergey Gorbaty
7a3ab3d7a1 Accessibility checks improved with CF 2017-01-12 21:31:31 -03:00
Sergey Gorbaty
9baf99f19d CF based CRUD rule checking 2017-01-12 21:31:31 -03:00
Juan Martín Sotuyo Dodero
64f8fbcf26 Merge branch 'formatter-docs' into pmd/5.5.x 2017-01-10 11:09:14 -03:00
Juan Martín Sotuyo Dodero
c8b38c83ca Update changelog 2017-01-10 11:07:32 -03:00
Juan Martín Sotuyo Dodero
bbba3aa608 Add documentation on formatter encoding 2017-01-10 10:50:14 -03:00
Juan Martín Sotuyo Dodero
1cfbdc9268 Merge branch 'pr-170' into pmd/5.5.x 2017-01-10 10:06:37 -03: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
Andreas Dangel
923aab8065 Merge branch 'bug-1556' into pmd/5.5.x 2017-01-08 13:58:13 +01:00
Andreas Dangel
c0e1c3e731 Slightly improve performance of XPath Rule UseLocaleWithCaseConversions 2017-01-08 13:51:44 +01:00
Andreas Dangel
af3ad2bc02 Fixes #1556 [java] UseLocaleWithCaseConversions does not works with ResultSet (false negative) 2017-01-08 12:12:56 +01:00
Juan Martín Sotuyo Dodero
6f6d37b2a1 Update changelog 2017-01-07 22:22:07 -03:00
Sergey
03a5aa2519 Legacy test class declaration 2017-01-07 22:21:33 -03:00
Juan Martín Sotuyo Dodero
0be5a1554c Update changelog 2017-01-07 22:01:28 -03:00
Sergey
9c85a78884 Improving open redirect detection for strings prefixed with / 2017-01-07 22:00:48 -03:00
Andreas Dangel
c9514e563a Merge branch 'bug-177' into pmd/5.5.x
Fixes #177
2017-01-06 10:35:45 +01:00
Andreas Dangel
f825cdb1db Merge branch 'bug-177' into pmd/5.4.x
Fixes #177
2017-01-06 10:17:34 +01:00
Andreas Dangel
af9d78c01a Update changelog 2017-01-06 10:16:45 +01:00
Andreas Dangel
767c9aae79 Bugfix singular field + lambda 2017-01-06 10:07:19 +01:00
Andreas Dangel
c794d952b1 Merge branch 'pr-175' into pmd/5.5.x
Closes #175 (rebased onto pmd/5.5.x)
2017-01-04 20:18:40 +01:00
Andreas Dangel
04cefcbe06 GC and thread safety changes
(Re-applied from 10e3bc172bd7a2b97b2a98fcf423a3232d3bdd25)
2017-01-04 20:18:21 +01:00
Andreas Dangel
2566bbaf2e apex: Take over rule descriptions from changelog for security ruleset 2017-01-04 20:06:36 +01:00
Sergey
6ea28811f4 Small edits to release notes 2017-01-04 19:56:25 +01:00
Andreas Dangel
2b8f1c559b Update changelog 2017-01-04 19:54:41 +01:00