1575 Commits

Author SHA1 Message Date
Clément Fournier
292fa74ef5 Simplify test
I don't think we need to assert everything, the pmd-dist module
already has a test like that
2020-08-28 14:04:38 +02:00
Clément Fournier
986b39208f Remove dead code in PMDCommandLineInterface 2020-08-28 13:59:43 +02:00
XenoAmess
32698d8c6b add unit test for the change made. 2020-08-27 13:43:24 +08:00
XenoAmess
efd87c50e4 Fix a NPE created by the last pr.
Sorry about that.
2020-08-26 21:08:51 +08:00
XenoAmess
90f53f892f StringBuilder issues 2020-08-25 03:06:56 +08:00
Andreas Dangel
89140d86ce Merge branch 'master' into pr-2656 2020-08-20 09:47:16 +02:00
Andreas Dangel
b01dc8371b [core] Backporting fixes from pmd7
LanguageFactory and LanguageRegistry are more
robust in case a single language can't
be loaded.
2020-08-06 11:29:05 +02:00
Andreas Dangel
0a7d3ff922 Merge branch 'pr-2690'
[core] Fix java7 compatibility #2690
2020-08-06 10:25:48 +02:00
Andreas Dangel
420e3cb11c Merge branch 'pr-2691'
[core] Duplicate warning for missing language attribute #2691
2020-08-06 10:23:49 +02:00
Clément Fournier
709ec484c6 Merge branch 'master' into deprecate-report-methods 2020-08-03 13:26:49 +02:00
Clément Fournier
1080d123c6 Merge branch 'master' into deprecate-report-methods 2020-08-03 13:23:17 +02:00
Clément Fournier
66efc90cb3 PR comments 2020-08-03 13:20:51 +02:00
Andreas Dangel
8782eaeb1a Merge branch 'pr-2681'
[core] Deprecate DFA #2681
2020-08-02 17:04:44 +02:00
Andreas Dangel
21d3bfc0c5 Merge branch 'pr-2676'
[core] Deprecate RuleContext attributes #2676
2020-08-02 16:56:38 +02:00
Andreas Dangel
40f954f81a Merge branch 'pr-2675'
[core] Deprecate parser options #2675
2020-08-02 16:53:24 +02:00
Andreas Dangel
54637c60ec [core] Remove dependency to commons text, it is actually not needed
Escaping in CDATA section is not necessary.
2020-08-02 12:28:21 +02:00
Andreas Dangel
4cf9f5904a [core] Fix java7 compatibility
* Scala also requires java8 and it failed indirectly via a
  ServiceConfigurationError while discovering the language.
  Scala's dependencies require java8.
* Downgrade JCommander for java7 compatibility
* Downgrade commons-text for java7 compatibility
* Add integration test
2020-08-01 17:53:45 +02:00
Clément Fournier
df5d3d2afd Only warn if warnDeprecated 2020-07-31 17:49:05 +02:00
Andreas Dangel
9b6dcfef3a Merge branch 'pr-2682'
[java] New Rule: AvoidReassigningCatchVariables #2682
2020-07-31 11:00:18 +02:00
Andreas Dangel
c447319fbe [doc] Update release notes and new rules
Fixes #2471
Refs #2682
2020-07-31 10:59:00 +02:00
Andreas Dangel
eb683569af Merge branch 'pr-2617'
[core] Deprecate missing language attribute on rule definition #2617
2020-07-30 10:19:03 +02:00
Clément Fournier
34d961b794 Deprecate ReadableDuration 2020-07-29 17:45:19 +02:00
Clément Fournier
658efc4fe3 Update release notes 2020-07-29 00:03:53 +02:00
Clément Fournier
520711a773 Deprecate framework in core 2020-07-28 23:47:05 +02:00
Clément Fournier
772bc1346c Deprecate more things 2020-07-28 23:34:01 +02:00
Clément Fournier
ce32573090 Deprecate more methods 2020-07-28 14:55:01 +02:00
Clément Fournier
f62a411a45 Deprecate some Report methods 2020-07-28 14:48:02 +02:00
Clément Fournier
7ab1ab0a76 Deprecate some methods on RuleContext 2020-07-28 14:40:53 +02:00
Clément Fournier
0609aac9d3 Deprecate AbstractParser 2020-07-28 14:36:20 +02:00
Clément Fournier
8fe29dfee7 Deprecations in XML module 2020-07-28 14:26:07 +02:00
Clément Fournier
9a37ab4962 Deprecate parser options in some places
There is no way to introduce the new API
in a binary compatible change, so LVHandler::getDefaultParserOptions,
LVHandler::getParser and Parser::parse
will remain like this until 7.0 and be
broken.
2020-07-28 14:25:51 +02:00
Andreas Dangel
fe82f6a448 Dogfood - update PMD to 6.26.0, update build-tools 2020-07-25 15:27:24 +02:00
Andreas Dangel
49ab75aeb7 [maven-release-plugin] prepare for next development iteration 2020-07-25 13:45:36 +02:00
Andreas Dangel
a9632e2a06 [maven-release-plugin] prepare release pmd_releases/6.26.0 2020-07-25 13:45:27 +02:00
Andreas Dangel
0738797738 Merge branch 'pr-2658'
[core][java] Deprecate pmd-core::lang.rule.ImportWrapper #2658
2020-07-24 09:47:32 +02:00
Clément Fournier
2fad9acfbd Merge branch 'master' into issue-2546 2020-07-23 15:52:30 +02:00
Andreas Dangel
62666213ba Deprecate pmd-core::lang.rule.ImportWrapper 2020-07-23 11:15:03 +02:00
Clément Fournier
2e9f5ad897 Merge branch 'master' into issue-2615 2020-07-20 16:36:16 +02:00
Maikel Steneker
6fb5ac59b9 Ensure CPD uses tab width of 1 for tabs consistently
The columns that are reported by CPD were inconsistent across languages
before. A language like Java (using a JavaCC-based tokenizer) would use
a width of 8 for tabs, whereas a language like C# (using an Antlr-based
tokenizer) would use 1 instead.

This includes unit tests for most languages to ensure a tab character is
counted as 1. The configuration for JavaCC has been adjusted to respect
this as well.
2020-07-20 10:42:21 +02:00
Andreas Dangel
7b3d31246e Merge branch 'master' into pr-2624 2020-07-17 15:16:24 +02:00
Andreas Dangel
e4690cb56a Fix compile errors for CPD only languages 2020-07-17 15:04:43 +02:00
Andreas Dangel
7ae424a35b Add deprecation javadocs 2020-07-17 14:43:43 +02:00
Andreas Dangel
e24a26e211 Merge branch 'pr-2629'
[all] Dependencies cleanup #2629
2020-07-17 12:07:03 +02:00
Andreas Dangel
a8a3fccdf5 [doc] Update release notes, new rule UnusedAssignment 2020-07-16 19:22:38 +02:00
Andreas Dangel
6d4d3b20fc [java] DuplicateImports - fix false positive with static import
Fixes #2546
2020-07-16 11:24:57 +02:00
Andreas Dangel
e6600ec856 [core] Provide StringUtil.removeInvalidXml10Characters
And use it in both CPD/PMD XMLRenderers.
2020-07-09 11:07:06 +02:00
Andreas Dangel
2e006697e0 [core] Refactor XMLRenderer to use XMLStreamWriter
In order to properly support different encodings, a OutputStream
is needed. Then Java will take care of unmappaple characters
and encode them as entities for XML.

For backwards compatibility, a writer is still created and exposed.
2020-07-09 10:56:44 +02:00
Clément Fournier
c25e10717b Fix construction of rulechain visitor
Ctor needs to be public, because RuleChain
builds them from a class
2020-07-06 15:53:52 +02:00
Clément Fournier
eac96a433a Fix remaining usages of old ctor 2020-07-06 13:50:32 +02:00
Andreas Dangel
0bd9b1db6b [core] XMLRenderer - avoid unmappable characters for non UTF-8 encodings 2020-07-05 22:10:14 +02:00