Compare commits

...
Author SHA1 Message Date
phoedos 590f1871fe simulate_local_edits.py 2024-11-22 15:29:08 +05:00
phoedos a73f81aec4 a lot of random changes 2024-11-22 14:59:02 +05:00
phoedos 0fdeb67010 a lot of random changes 2024-11-22 14:57:15 +05:00
phoedos f02c057b4f Simulate big commit with random edits 2024-11-22 14:52:44 +05:00
Andreas Dangel 4f766035a4 [java] Fix #5263 - UnnecessaryFullyQualifiedName FP with forward references (#5353)
Merge pull request #5353 from oowekyala:issue5263-ufqn-forward-ref
2024-11-22 09:48:25 +01:00
Andreas Dangel 9da17877ac [doc] Update release notes (#5263, #5353) 2024-11-22 09:47:53 +01:00
Andreas Dangel 3e9e128aa7 [java] UnnecessaryFullyQualifiedName - improve test case 2024-11-22 09:46:35 +01:00
Clément Fournier 918684c154 Fix static methods being whitelisted 2024-11-21 16:51:24 +01:00
Clément Fournier e63edf358e [java] Fix #5263 - UnnecessaryFullyQualifiedName FP with forward reference. 2024-11-21 15:26:54 +01:00
Clément Fournier 0d11f151bd [java] Add more details to parse failures in signatures 2024-11-21 14:55:51 +01:00
Juan Martín Sotuyo Dodero 28b4139cd4 Bump rouge from 4.5.0 to 4.5.1 in the all-gems group across 1 directory (#5348) 2024-11-18 15:44:10 -03:00
Juan Martín Sotuyo Dodero d61f691559 Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.17.0 (#5350) 2024-11-18 15:43:55 -03:00
Clément Fournier 12f7f98803 Fix junit 5 warning
return type of factory method must be a collection
or array or stream
2024-11-18 11:43:51 +01:00
dependabot[bot] 2e4f16d516 Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.17.0
Bumps org.apache.commons:commons-lang3 from 3.14.0 to 3.17.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-lang3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 04:05:13 +00:00
dependabot[bot] 46ef55c9a9 Bump rouge from 4.5.0 to 4.5.1 in the all-gems group across 1 directory
Bumps the all-gems group with 1 update in the / directory: [rouge](https://github.com/rouge-ruby/rouge).


Updates `rouge` from 4.5.0 to 4.5.1
- [Release notes](https://github.com/rouge-ruby/rouge/releases)
- [Changelog](https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rouge-ruby/rouge/compare/v4.5.0...v4.5.1)

---
updated-dependencies:
- dependency-name: rouge
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-gems
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 03:46:56 +00:00
Andreas Dangel 79c0ce0415 [julia] Ignore generated code in Julia module (#5342)
Merge pull request #5342 from Monits:fix-generated-code-julia
2024-11-17 16:16:51 +01:00
Andreas Dangel 8fdfd369b0 [doc] Update release notes (#5342) 2024-11-17 16:15:55 +01:00
Andreas Dangel 80b8bc47df [gherkin] Remove generated gherkin code from coverage report (#5336)
Merge pull request #5336 from Monits:fix-generated-code-gherkin
2024-11-17 16:13:13 +01:00
Andreas Dangel a9b6c946b4 [doc] Update release notes (#5336) 2024-11-17 16:12:46 +01:00
Andreas Dangel 2910ab0403 [kotlin] Prevent auxiliary grammars from generating lexers (#5335)
Merge pull request #5335 from Monits:fix-generated-code-kotlin
2024-11-17 15:58:54 +01:00
Andreas Dangel 5a0220da2e [doc] Update release notes (#5335) 2024-11-17 15:58:05 +01:00
Andreas Dangel bc4a49deac [doc] Update docs/pages/pmd/projectdocs/credits.md [skip ci] 2024-11-17 15:49:32 +01:00
Andreas Dangel a40c30c8c1 [apex] New Rule: Queueable Should Attach Finalizer (#5303)
Merge pull request #5303 from mitchspano:Require_Finalizer
2024-11-17 15:46:05 +01:00
Andreas Dangel 44c15aae6d [doc] Update release notes (#5303, #5302) 2024-11-17 15:30:59 +01:00
Andreas Dangel 85aeebbab0 Merge branch 'main' into pr-5303 2024-11-17 15:25:24 +01:00
Andreas Dangel a5925eb5ea [doc] Fix typo in release notes 2024-11-17 15:24:49 +01:00
mitchspano c456396931 Reset credits.md to pmd main HEAD. 2024-11-15 22:14:20 +00:00
mitchspano 1ee0f53608 Update @mitchspano as a contributor 2024-11-15 22:07:44 +00:00
Juan Martín Sotuyo Dodero e60f460e02 Merge branch 'pr-5340' 2024-11-15 18:40:37 -03:00
Juan Martín Sotuyo Dodero ee1ab976bc update changelog, refs #5097 2024-11-15 18:39:39 -03:00
Juan Martín Sotuyo Dodero 15cab177d2 Remove added test 2024-11-15 18:30:03 -03:00
Juan Martín Sotuyo Dodero b6f45ed618 Ensure types don't match 2024-11-15 17:55:07 -03:00
Juan Martín Sotuyo Dodero 1ceae38880 [java] TooFewBranchesForSwitch - allow list of case constants (#5289) 2024-11-15 13:48:50 -06:00
Juan Martín Sotuyo Dodero f7de8d3e7e Merge branch 'pr-5331' 2024-11-15 16:47:09 -03:00
Juan Martín Sotuyo Dodero 59864a7c6c Merge branch 'pr-5341' 2024-11-15 16:15:19 -03:00
Juan Martín Sotuyo Dodero a6746fcffa Update changelog, refs #5083 2024-11-15 16:14:53 -03:00
Juan Martín Sotuyo Dodero aad8e93a2f Add test case ensuring we don't incur in FNs 2024-11-15 16:13:44 -03:00
Juan Martín Sotuyo Dodero 3bb943e0e5 Add deprecated code for backwards compatibility 2024-11-15 16:01:45 -03:00
Juan Martín Sotuyo Dodero 3356dd949d Ignore generated code in Julia module 2024-11-15 15:42:35 -03:00
Clément Fournier b264fa14e1 Fix #5083 - mref without target type but with exact method
has compile time decl
2024-11-15 16:36:52 +01:00
Clément Fournier c1aa4e0381 Merge branch 'main' into typeres-problem-with-unchecked-conversion 2024-11-15 16:18:22 +01:00
Clément Fournier a72ac5845b Add test for #5113 2024-11-15 16:16:08 +01:00
Juan Martín Sotuyo Dodero 4e1f4be009 Merge branch 'main' into issue-5287 2024-11-15 08:51:52 -06:00
Juan Martín Sotuyo Dodero c73e5cb8b1 [html] Test for a closing tag when determining node positions (#5328) 2024-11-15 08:50:53 -06:00
Clément Fournier 5931b6601c [java] Fix #5097 - problem with unchecked conversion 2024-11-15 15:27:55 +01:00
Juan Martín Sotuyo Dodero 9d15c900db Pass linters in generated code 2024-11-15 11:27:07 -03:00
mitchspano 69a24126f7 Fix formatting and static code analysis findings. 2024-11-14 23:29:44 +00:00
Juan Martín Sotuyo Dodero ef3a4cc15e Remove generated gherkin code from coverage report
- Take the chance to remove / deprecate autogenerated classes that are
   not needed and were not used.
2024-11-14 18:10:59 -03:00
Juan Martín Sotuyo Dodero 4ef8fb21a9 Merge branch 'main' into issue-5322 2024-11-14 14:38:45 -06:00
Juan Martín Sotuyo Dodero f803aa36dc [java] InsufficientStringBufferDeclaration: Fix CCE for Character (#5332) 2024-11-14 13:57:49 -06:00
Juan Martín Sotuyo Dodero 0cf8f2c18b Suppress style warnings on generated file 2024-11-14 16:55:55 -03:00
Juan Martín Sotuyo Dodero 178f9541e2 Add since to deprecation notice 2024-11-14 16:51:04 -03:00
Juan Martín Sotuyo Dodero 79026f98c9 Add licence header 2024-11-14 16:49:45 -03:00
Juan Martín Sotuyo Dodero 0e0f347f51 Rename parser before annotating to ensure files are found 2024-11-14 16:47:20 -03:00
Juan Martín Sotuyo Dodero 0d606a7122 Prevent auxiliary grammars from generating lexers
- A misconfiguration of Antlr4 produced an auxiliary gramma
   (UnicodeClasses), that was imported into the main kotlin grammar,
   to produce it's own Lexer, which was never used.
 - We no longer produce that Lexer, properly moving imports to the
   standard directory for that.
 - We manually copy a generated version for API compatibility, flagging
   it as both Generated and Deprecated for removal in PMD 8
2024-11-14 16:39:09 -03:00
Andreas Dangel d60b234a47 Merge branch 'main' into issue-5314 2024-11-14 19:47:41 +01:00
Andreas Dangel b050ce353e [java] Propagate unknown type better when mref is unresolved (#5330)
Merge pull request #5330 from oowekyala:typeres-fix-inference-issue-mref
2024-11-14 19:18:43 +01:00
Andreas Dangel 32f55e22e3 [doc] Update release notes (#5329, #5330) 2024-11-14 19:18:11 +01:00
Andreas Dangel 206ed8bbd3 [apex] Use case-insensitive input stream to avoid choking on Unicode escape sequences (#5284)
Merge pull request #5284 from wahajenius:main
2024-11-14 18:23:26 +01:00
Andreas Dangel e1d4f27e19 Add @wahajenius as a contributor 2024-11-14 18:18:06 +01:00
Andreas Dangel 093683bc59 [doc] Update release notes (#5284, #5333) 2024-11-14 18:17:49 +01:00
Andreas Dangel 509452577d [apex] Add test case for #5333 2024-11-14 18:16:06 +01:00
Andreas Dangel 991bc2c41d [apex] Report LexException when extracting comments 2024-11-14 18:12:13 +01:00
Andreas Dangel 8c58a0b3f5 Merge branch 'main' into pr-5284 2024-11-14 18:01:56 +01:00
Andreas Dangel 01b8ca765b Add @chenguangqi as a contributor 2024-11-14 17:48:26 +01:00
Andreas Dangel 3fdbf7d6cb [java] InsufficientStringBufferDeclaration: Fix CCE for Character
Fixes #5314
2024-11-14 17:48:08 +01:00
Andreas Dangel bb729e02f4 Add @VitaliiIevtushenko as a contributor 2024-11-14 17:39:32 +01:00
Clément Fournier bf388d7fd0 Propagate unknown type better when mref is unresolved 2024-11-14 17:39:31 +01:00
Andreas Dangel 61eb116833 [java] PreserveStackTrace - consider instance type patterns
Fixes #5318
2024-11-14 17:39:07 +01:00
Andreas Dangel 634a525286 [html] Test for a closing tag when determining node positions
Fixes #5322
2024-11-14 17:07:37 +01:00
Clément Fournier 2df68ed168 Disable type inf logging by default 2024-11-14 16:32:09 +01:00
Clément Fournier 04dfb782f0 Merge branch 'typeres-fix-inference-issue' 2024-11-14 16:14:50 +01:00
Clément Fournier a79d3e6557 Add unit tests 2024-11-14 16:13:30 +01:00
Andreas Dangel bb2782241e [java] Fix inference dependency issue with nested lambdas (#5325)
Merge pull request #5325 from oowekyala:typeres-fix-inference-issue
2024-11-14 15:51:08 +01:00
Andreas Dangel 2340168421 [doc] Update release notes (#5324) 2024-11-14 15:50:35 +01:00
Andreas Dangel e5a1236981 Update pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/bestpractices/xml/UnusedPrivateMethod.xml 2024-11-14 15:48:47 +01:00
dependabot[bot] ed5e862aa3 Bump rouge from 4.4.0 to 4.5.0 in the all-gems group across 1 directory (#5316)
Bumps the all-gems group with 1 update in the / directory: [rouge](https://github.com/rouge-ruby/rouge).


Updates `rouge` from 4.4.0 to 4.5.0
- [Release notes](https://github.com/rouge-ruby/rouge/releases)
- [Changelog](https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rouge-ruby/rouge/compare/v4.4.0...v4.5.0)

---
updated-dependencies:
- dependency-name: rouge
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all-gems
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-14 15:14:44 +01:00
Clément Fournier 529693c916 [java] fix inference dependency issue
Reported in #5324

I improved the verbose logging output a bit so
some of the changes are not directly relevant.
2024-11-13 22:39:34 +01:00
mitchspano 1a9e721fb6 Implements the RuleChain within the QueueableWithoutFinalizerRule.
Implements the [`RuleChain`](https://docs.pmd-code.org/latest/pmd_userdocs_extending_writing_java_rules.html#economic-traversal-the-rulechain) to traverse all classes within the file.
2024-11-12 21:59:02 +00:00
mitchspano 4e4ca6bb70 Incorporate code review feedback.
- Renames the rule to `QueueableWithoutFinalizer` to be more neutral.
- Provides a more robust description.
- Provides a more succinct error message.
- Provides a positive sample for the documentation .
2024-11-12 19:46:58 +00:00
Juan Martín Sotuyo Dodero 3659a2cb7d Bump org.apache.commons:commons-compress from 1.26.0 to 1.27.1 (#5317) 2024-11-10 22:55:15 -06:00
dependabot[bot] 07de5559bc Bump org.apache.commons:commons-compress from 1.26.0 to 1.27.1
Bumps org.apache.commons:commons-compress from 1.26.0 to 1.27.1.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-compress
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 03:35:46 +00:00
Andreas Dangel b05b8240a7 Merge branch 'main' into issue-5287 2024-11-07 19:51:00 +01:00
Andreas Dangel ee7d6fed3e [java] TooFewBranchesForSwitch - add test case from comment on #5311 2024-11-07 19:50:29 +01:00
Juan Martín Sotuyo Dodero fe88498ee8 [java] Fix #5293: Parse number of type parameters eagerly (#5309) 2024-11-07 06:19:16 -06:00
Juan Martín Sotuyo Dodero 944e1e8f7a Bump maven-pmd-plugin from 3.24.0 to 3.26.0 (#5312) 2024-11-07 06:17:30 -06:00
Andreas Dangel ca208d2241 Bump maven-pmd-plugin from 3.24.0 to 3.26.0 2024-11-07 12:40:18 +01:00
Andreas Dangel 9dcb697f13 Improve DeadlockTest 2024-11-07 12:38:11 +01:00
Andreas Dangel 733ac4bba0 [doc] Update release notes (#5293) 2024-11-04 11:23:49 +01:00
Andreas Dangel 1ee6494429 [java] Fix #5293: Parse number of type parameters eagerly
When creating a LazyClassSignature or LazyMethodType, make sure
to parse the number of type parameters eagerly, so that AstDisambiguationPass
can get this number without triggering additional parsing.
2024-11-04 11:23:49 +01:00
Andreas Dangel a1996554d8 [java] Add DeadlockTest for verifying #5293
- Improve logging for Parselock

Refs #5293
2024-11-04 11:23:48 +01:00
dependabot[bot] e15c05721e Bump webrick from 1.8.2 to 1.9.0 in /docs in the all-gems group across 1 directory (#5308)
Bump webrick in /docs in the all-gems group across 1 directory

Bumps the all-gems group with 1 update in the /docs directory: [webrick](https://github.com/ruby/webrick).


Updates `webrick` from 1.8.2 to 1.9.0
- [Release notes](https://github.com/ruby/webrick/releases)
- [Commits](https://github.com/ruby/webrick/compare/v1.8.2...v1.9.0)

---
updated-dependencies:
- dependency-name: webrick
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-gems
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-04 09:23:58 +01:00
Juan Martín Sotuyo Dodero f0daed5874 Bump org.apache.maven.plugins:maven-clean-plugin from 3.3.2 to 3.4.0 (#5307) 2024-11-03 21:54:00 -06:00
dependabot[bot] 36dfcf8211 Bump org.apache.maven.plugins:maven-clean-plugin from 3.3.2 to 3.4.0
Bumps [org.apache.maven.plugins:maven-clean-plugin](https://github.com/apache/maven-clean-plugin) from 3.3.2 to 3.4.0.
- [Release notes](https://github.com/apache/maven-clean-plugin/releases)
- [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-3.3.2...maven-clean-plugin-3.4.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-clean-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-04 03:08:41 +00:00
mitchspano 83d8ca0169 Fix bestPractices.xml formatting and priority definition. 2024-11-01 21:59:13 +00:00
mitchspano be3c34fe1a Add priority definition. 2024-11-01 21:29:30 +00:00
mitchspano 52fb6c814b Queueable Should Attach Finalizer 2024-11-01 21:17:53 +00:00
mitchspano 93929deef6 Update @mitchspano as a contributor 2024-11-01 17:09:51 +00:00
Andreas Dangel 3ed370f61d Bump gems and bundler (#5301)
- Bump bundler from 2.5.3 to 2.5.22
- Bump activesupport from 7.2.1 to 7.2.2
- Bump execjs from 2.9.1 to 2.10.0
- Bump faraday from 2.11.0 to 2.12.0
- Bump i18n from 1.14.5 to 1.14.6
- Bump json from 2.7.2 to 2.7.5
- Bump logger from 1.6.0 to 1.6.1
- Bump rexml from 3.3.6/3.3.8 to 3.3.9
- Bump rufus-scheduler from 3.9.2 to 3.9.2

- Fixes https://github.com/pmd/pmd/security/dependabot/69
- Fixes https://github.com/pmd/pmd/security/dependabot/70
2024-10-31 15:07:25 +01:00
Andreas Dangel 5eaefd2841 [doc] Update release notes (#1860) 2024-10-31 15:06:32 +01:00
Andreas Dangel a709be1dcb [xml] Have pmd-xml Lexer in line with other antlr grammars (#5296)
Merge pull request #5296 from Monits:align-xml-antlr
2024-10-31 12:27:11 +01:00
Andreas Dangel c079d8c544 [doc] Update release notes (#5296) 2024-10-31 12:25:59 +01:00
Andreas Dangel 7bfa581511 Merge branch 'main' into pr-5296 2024-10-31 12:17:57 +01:00
Andreas Dangel 6ae7404941 [xml] XMLLexer - Update deprecation notice 2024-10-31 12:17:27 +01:00
Juan Martín Sotuyo Dodero 94095df872 Fix style issues 2024-10-29 17:21:24 -03:00
Juan Martín Sotuyo Dodero 7119424d96 Add license header 2024-10-29 16:56:30 -03:00
Juan Martín Sotuyo Dodero 69a92de52d Have pmd-xml Lexer in line with other antlr grammars
- The package is no longer antlr4, but ast, as is in all other modules
 - We keep a deprecated proxy for backwards compatibility
 - We annotate the generated classes as such to ignore them from
   coverage reports
2024-10-28 22:10:21 -03:00
Juan Martín Sotuyo Dodero 73dbc7a67f Bump org.apache.maven.plugins:maven-assembly-plugin from 3.6.0 to 3.7.1 (#5290) 2024-10-28 14:06:52 -03:00
dependabot[bot] c81cd1d520 Bump org.apache.maven.plugins:maven-assembly-plugin from 3.6.0 to 3.7.1
Bumps [org.apache.maven.plugins:maven-assembly-plugin](https://github.com/apache/maven-assembly-plugin) from 3.6.0 to 3.7.1.
- [Release notes](https://github.com/apache/maven-assembly-plugin/releases)
- [Commits](https://github.com/apache/maven-assembly-plugin/compare/maven-assembly-plugin-3.6.0...maven-assembly-plugin-3.7.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-assembly-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-28 03:31:36 +00:00
Juan Martín Sotuyo Dodero 4473aa6667 [ant] Formatter: avoid reflective access to determine console encoding (#5286) 2024-10-27 15:40:04 -03:00
Juan Martín Sotuyo Dodero 97d68e331c Bump asm from 9.7 to 9.7.1 (#5288) 2024-10-27 12:38:42 -03:00
Andreas Dangel 16eafc89c2 [java] TooFewBranchesForSwitch - allow list of case constants
Fixes #5287
2024-10-27 16:24:05 +01:00
Andreas Dangel d68d6c57ef Bump asm from 9.7 to 9.7.1
This enables support for Java 24
Refs #5154
2024-10-27 15:53:00 +01:00
Andreas Dangel 9c098b2531 Bump pmd from 7.5.0 to 7.7.0 (#5285)
* Bump pmd from 7.5.0 to 7.7.0

* Bump build-tools from 27 to 28-SNAPSHOT

Needed to remove deprecation warnings
about old rule names
2024-10-27 15:20:28 +01:00
Andreas Dangel 3f697aff35 [ant] Formatter: avoid reflective access to determine console encoding
- for java 17+, there is public API to get the console encoding
  -> no problem
- for older java versions, try to use system property
  sun.jnu.encoding if it exists
- only then use the fall-backs with illegal reflective access
  to private fields/methods on java.io.Console
- Also avoid using reflection utils from apache commons, instead
  use reflection directly. The illegal access warnings are then
  properly reported against our class
  net.sourceforge.pmd.ant.Formatter.

Fixes #1860
2024-10-25 18:33:36 +02:00
Andreas Dangel 74ec6f45ee [doc] Fix release notes for 7.7.0
Old rule name was actually DefaultLabelNotLastInSwitchStmt
2024-10-25 10:35:02 +02:00
Andreas Dangel c179834288 [release] Prepare next development version [skip ci] 2024-10-25 09:28:54 +02:00
Andreas Dangel 7739f2b840 [release] prepare release pmd_releases/7.7.0 2024-10-25 09:07:54 +02:00
Andreas Dangel 919e73f6b0 Prepare pmd release 7.7.0 2024-10-25 08:47:38 +02:00
Andreas Dangel e2d59c0e64 Fix #5244: [java] UselessOperationOnImmutable: consider java.time.* types (#5279)
Merge pull request #5279 from adangel:issue-5244
2024-10-24 14:24:16 +02:00
Andreas Dangel 8f2d47dfb7 Fix #5270: [apex] AvoidNonRestrictiveQueries: Fix regex for detecting LIMIT clause (#5273)
Merge pull request #5273 from adangel:issue-5270
2024-10-24 14:22:25 +02:00
Andreas Dangel e6097d6090 [java] Rename rule SwitchStmtsShouldHaveDefault to NonExhaustiveSwitch (#5267)
Merge pull request #5267 from adangel:issue-4286
2024-10-24 14:21:04 +02:00
Andreas Dangel 5e83246469 [doc] Update release notes (#5267) 2024-10-24 14:16:43 +02:00
Andreas Dangel 62c2858f70 Fix #5257: [java] NonCaseLabelInSwitch - support switch expressions (#5256)
Merge pull request #5256 from adangel:rename-nocaselabelswitch
2024-10-24 14:15:06 +02:00
Andreas Dangel 0d8878d58e [java] Rename rule DefaultLabelNotLastInSwitch (#5255)
Merge pull request #5255 from adangel:rename-defaultlabelswitch
2024-10-24 14:10:16 +02:00
Andreas Dangel 4b23718aac Fix #4813: [java] SwitchStmtsShouldHaveDefault false positive with pattern matching (#5252)
Merge pull request #5252 from adangel:issue-4813
2024-10-24 14:08:12 +02:00
Andreas Dangel 3a501a0f6b Fix #5249 and #5250: [java] TooFewBranchesForSwitch ignore pattern matching and support switch expressions (#5251)
Merge pull request #5251 from adangel:issue-5249-5250
2024-10-24 14:06:03 +02:00
Andreas Dangel 36654ed52e [java] UselessOperationOnImmutable: false positive on void results 2024-10-24 13:08:09 +02:00
Andreas Dangel 45b1217485 [java] TooFewBranchesForSwitch: don't report empty switch
Empty switch statements are already reported
by EmptyControlStatement
2024-10-24 12:51:42 +02:00
Andreas Dangel 662759755d [java] SwitchStmtsShouldHaveDefault.xml: don't report empty switch
Empty switch statements are already reported
by EmptyControlStatement
2024-10-24 12:47:53 +02:00
Andreas Dangel d9d6b57f2a [java] TooFewBranchesForSwitch: report empty switch
This fixes a false negative
2024-10-24 12:38:45 +02:00
Andreas Dangel 6c35c73919 [java] SwitchStmtsShouldHaveDefault: use new PatternLabel attribute 2024-10-24 11:29:40 +02:00
Andreas Dangel e37f82b62d Merge branch 'main' into issue-4813 2024-10-24 11:24:17 +02:00
Andreas Dangel 6f5af6e585 [java] TooFewBranchesForSwitch: use new PatternLabel attribute 2024-10-24 11:22:47 +02:00
Andreas Dangel 66d879f707 Merge branch 'main' into issue-5249-5250 2024-10-24 11:20:39 +02:00
Andreas Dangel 93f6279ea7 Fix #3362: [java] ImplicitSwitchFallThrough should consider switch expressions (#5248) 2024-10-24 10:46:59 +02:00
Andreas Dangel 156f293ef3 Fix #5030: [java] SwitchDensity false positive with pattern matching (#5247) 2024-10-24 10:45:56 +02:00
Andreas Dangel 40ed4590be [java] Improve UnitTestShouldUse{After,Before}Annotation rules to support JUnit5 and TestNG (#5245) 2024-10-24 10:43:48 +02:00
Andreas Dangel 7358289bbe [cpp] Ignore literals and ignore identifiers capability to C++ CPD (#5040)
Merge pull request #5040 from jdupak:master
2024-10-24 10:18:39 +02:00
Andreas Dangel a180258033 [doc] Update release notes (#5040) 2024-10-24 10:17:51 +02:00
Andreas Dangel 63675eaa18 [doc] Update release notes (#5279) 2024-10-22 21:03:22 +02:00
Andreas Dangel 49f2c15b83 [doc] Update release notes (#5273) 2024-10-22 21:01:42 +02:00
Andreas Dangel 15520211b5 Merge branch 'main' into issue-5270 2024-10-22 21:01:00 +02:00
Andreas Dangel c4b8f18a36 [doc] Update release notes (#5252) 2024-10-22 20:58:37 +02:00
Andreas Dangel c95817a75d Merge branch 'main' into issue-4813 2024-10-22 20:55:38 +02:00
Andreas DangelandClément Fournier 09b0864eff Apply suggestions from code review
Co-authored-by: Clément Fournier <clement.fournier@tu-dresden.de>
2024-10-22 20:50:10 +02:00
dependabot[bot] 1517a18956 Bump org.scala-lang:scala-reflect from 2.13.13 to 2.13.15 (#5281)
Bumps [org.scala-lang:scala-reflect](https://github.com/scala/scala) from 2.13.13 to 2.13.15.
- [Release notes](https://github.com/scala/scala/releases)
- [Commits](https://github.com/scala/scala/compare/v2.13.13...v2.13.15)

---
updated-dependencies:
- dependency-name: org.scala-lang:scala-reflect
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-22 20:23:50 +02:00
Willem Hajenius 61b1c372cd [apex] Must use case-insensitive input stream to avoid choking on Unicode escape sequences 2024-10-22 12:27:28 +02:00
Juan Martín Sotuyo Dodero 97fe389dcc Bump danger from 9.5.0 to 9.5.1 in the all-gems group across 1 directory (#5280) 2024-10-21 11:28:12 -03:00
dependabot[bot] 7df70ea7c1 Bump danger from 9.5.0 to 9.5.1 in the all-gems group across 1 directory
Bumps the all-gems group with 1 update in the / directory: [danger](https://github.com/danger/danger).


Updates `danger` from 9.5.0 to 9.5.1
- [Release notes](https://github.com/danger/danger/releases)
- [Changelog](https://github.com/danger/danger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/danger/danger/compare/v9.5.0...v9.5.1)

---
updated-dependencies:
- dependency-name: danger
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all-gems
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 03:18:38 +00:00
Jakub Dupak 7ad4e0f0fc Add @jdupak as a contributor 2024-10-20 21:57:48 +02:00
Jakub Dupak c47f5a6062 [cpd] Add ignore literals and identifiers capability to C++ 2024-10-20 21:57:48 +02:00
Andreas Dangel 6d55f6f053 [java] UselessOperationOnImmutable: consider java.time.* types
Fixes #5244
2024-10-18 17:42:44 +02:00
dependabot[bot]andAndreas Dangel b60b4d8a68 Bump com.google.protobuf:protobuf-java from 3.25.3 to 4.28.2 (#5234)
* Bump com.google.protobuf:protobuf-java from 3.25.3 to 4.28.2

Bumps [com.google.protobuf:protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.25.3 to 4.28.2.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](https://github.com/protocolbuffers/protobuf/commits)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Cleanup comment about protobuf dependency

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andreas Dangel <andreas.dangel@pmd-code.org>
2024-10-18 16:42:52 +02:00
Andreas Dangel 5df7dccfb6 [doc] Update release notes (#5255) 2024-10-18 16:40:27 +02:00
Andreas Dangel f4941433ce Merge branch 'main' into rename-defaultlabelswitch 2024-10-18 16:39:12 +02:00
Andreas Dangel 665504decc [doc] Update release notes (#5251) 2024-10-18 16:30:41 +02:00
Andreas Dangel ef0db9a166 Merge branch 'main' into issue-5249-5250 2024-10-18 16:30:01 +02:00
Andreas Dangel fd8fcd67d6 [doc] Update release notes (#5248) 2024-10-18 16:23:17 +02:00
Andreas Dangel dafdc964a5 Merge branch 'main' into issue-3362 2024-10-18 16:22:17 +02:00
Andreas Dangel 81429a4628 [doc] Update release notes (#5247) 2024-10-18 16:21:02 +02:00
Andreas Dangel fb94e2493c Merge branch 'main' into issue-5030 2024-10-18 16:20:11 +02:00
Andreas Dangel a0d4b38b53 [doc] Update release notes (#5245) 2024-10-18 16:16:54 +02:00
Andreas Dangel f317e8bee5 Merge branch 'main' into java-unit-test-rules 2024-10-18 16:15:51 +02:00
dependabot[bot] 99f4c9c044 Bump org.checkerframework:checker-qual from 2.11.1 to 3.48.1 (#5276)
Bumps [org.checkerframework:checker-qual](https://github.com/typetools/checker-framework) from 2.11.1 to 3.48.1.
- [Release notes](https://github.com/typetools/checker-framework/releases)
- [Changelog](https://github.com/typetools/checker-framework/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/typetools/checker-framework/compare/checker-framework-2.11.1...checker-framework-3.48.1)

---
updated-dependencies:
- dependency-name: org.checkerframework:checker-qual
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-18 16:04:35 +02:00
Andreas Dangel 656b9052ad [java] CouplingBetweenObjects: improve violation message (#5278)
Merge pull request #5278 from adangel:coupling-between-objects-message
2024-10-18 15:40:54 +02:00
Andreas Dangel f0375d61dd [doc] Update release notes (#5278) 2024-10-18 15:39:52 +02:00
Andreas Dangel a24c8aa002 [doc] Update release notes 2024-10-18 15:36:28 +02:00
Andreas Dangel 5ffb953191 [java] CouplingBetweenObjects: improve violation message
When we add the actual count to the message,
we can more easily verify that the rule works
as expected.
2024-10-18 10:42:42 +02:00
Juan Martín Sotuyo Dodero d5faa1c74a Merge pull request #5275 from adangel/javacc-wrapper-improvement
Use plugin-classpath to simplify javacc-wrapper.xml
2024-10-13 23:54:54 -03:00
Andreas Dangel 867b142ee4 Use plugin-classpath to simplify javacc-wrapper.xml
javacc is on the antrun plugin's classpath.
The javacc jar file doesn't need to be copied
explicitly.
2024-10-13 12:28:16 +02:00
Andreas Dangel 0ea42b94e0 Ignore generated antlr classes in coverage reports (#5258)
Merge pull request #5258 from Monits:ignore-generated-antlr
2024-10-13 12:27:30 +02:00
Andreas Dangel f834b8744d [doc] Update release notes (#5258) 2024-10-13 12:26:31 +02:00
Juan Martín Sotuyo Dodero ab1976382a Remove ant.contrib.jar property 2024-10-12 17:28:18 -03:00
Andreas Dangel 08bcf29190 [java] Fix #5253: Support Boolean wrapper class for BooleanGetMethodName rule (#5269)
Merge pull request #5269 from Aryant-Tripathi:5253/feature/support-boolean-wrapper-in-get-method-rule
2024-10-12 18:04:14 +02:00
Andreas Dangel 85e0695ca6 Add @Aryant-Tripathi as a contributor 2024-10-12 18:02:07 +02:00
Andreas Dangel 47a59b1810 Add @phansys as a contributor 2024-10-12 18:01:45 +02:00
Andreas Dangel e50234563e [doc] Update release notes (#5253, #5269) 2024-10-12 18:01:21 +02:00
Aryant Tripathi 9a123bff94 Support wrapper class in BooleanGetMethodName rule (#5253)\n \n - Updated XPath rule to include both primitive and wrapper class:\n (PrimitiveType[@Kind = 'boolean'] or ClassType[pmd-java:typeIs('java.lang.Boolean')])\n - Added test cases to ensure that methods returning are also flagged correctly.\n - Ensured the rule enforces consistent method naming for both primitive and wrapper types. 2024-10-11 22:37:01 +05:30
Aryant Tripathi 9077c6a71f Support wrapper class in BooleanGetMethodName rule (#5253)\n \n - Updated XPath rule to include both primitive and wrapper class:\n (PrimitiveType[@Kind = 'boolean'] or ClassType[pmd-java:typeIs('java.lang.Boolean')])\n - Added test cases to ensure that methods returning are also flagged correctly.\n - Ensured the rule enforces consistent method naming for both primitive and wrapper types. 2024-10-11 22:34:07 +05:30
Aryant Tripathi 36f713b4c7 Merge branch 'pmd:main' into 5253/feature/support-boolean-wrapper-in-get-method-rule 2024-10-11 22:30:29 +05:30
Aryant Tripathi ed6312e3ba Support wrapper class in BooleanGetMethodName rule (#5253)\n \n - Updated XPath rule to include both primitive and wrapper class:\n (PrimitiveType[@Kind = 'boolean'] or ClassType[pmd-java:typeIs('java.lang.Boolean')])\n - Added test cases to ensure that methods returning are also flagged correctly.\n - Ensured the rule enforces consistent method naming for both primitive and wrapper types. 2024-10-11 22:29:42 +05:30
Andreas Dangel 8ac55e7ad7 Bump org.junit from 5.8.2 to 5.11.2 (#5274)
Also update junit-platform from 1.10.2 to 1.11.2

- Supersedes and closes #5260
- Supersedes and closes #5259
2024-10-11 16:42:42 +02:00
Andreas Dangel 6bd7a9db8e [java] Fix NPE with empty pattern list (#5264)
Merge pull request #5264 from oowekyala:issue5261-npe-record-empty-components
2024-10-11 12:36:26 +02:00
Andreas Dangel 7655cfc63b Add @gudzpoz as a contributor 2024-10-11 12:35:45 +02:00
Andreas Dangel fbde9b967f [doc] Update release notes (#5261, #5264) 2024-10-11 12:35:19 +02:00
Andreas Dangel 7ae3155325 Add @thesunlover as a contributor 2024-10-11 11:57:39 +02:00
Andreas Dangel c595fea83f [apex] AvoidNonRestrictiveQueries: Fix regex for detecting LIMIT clause
Fixes #5270
2024-10-11 11:57:10 +02:00
Aryant Tripathi 8b2af2db8a Support wrapper class in BooleanGetMethodName rule (#5253)
- Updated XPath rule to include both  primitive and  wrapper class:
                  (PrimitiveType[@Kind = 'boolean'] or ClassType[pmd-java:typeIs('java.lang.Boolean')])
                - Added test cases to ensure that methods returning  are also flagged correctly.
                - Ensured the rule enforces consistent method naming for both primitive and wrapper types.
2024-10-10 20:44:06 +05:30
Aryant Tripathi 54dfabea9b Support Boolean wrapper class for BooleanGetMethodName rule (#5253) 2024-10-09 10:00:02 +05:30
Andreas Dangel 07840cace2 [java] Rename rule SwitchStmtsShouldHaveDefault to NonExhaustiveSwitch
Fixes #4286
2024-10-08 17:33:32 +02:00
Andreas Dangel ff1b9b2cdd [java] SwitchStmtsShouldHaveDefault - test for multiple case constants 2024-10-08 17:15:18 +02:00
Clément Fournier b724b4dd33 Fix DataflowPassTest 2024-10-07 18:18:32 +02:00
Clément Fournier 2c1a7f026e Fix NPE with empty pattern list 2024-10-07 16:51:50 +02:00
Juan Martín Sotuyo Dodero f68130eaf9 Annotate Antlr generated classes for PMD languages 2024-10-06 20:07:47 -03:00
Juan Martín Sotuyo Dodero 31018611c6 Add missing lexer properties 2024-10-06 20:07:37 -03:00
Juan Martín Sotuyo Dodero e3cd599da2 Add @Generated annotations to cpd Antlr languages 2024-10-06 19:58:43 -03:00
Juan Martín Sotuyo Dodero ca71d76553 Include up-to-date-check to Antlr4 cpd
- Prevent unnecessary re-runs
2024-10-06 19:48:30 -03:00
Juan Martín Sotuyo Dodero 93a019765d Fix incorrect properties 2024-10-06 17:24:42 -03:00
Juan Martín Sotuyo Dodero 00bf6fe2f7 Fix @since for @Generated 2024-10-06 17:21:30 -03:00
Andreas Dangel 377670f267 [doc] Update release notes (#5257) 2024-10-06 18:48:47 +02:00
Andreas Dangel 5ecc29245b Fix externalInfoUrl after rename 2024-10-05 11:37:45 +02:00
Andreas Dangel 079eb238b9 [java] NonCaseLabelInSwitch - support switch expressions
Rename rule from NonCaseLabelInSwitchStatement

- as it applies to both switch statements and switch expressions
- extend the test cases to cover new java syntax
2024-10-05 11:19:53 +02:00
Andreas Dangel b3157825d8 [java] Rename rule DefaultLabelNotLastInSwitch
- as it applies to both switch statements and switch expressions
- extend the test cases to cover new java syntax

Note: For patterns in switch, the java compiler already makes sure, that
default is the last case.
2024-10-05 11:00:13 +02:00
Andreas Dangel 6f081e111a Update pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/performance/xml/TooFewBranchesForSwitch.xml 2024-10-05 10:41:10 +02:00
Andreas Dangel 59403fc9e1 [java] SwitchStmtsShouldHaveDefault - also ignore record pattern 2024-10-05 10:39:55 +02:00
Andreas Dangel 13cc79af62 [java] TooFewBranchesForSwitch - also ignore record pattern 2024-10-05 10:36:39 +02:00
Andreas Dangel 1f31f771ad [java] SwitchDensity - more tests with (record) patterns 2024-10-05 10:31:40 +02:00
Andreas Dangel d9db4dbcab [java] Rename TooFewBranchesForSwitch in quickstart.xml 2024-10-05 10:19:03 +02:00
Andreas Dangel 855e5175d4 [java] Renamed rule TooFewBranchesForSwitch
as it consider Switch Expressions now
additionally to Switch Statements.
2024-10-04 17:48:56 +02:00
Andreas Dangel b87944a565 [java] TooFewBranchesForSwitch should consider Switch Expressions
Fixes #5250
2024-10-04 17:48:49 +02:00
Andreas Dangel 90f436fd28 [java] TooFewBranchesForSwitch should ignore Pattern Matching
Fixes #5249
2024-10-04 17:47:21 +02:00
Andreas Dangel 375fb72f3c [java] Fix tree dump test
New SwitchLabel#PatternLabel flag
2024-10-04 17:32:46 +02:00
Andreas Dangel 49deb8d4a0 [java] SwitchDensity false positive with pattern matching
Fixes #5030
2024-10-04 17:12:29 +02:00
Andreas Dangel 312d8e46ae [java] ImplicitSwitchFallThrough should consider switch expressions
Fixes #3362
2024-10-04 16:45:29 +02:00
Andreas Dangel e5ff5532d4 Update @emouty as a contributor 2024-10-04 16:05:46 +02:00
Andreas Dangel 0c858b0a7b [java] SwitchStmtsShouldHaveDefault should ignore patterns
Fixes #4813
2024-10-04 16:05:45 +02:00
Andreas Dangel a0818d5ab2 [doc] Document renamed/old rule names 2024-10-04 15:54:21 +02:00
Andreas Dangel 5ce4d292fa [java] Fix #5067: CloseResource: False positive for FileSystems.getDefault() (#5225)
Merge pull request #5225 from lukasgraef:issue5067
2024-10-04 10:06:18 +02:00
Andreas Dangel d2c42d2426 [doc] Update release notes (#5067, #5225) 2024-10-04 10:05:48 +02:00
Andreas Dangel c6fd064054 Merge branch 'main' into pr-5225 2024-10-04 10:02:40 +02:00
Andreas Dangel 07cd250a74 Fix release_notes.md 2024-10-04 10:00:53 +02:00
Andreas Dangel c0023dd942 [java] Rename UnitTestShouldIncludeAssert again
to make it consistent and always use singular "UnitTest"
Follow-up on #4532 and #4965
2024-10-04 09:32:55 +02:00
Andreas Dangel 9fbaa4fbfb [java] Update quickstart.xml with renamed UnitTest* rules 2024-10-04 09:25:21 +02:00
Juan Martín Sotuyo Dodero 7d4961f303 Update README.md
Point coveralls to main branch
2024-10-03 17:47:01 -03:00
Andreas Dangel 9337e5a7a2 [java] UnitTestShouldUseAfterAnnotation: Consider JUnit 5 and TestNG 2024-10-03 20:55:11 +02:00
Andreas Dangel 33c737718c [java] UnitTestShouldUseBeforeAnnotation: Consider JUnit 5 and TestNG 2024-10-03 20:55:10 +02:00
Andreas Dangel b7c4a5e492 Ignore javacc code in coverage report (#5241)
Merge pull request #5241 from Monits:ignore-javacc-code
2024-10-03 20:30:41 +02:00
Andreas Dangel d77a63da95 [doc] Update release notes (#5241) 2024-10-03 20:29:53 +02:00
Andreas Dangel 463ca964dc [java] Rename JUnit rules with overly restrictive names (#4965)
Merge pull request #4965 from Monits:issue-4532
2024-10-03 20:07:50 +02:00
Andreas Dangel 57497738c1 [doc] Update release notes (#4532, #4965) 2024-10-03 20:06:21 +02:00
Andreas Dangel 525435bd68 [java] Keep bestpractices.xml sorted alphabetically 2024-10-03 19:59:29 +02:00
Andreas Dangel c5246eca46 Renamed JUnit4TestShouldUseAfterAnnotation
- call it UnitTest... to be agnostic to the testing framework
2024-10-03 19:52:56 +02:00
Andreas Dangel 4796da0fb2 Renamed JUnit4TestShouldUseBeforeAnnotation
- call it UnitTest... to be agnostic to the testing framework
2024-10-03 19:51:13 +02:00
lukasgraef 7dcab3f189 Fix static analysis findings 2024-09-30 20:48:20 +02:00
lukasgraef 39b8bdf171 Review Finding: Check for type java.nio.FileSystems 2024-09-30 20:13:01 +02:00
Andreas Dangel 5fe19b2096 [release] Prepare next development version [skip ci] 2024-09-27 11:43:22 +02:00
Andreas Dangel d8d4d3d061 [release] prepare release pmd_releases/7.6.0 2024-09-27 11:08:53 +02:00
Andreas Dangel 6d48907259 Prepare pmd release 7.6.0 2024-09-27 10:49:57 +02:00
Andreas Dangel 5261a6d60e [doc] Update contributors
- Add @kratoon as a contributor
- Add @mattr9124 as a contributor
2024-09-27 09:35:58 +02:00
Andreas Dangel ac8c873168 [apex] Support convertCurrency() in SOQL/SOSL (#5237)
Merge pull request #5237 from adangel:issue-5228-apex-convertCurrency
2024-09-27 09:03:32 +02:00
Andreas Dangel c2445c7bb5 [doc] Documentation update for --show-suppressed flag (#5230)
Merge pull request #5230 from dschach:master
2024-09-27 09:02:35 +02:00
David Schach 03fba2443a [doc] Update @dschach as a contributor 2024-09-27 08:58:36 +02:00
David Schach 6f518c8304 [doc] Improve doc for --show-suppressed
- it's only supported for specific formats
- currently: xml, html, summaryhtml

Fixes #5229
2024-09-27 08:58:36 +02:00
Andreas Dangel c84ffb8e0b [apex] Bump apex-parser from 4.2.0 to 4.3.0 2024-09-26 18:50:00 +02:00
Andreas Dangel 74f9d75897 [apex] Support convertCurrency() in SOQL/SOSL
Fixes #5228
2024-09-26 18:49:24 +02:00
Andreas Dangel a2b5ae64a7 Bump build-tools from 27-SNAPSHOT to 27 2024-09-26 17:01:00 +02:00
dependabot[bot] 242b45a180 Bump webrick from 1.8.1 to 1.8.2 in /docs (#5233)
Bumps [webrick](https://github.com/ruby/webrick) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/ruby/webrick/releases)
- [Commits](https://github.com/ruby/webrick/compare/v1.8.1...v1.8.2)

---
updated-dependencies:
- dependency-name: webrick
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-26 16:36:16 +02:00
dependabot[bot] 083e296c1e Bump com.google.protobuf:protobuf-java from 3.25.3 to 3.25.5 (#5232)
Bumps [com.google.protobuf:protobuf-java](https://github.com/protocolbuffers/protobuf) from 3.25.3 to 3.25.5.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/main/protobuf_release.bzl)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.25.3...v3.25.5)

---
updated-dependencies:
- dependency-name: com.google.protobuf:protobuf-java
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-26 16:36:02 +02:00
Andreas Dangel e4107ccaaa [doc] README: Fix PMD logo 2024-09-26 16:26:26 +02:00
Andreas Dangel 028444453d Change branch master to main (#5211)
Merge pull request #5211 from adangel:switch-to-main-branch
2024-09-26 15:54:55 +02:00
Andreas Dangel 29ed91795b [doc] README: Fix build status badge 2024-09-26 15:54:08 +02:00
Andreas Dangel 4930e98706 [java] Fix #5046 - FPs in LocalVariableCouldBeFinal (#5191)
Merge pull request #5191 from oowekyala:issue5046-localVariableCouldBeFinal-fp-catch
2024-09-26 15:21:51 +02:00
Andreas Dangel 7b5ef10093 [doc] Update release notes (#5046, #5191) 2024-09-26 15:20:28 +02:00
dependabot[bot] 1acaedc158 Bump com.google.code.gson:gson from 2.10.1 to 2.11.0 (#5227)
Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.10.1...gson-parent-2.11.0)

---
updated-dependencies:
- dependency-name: com.google.code.gson:gson
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-26 12:10:04 +02:00
dependabot[bot] b03a46fa8c Bump rouge from 4.3.0 to 4.4.0 in the all-gems group across 1 directory (#5226)
Bumps the all-gems group with 1 update in the / directory: [rouge](https://github.com/rouge-ruby/rouge).


Updates `rouge` from 4.3.0 to 4.4.0
- [Release notes](https://github.com/rouge-ruby/rouge/releases)
- [Changelog](https://github.com/rouge-ruby/rouge/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rouge-ruby/rouge/compare/v4.3.0...v4.4.0)

---
updated-dependencies:
- dependency-name: rouge
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all-gems
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-26 12:08:39 +02:00
Andreas Dangel ae080786bd [java] Fix #5068: Class incorrectly identified as non-instantiatable (#5224)
Merge pull request #5224 from lukasgraef:issue5068
2024-09-22 14:53:33 +02:00
Andreas Dangel 687f7f89e4 [doc] Update release notes (#5068, #5224) 2024-09-22 14:53:00 +02:00
Andreas Dangel cd50d392d1 Add @SaschaRiemer as a contributor 2024-09-22 14:51:26 +02:00
Andreas Dangel 2bdeadb094 Add @lukasgraef as a contributor 2024-09-22 14:51:07 +02:00
lukasgraef ddb1eb8dd8 [java] Fix #5067: CloseResource: False positive for FileSystems.getDefault() 2024-09-21 16:03:36 +02:00
lukasgraef 8ea3f32f5f [java] Fix #5068: Class incorrectly identified as non-instantiatable 2024-09-21 14:12:12 +02:00
Juan Martín Sotuyo Dodero 2c48dc0644 Merge pull request #5223 from adangel/issue-5222-overridden-property-values
[core] Fix RuleReference / RuleSetWriter handling of properties
2024-09-20 11:45:24 -03:00
Andreas Dangel df1a6797c6 [core] RuleSetWriter - write property value as attribute 2024-09-20 16:10:51 +02:00
Andreas Dangel 802decbbcf [core] Fix RuleReference / RuleSetWriter handling of properties
RuleReference#getOverriddenPropertyDescriptors should behave
consistent to #getOverriddenPropertiesByPropertyDescriptor.
RuleSetWriter needs to make sure to
export only the values for properties
of rule references.

Fixes #5222
2024-09-20 15:14:06 +02:00
Andreas Dangel 9490dc0043 Add @imax-erik as a contributor 2024-09-19 17:27:19 +02:00
Andreas Dangel 909e86ca99 [apex] Verify nested subqueries work (#5218)
Fixes #5218
2024-09-19 17:27:13 +02:00
Andreas Dangel 36c1738135 [core] Sarif format: refer to schemastore.org (#5202)
Merge pull request #5202 from dschach:master
2024-09-19 17:19:53 +02:00
Andreas Dangel d2d9ddff4a [doc] Update release notes (#5201, #5202) 2024-09-19 16:47:12 +02:00
Andreas Dangel ac2e476e4c [doc] Update Sarif Json Schema location 2024-09-19 16:47:12 +02:00
Andreas Dangel 6e65c2b3ab Update @dschach as a contributor 2024-09-19 16:47:12 +02:00
David Schach dd6e64a94d fix(sarif): refer to existent $schema location 2024-09-19 16:46:08 +02:00
Andreas Dangel dff06c9b4d Update release notes 2024-09-19 11:22:43 +02:00
Juan Martín Sotuyo Dodero cae71e7a5e Be consistent in how we replace tokens 2024-09-17 17:09:29 -03:00
Juan Martín Sotuyo Dodero 029130a478 Use a custom annotation to ignore javacc generated code 2024-09-17 17:00:42 -03:00
Juan Martín Sotuyo Dodero e18336a581 Merge pull request #5216 from pmd/dependabot/maven/com.github.siom79.japicmp-japicmp-maven-plugin-0.23.0
Bump com.github.siom79.japicmp:japicmp-maven-plugin from 0.20.0 to 0.23.0
2024-09-17 15:40:31 -03:00
dependabot[bot] 4ab926209e Bump com.github.siom79.japicmp:japicmp-maven-plugin
Bumps [com.github.siom79.japicmp:japicmp-maven-plugin](https://github.com/siom79/japicmp) from 0.20.0 to 0.23.0.
- [Release notes](https://github.com/siom79/japicmp/releases)
- [Changelog](https://github.com/siom79/japicmp/blob/master/release.py)
- [Commits](https://github.com/siom79/japicmp/compare/japicmp-base-0.20.0...japicmp-base-0.23.0)

---
updated-dependencies:
- dependency-name: com.github.siom79.japicmp:japicmp-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 03:56:04 +00:00
Juan Martín Sotuyo Dodero 5f42a45bbe Merge pull request #5212 from Monits/issue-5207
[java] Adjust signature matching in CheckSkipResultRule
2024-09-14 14:31:26 -03:00
Juan Martín Sotuyo Dodero 0253b9d3cd Ignore generated-sources in coverage reports
- We don't test it directly, nor is it our job
 - A bad grammar won't be processed, or fail in subtle ways only
   detectable in specific tests on the AST (which is included)
2024-09-14 01:33:20 -03:00
Juan Martín Sotuyo Dodero 8a9aec831d Update changelog, refs #5207 2024-09-14 00:35:38 -03:00
Juan Martín Sotuyo Dodero 59c88e9bb0 Adjust skip signature to fix #5207 2024-09-14 00:34:23 -03:00
Juan Martín Sotuyo Dodero 31efceae4d Add failing test case for #5207 2024-09-14 00:34:10 -03:00
Andreas Dangel 0889e3d9dc Fix release notes 2024-09-13 10:37:51 +02:00
Andreas Dangel 47f204cb19 Fix unit test 2024-09-13 10:37:37 +02:00
Andreas Dangel 91f17838d4 Change branch master to main
- Update documentation
- Update release scripts
- Update rule doc generation

GitHub Action is only triggered from "main" branch now.
2024-09-13 09:59:51 +02:00
Juan Martín Sotuyo Dodero 77b763e321 Merge pull request #5210 from adangel/issue-5059-core-xml-cdata
[core] Fix PMD's XMLRenderer to escape CDATA
2024-09-12 09:42:57 -03:00
Andreas Dangel 469b2a67ae [doc] Added Codety to "Tools / Integrations" (#5208)
Merge pull request #5208 from random1223:patch-1
2024-09-12 10:31:13 +02:00
Andreas Dangel b410199992 [doc] Update release notes (#5208) 2024-09-12 10:30:04 +02:00
Andreas Dangel 537148c90a [doc] Reformatting tools.md and ci.md 2024-09-12 10:29:51 +02:00
Andreas Dangel 341e089a47 Add @random1223 as a contributor 2024-09-12 10:19:14 +02:00
Andreas Dangel 6d1fb3e4cd [core] Fix PMD's XMLRenderer to escape CDATA
Processing errors might contain inside their details
message a CDATA section. This is output itself as
a CDATA section, but XMLStreamWriter#writeCData doesn't
escape it automatically - it just outputs the string
as is. This results in invalid XML.

Fixes #5059
2024-09-12 09:44:54 +02:00
Tony aae54f4b33 Added Codety into the tool list.
Added Codety into the tool list, Codety Scanner uses PMD as Java code analyzer. 
Demo: 
GitHub issue review example: https://github.com/codetyio/codety-scanner/actions/runs/10786005219/job/29912188828
GitHub Pull Request automation example: https://github.com/codetyio/codety-scanner/pull/15#issuecomment-2320351633
2024-09-11 21:38:45 -07:00
Juan Martín Sotuyo Dodero 48c2e325dc Remove NBSP 2024-09-11 19:01:33 -03:00
dependabot[bot] efa875727d Bump org.apache.maven.plugins:maven-deploy-plugin from 3.1.1 to 3.1.3 (#5199)
Bumps [org.apache.maven.plugins:maven-deploy-plugin](https://github.com/apache/maven-deploy-plugin) from 3.1.1 to 3.1.3.
- [Release notes](https://github.com/apache/maven-deploy-plugin/releases)
- [Commits](https://github.com/apache/maven-deploy-plugin/compare/maven-deploy-plugin-3.1.1...maven-deploy-plugin-3.1.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-deploy-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-09 20:39:54 +02:00
Andreas Dangel 04b3361dec [java] Fix #5190 - NPE in type inference caused by null type (#5192)
Merge pull request #5192 from oowekyala:issue5190-npe-infer
2024-09-09 20:38:36 +02:00
Andreas Dangel e6346ab6b9 Add @vedantchokshi as a contributor 2024-09-09 20:38:19 +02:00
Andreas Dangel 402eed5073 [doc] Update release notes (#5190, #5192) 2024-09-09 20:12:12 +02:00
Juan Martín Sotuyo Dodero 6fddf06b49 Merge pull request #5195 from adangel/apex/trigger-fixes-5138
[apex] Fix various FNs when using triggers
2024-09-06 18:08:48 -03:00
Andreas Dangel 2cfbac30b1 [doc] Update release notes (#5138) 2024-09-06 20:09:53 +02:00
Andreas Dangel 5f1b13cadd [apex] Verify StdCyclomaticComplexity with triggers 2024-09-06 19:51:52 +02:00
Andreas Dangel 1038eaa283 [apex] Verify EmptyIfStmt and EmptyStatementBlock with triggers 2024-09-06 19:43:07 +02:00
Andreas Dangel fe0d05d8d5 [apex] Fix parsing of method decl. inside triggers 2024-09-06 18:42:52 +02:00
Andreas Dangel 97fe106724 [apex] Verify OperationWithLimitsInLoop for triggers 2024-09-06 18:42:22 +02:00
Andreas Dangel 9810bfc3cc [apex] Verify CognitiveComplexity for triggers 2024-09-06 18:42:03 +02:00
Andreas Dangel 6b0a2a1ffa [apex] Fix ApexCRUDViolation for triggers 2024-09-06 18:41:25 +02:00
Andreas Dangel 92bab6a38f [apex] Fix AvoidDeeplyNestedIfStmts for triggers 2024-09-06 18:40:43 +02:00
Clément Fournier 9ecc8897be Fix #5190 - NPE caused by null type 2024-09-04 13:39:41 +02:00
Clément Fournier 68820a4c77 Fix #5046 - FPs in LocalVariableCouldBeFinal
This adds FNs to UnusedAssignment
2024-09-03 11:35:33 +02:00
Clément Fournier 9d925b513d Add test case for #5190 2024-09-03 11:16:56 +02:00
Juan Martín Sotuyo Dodero 7ba88e9eba Merge pull request #5188 from adangel/bump-apex-parser
[apex] Use new apex-parser 4.2.0
2024-09-02 15:41:51 -03:00
Andreas Dangel 07ae01b4ea [apex] Use new apex-parser 4.2.0
Verify that #5163 and #5182 are fixed.
2024-09-02 19:42:20 +02:00
Juan Martín Sotuyo Dodero c46fe6e6aa Merge pull request #5187 from pmd/dependabot/maven/org.apache.maven.plugins-maven-install-plugin-3.1.3
Bump org.apache.maven.plugins:maven-install-plugin from 3.1.1 to 3.1.3
2024-09-02 11:27:06 -03:00
dependabot[bot] eee22e0c17 Bump org.apache.maven.plugins:maven-install-plugin from 3.1.1 to 3.1.3
Bumps [org.apache.maven.plugins:maven-install-plugin](https://github.com/apache/maven-install-plugin) from 3.1.1 to 3.1.3.
- [Release notes](https://github.com/apache/maven-install-plugin/releases)
- [Commits](https://github.com/apache/maven-install-plugin/compare/maven-install-plugin-3.1.1...maven-install-plugin-3.1.3)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-install-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 03:08:01 +00:00
Juan Martín Sotuyo Dodero aa9a38de0e Merge pull request #5186 from oowekyala/implicit-class-cleanup
[java] Cleanup things about implicit classes
2024-09-01 17:49:57 -03:00
Clément Fournier fe341cf400 Cleanup things with implicit classes 2024-09-01 21:35:50 +02:00
Andreas Dangel 73d3c59205 Bump checkstyle from 10.14.0 to 10.18.1 (#5185)
Merge pull request #5185 from adangel/bump-checkstyle-10.18.1
2024-08-30 18:31:42 +02:00
Andreas Dangel 88596a2f5a Bump build-tools from 26 to 27-SNAPSHOT 2024-08-30 17:42:08 +02:00
Andreas Dangel 025356dadc Bump checkstyle from 10.14.0 to 10.18.1
Also bump maven-checkstyle-plugin from 3.4.0 to 3.5.0
2024-08-30 17:13:21 +02:00
Andreas Dangel 52c66e4dad Use PMD 7.5.0 for checks 2024-08-30 11:21:01 +02:00
Andreas Dangel 2ed25964b8 [release] Prepare next development version [skip ci] 2024-08-30 10:52:17 +02:00
Andreas Dangel 74ada426af [release] prepare release pmd_releases/7.5.0 2024-08-30 10:31:09 +02:00
Andreas Dangel 453f6690b0 Prepare pmd release 7.5.0 2024-08-30 10:10:53 +02:00
Andreas Dangel bff14449b2 [doc] Update pmd_sidebar.yml 2024-08-29 18:08:08 +02:00
Andreas Dangel 8b44d2f374 [javascript] New rule AvoidConsoleStatements (#5126)
Merge pull request #5126 from adangel:js-rule-avoidconsolestatements
2024-08-29 17:42:24 +02:00
Andreas Dangel 537dab95e4 [java] Support Java 23 (#5112)
Merge pull request #5112 from issue-5062-support-java-23
2024-08-29 17:39:04 +02:00
Andreas Dangel 819b6bc5fb [java] Fix #5084 - crash in LUB with raw types (#5179)
Merge pull request #5179 from oowekyala:issue5084-lub-crash
2024-08-29 17:32:49 +02:00
Andreas Dangel ada303de83 [doc] Document new java language prop xStrictTypeRes 2024-08-29 17:30:45 +02:00
Andreas Dangel a44a5ca4ef [doc] Update release notes (#5048) 2024-08-29 16:58:57 +02:00
Andreas Dangel c6ef54326c Add @AB-xdev as a contributor 2024-08-29 16:58:42 +02:00
Andreas Dangel 488807ff90 [java] Add testcase for #5048 2024-08-29 16:58:16 +02:00
Andreas Dangel 20b667d7e4 Merge branch 'master' into pr-5179 2024-08-29 16:55:38 +02:00
Andreas Dangel 773f792dd6 [java] Fix #5162 SingularField FP with synchronized block (#5178)
Merge pull request #5178 from oowekyala:issue5162-singularfield-synchronized
2024-08-29 13:05:50 +02:00
Andreas Dangel d7f564782a [doc] Update release notes (#5162, #5178) 2024-08-29 13:04:41 +02:00
Andreas Dangel 610f937bc4 [java] Update AvoidSynchronizedAtMethodLevel message to mention ReentrantLock, new rule AvoidSynchronizedStatement (#5175)
Merge pull request #5175 from chonton:ReentrantLock
2024-08-29 12:50:13 +02:00
Andreas Dangel 3c3be3c81d [doc] Update release notes (#5175) 2024-08-29 12:48:14 +02:00
Andreas Dangel a4cac6b74f Update @chonton as a contributor 2024-08-29 12:46:30 +02:00
Andreas Dangel 93db59bea5 Apply suggestions from code review 2024-08-29 12:41:02 +02:00
dependabot[bot] 8f74060ff1 Bump net.sf.saxon:Saxon-HE from 12.4 to 12.5 (#5180)
Bumps net.sf.saxon:Saxon-HE from 12.4 to 12.5.

---
updated-dependencies:
- dependency-name: net.sf.saxon:Saxon-HE
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-29 10:23:42 +02:00
Andreas Dangel 879240f97d [plsql] Improve merge statement (order of merge insert/update flexible, allow prefixes in column names) (#5125)
Merge pull request #5125 from duursma:merge-fix-3
2024-08-29 10:15:36 +02:00
Andreas Dangel d4779a135e [doc] Update release notes (#5125) 2024-08-29 10:14:53 +02:00
Andreas Dangel 60a29f08a5 Merge branch 'master' into pr-5125 2024-08-29 10:10:35 +02:00
Andreas Dangel 753dcca877 [doc] Update contributors
- Add @jbisotti as a contributor
- Add @soloturn as a contributor
- Add @schosin as a contributor
2024-08-29 09:58:16 +02:00
Andreas Dangel af1929318b [doc] Update release notes 2024-08-29 09:30:40 +02:00
Andreas Dangel 40688ae06d [java] Revamp GuardLogStatementRule to allow var, field and array accesses (#5169)
Merge pull request #5169 from Monits:issue-5151
2024-08-29 09:25:59 +02:00
Clément Fournier 672fd635c9 Improve error handling of semantic exceptions 2024-08-28 13:23:43 +02:00
Andreas Dangel 93bfe7df0f Merge branch 'master' into issue-5062-support-java-23 2024-08-27 20:09:09 +02:00
Andreas Dangel d7d8c9cb29 [java] Rename ASTImportDeclaration#isModuleImport 2024-08-27 19:58:07 +02:00
Andreas Dangel cd33eb621e Update gems
Fixes https://github.com/pmd/pmd/security/dependabot/64
Fixes CVE-2024-43380
Fixes https://github.com/advisories/GHSA-2m96-52r3-2f3g
Fixes https://github.com/pmd/pmd/security/dependabot/65
Fixes https://github.com/pmd/pmd/security/dependabot/66
Fixes CVE-2024-43398
Fixes https://github.com/advisories/GHSA-vmwr-mc7x-5vc3
2024-08-27 19:16:38 +02:00
Andreas Dangel 77bf2b1616 [doc] Update release notes (#5167) 2024-08-27 19:13:56 +02:00
Clément Fournier 9c0c7f28e2 Throw typeres failures instead of catching them
They will be surfaced as processing errors
2024-08-26 13:21:41 +02:00
Clément Fournier e597e21eda Update pmd-core/src/main/java/net/sourceforge/pmd/lang/ast/SemanticErrorReporter.java 2024-08-25 22:07:43 +02:00
Clément Fournier 60e0109bbb Update pmd-java/src/test/kotlin/net/sourceforge/pmd/lang/java/types/LubTest.kt 2024-08-25 19:48:40 +02:00
Clément Fournier d7a15d1854 Report typeres errors more transparently 2024-08-25 19:46:01 +02:00
Clément Fournier 08b68d7dd0 Fix #5084 - crash in LUB with raw types 2024-08-25 19:28:16 +02:00
Juan Martín Sotuyo Dodero 2f118d0d46 Update changelog, refs #4731 2024-08-24 23:46:33 -03:00
Juan Martín Sotuyo Dodero 91bb6f0b34 Improve docs further 2024-08-24 23:44:22 -03:00
Clément Fournier d6736903f0 Fix #5162 SingularField FP with synchronized block 2024-08-25 00:46:45 +02:00
Juan Martín Sotuyo Dodero 45618c0e13 Merge branch 'master' into issue-5151 2024-08-24 18:20:38 -03:00
Juan Martín Sotuyo Dodero 6f505b965c Merge branch 'pr-5177' 2024-08-24 18:19:03 -03:00
Juan Martín Sotuyo Dodero be47aab265 Update changelog, refs #5167 2024-08-24 18:18:38 -03:00
Clément Fournier da864aeccd Fix #5167 - issue with type projection 2024-08-24 16:48:37 +02:00
Juan Martín Sotuyo Dodero c9c0558e2b Suppress PMD warning
- "Simplifying" the return here would simply make it harder to read
2024-08-24 01:02:06 -03:00
Juan Martín Sotuyo Dodero 1c274fdda0 Update changelog, refs #3602 2024-08-24 00:51:15 -03:00
Juan Martín Sotuyo Dodero 980eaacd13 Unify compile-time constant detection
- Improving the constant folder allows other rules to work better
 - Fixes #3602
 - Curiously, InefficientStringBuffering has been broken since PMD 7.0.0
   (regression introduced in #3113)
2024-08-24 00:48:53 -03:00
Juan Martín Sotuyo Dodero 8ecc21c06f Merge branch 'master' into issue-5151 2024-08-24 00:14:55 -03:00
Juan Martín Sotuyo Dodero 96f60e9b0e Handle computed array access keys
- Tidy up the code, the fact the `getLogLevelName` was cheating and
   returning null when it considered a log to be safe was making the
   code harder to think about
2024-08-24 00:11:43 -03:00
Juan Martín Sotuyo Dodero dcee6e6900 Merge branch 'pr-5176' 2024-08-23 14:36:36 -03:00
Juan Martín Sotuyo Dodero 218222524f Update changelog, refs #5145 2024-08-23 14:36:12 -03:00
Clément Fournier 43112078a5 Fix issue #5145 - problem with inference of conditional exprs
Also finally fixes the bug that we swept under the rug in 24c1093b.
2024-08-23 18:23:43 +02:00
Charles Honton 8a39917fa2 added unit test 2024-08-22 13:54:17 -07:00
Charles Honton 3dd47a3b94 update AvoidSynchronizedAtMethodLevel message to mention ReentrantLock
see https://openjdk.org/jeps/8337395
2024-08-22 08:20:06 -07:00
Juan Martín Sotuyo Dodero 4033315c7d Properly handle all qualifiable expressions
- Up date the documentation to better show what is being flagged
2024-08-21 23:40:04 -03:00
Juan Martín Sotuyo Dodero 07f96e79ad Merge pull request #5171 from pmd/dependabot/maven/net.bytebuddy-byte-buddy-agent-1.14.19
Bump net.bytebuddy:byte-buddy-agent from 1.14.12 to 1.14.19
2024-08-19 01:47:04 -03:00
Juan Martín Sotuyo Dodero 90ebac893f Fix whitespace 2024-08-19 01:45:37 -03:00
dependabot[bot] 42468d769a Bump net.bytebuddy:byte-buddy-agent from 1.14.12 to 1.14.19
Bumps [net.bytebuddy:byte-buddy-agent](https://github.com/raphw/byte-buddy) from 1.14.12 to 1.14.19.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.14.12...byte-buddy-1.14.19)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy-agent
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 03:50:15 +00:00
Juan Martín Sotuyo Dodero 15b006a52f Update changelog, refs #5153 2024-08-18 19:41:56 -03:00
Juan Martín Sotuyo Dodero 9ef927067e Fix tests regarding array accesses 2024-08-18 19:41:06 -03:00
Juan Martín Sotuyo Dodero 4352b53aec Add tests regarding array accesses 2024-08-18 19:40:51 -03:00
Juan Martín Sotuyo Dodero 33e7e71bfa Update changelog, refs #5152 2024-08-18 19:30:34 -03:00
Juan Martín Sotuyo Dodero abcc20e655 Fix #5152 2024-08-18 19:29:48 -03:00
Juan Martín Sotuyo Dodero 176fae39d2 Add test for #5152 2024-08-18 19:29:39 -03:00
Juan Martín Sotuyo Dodero 0837be674e Update changelog, refs #5151 2024-08-18 19:24:46 -03:00
Juan Martín Sotuyo Dodero 792d91e062 Fix GuardLogStatementRule for field accesses 2024-08-18 19:23:25 -03:00
Juan Martín Sotuyo Dodero ca34c3edd3 Add minimal failing case for #5151 2024-08-18 19:22:09 -03:00
dependabot[bot] 2192256b5a Bump jekyll and github-pages (#5165)
Bumps the all-gems group with 1 update in the /docs directory: [jekyll](https://github.com/jekyll/jekyll).


Updates `jekyll` from 3.9.5 to 3.10.0
- [Release notes](https://github.com/jekyll/jekyll/releases)
- [Changelog](https://github.com/jekyll/jekyll/blob/master/History.markdown)
- [Commits](https://github.com/jekyll/jekyll/compare/v3.9.5...v3.10.0)

Updates `github-pages` from 231 to 232
- [Release notes](https://github.com/github/pages-gem/releases)
- [Commits](https://github.com/github/pages-gem/compare/v231...v232)

---
updated-dependencies:
- dependency-name: jekyll
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-gems
- dependency-name: github-pages
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: all-gems
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 12:54:41 +02:00
dependabot[bot] 623de394ec Bump org.apache.maven.plugins:maven-site-plugin from 4.0.0-M13 to 4.0.0-M16 (#5149)
Bumps [org.apache.maven.plugins:maven-site-plugin](https://github.com/apache/maven-site-plugin) from 4.0.0-M13 to 4.0.0-M16.
- [Commits](https://github.com/apache/maven-site-plugin/compare/maven-site-plugin-4.0.0-M13...maven-site-plugin-4.0.0-M16)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-site-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 12:53:15 +02:00
Andreas Dangel b51be09795 [core] Cache moduleName to URLs in ClasspathClassLoader 2024-08-13 11:46:31 +01:00
Andreas DangelandClément Fournier 13b8556bf6 Fixup from review (#5112)
Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2024-08-13 11:22:43 +01:00
Juan Martín Sotuyo Dodero aa64ec3894 Merge pull request #5164 from pmd/dependabot/maven/org.apache.maven.plugins-maven-dependency-plugin-3.7.1
Bump org.apache.maven.plugins:maven-dependency-plugin from 3.6.1 to 3.7.1
2024-08-12 10:28:54 -03:00
dependabot[bot] cc5fc196c5 Bump org.apache.maven.plugins:maven-dependency-plugin
Bumps [org.apache.maven.plugins:maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin) from 3.6.1 to 3.7.1.
- [Release notes](https://github.com/apache/maven-dependency-plugin/releases)
- [Commits](https://github.com/apache/maven-dependency-plugin/compare/maven-dependency-plugin-3.6.1...maven-dependency-plugin-3.7.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-dependency-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 03:37:24 +00:00
Juan Martín Sotuyo Dodero 3b105ca70b Merge pull request #5161 from pmd/dependabot/bundler/all-gems-d2126d6a76
Bump danger from 9.4.3 to 9.5.0 in the all-gems group across 1 directory
2024-08-05 06:21:42 -03:00
Juan Martín Sotuyo Dodero 913c44b3e4 Merge pull request #5160 from pmd/dependabot/maven/org.pcollections-pcollections-4.0.2
Bump org.pcollections:pcollections from 3.2.0 to 4.0.2
2024-08-05 06:20:41 -03:00
dependabot[bot] c5de5d67a0 Bump danger from 9.4.3 to 9.5.0 in the all-gems group across 1 directory
Bumps the all-gems group with 1 update in the / directory: [danger](https://github.com/danger/danger).


Updates `danger` from 9.4.3 to 9.5.0
- [Release notes](https://github.com/danger/danger/releases)
- [Changelog](https://github.com/danger/danger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/danger/danger/commits)

---
updated-dependencies:
- dependency-name: danger
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-gems
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 03:57:58 +00:00
dependabot[bot] 49cfe186ae Bump org.pcollections:pcollections from 3.2.0 to 4.0.2
Bumps [org.pcollections:pcollections](https://github.com/hrldcpr/pcollections) from 3.2.0 to 4.0.2.
- [Changelog](https://github.com/hrldcpr/pcollections/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hrldcpr/pcollections/compare/v3.2.0...v4.0.2)

---
updated-dependencies:
- dependency-name: org.pcollections:pcollections
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 03:18:42 +00:00
Andreas Dangel 21d499d5ef [doc] Release Notes for Java 23 Support (#5062)
Also add some @since tags to new API methods
2024-08-01 11:53:04 +02:00
Andreas Dangel 17a4a487a6 [java] CommentRequired - add test for markdown comments 2024-08-01 11:53:04 +02:00
Andreas Dangel c53462b3b6 Improve RuleTst performance
Reuse the classloader for auxclasspath
instead of creating a new one for every
single rule test case.
2024-08-01 11:46:45 +02:00
Andreas Dangel d171bcbdb3 [java] Default Imports for simple compilation unit
Import by default module java.base
and java.io.IO.*
2024-08-01 11:46:45 +02:00
Andreas Dangel cbc475ede3 [java] Add ImplicitClassDeclaration
JEP 477: Implicitly Declared Classes and Instance Main Methods
(Third Preview)
2024-08-01 11:46:41 +02:00
Andreas Dangel 55d57acc63 [java] Remove String Template Preview feature for Java 23 2024-08-01 11:44:46 +02:00
Andreas Dangel 0823c88cba [java] Support primitive types in instanceof (Java 23 Preview)
Allow to use primitive types in patterns, instanceof, and
switch. This is a Java 23 Preview feature.
See JEP 455.
2024-08-01 11:44:45 +02:00
Andreas Dangel 47470b5d0c [java] Support module import declarations (JEP 476)
- new JModuleSymbol
- UnnecessaryImportRule also supports module imports
- module-info.class can be loaded by ClasspathClassLoader
- Support annotations on modules
- Verify that exported packages are loaded
2024-08-01 11:44:37 +02:00
Andreas Dangel 176e522721 [java] UnnecessaryImportRule: Support Markdown comments 2024-08-01 10:28:31 +02:00
Andreas Dangel 7a6662fcda [java] Support "Markdown documentation comments" (JEP 467) 2024-08-01 10:28:31 +02:00
Andreas Dangel bb40b754a2 [java] Update impl for "Flexible Constructor Bodies" 2024-08-01 10:28:30 +02:00
Andreas Dangel 20750f9591 [java] Update implementation for "Implicitly Declared Classes...
... and Instance Main Methods" (JEP 477)

 - language feature is renamed
 - update symbol table resolver
2024-08-01 10:28:30 +02:00
Andreas Dangel a7eab294b4 [java] Make UNNAMED_VARIABLES_AND_PATTERNS a regular language feature
This is now possible, since java 21 preview is gone.
2024-08-01 10:28:30 +02:00
Andreas Dangel 10681cd6a8 [java] Remove version 21-preview 2024-08-01 10:28:29 +02:00
Andreas Dangel f13e886757 [java] Allow to build PMD with Java 23 2024-08-01 10:28:29 +02:00
Andreas Dangel 2a04d9858a [java] Bump asm from 9.6 to 9.7 2024-08-01 10:15:09 +02:00
Andreas Dangel 568314bb89 [java] Add new language version 23 and 23-preview 2024-08-01 10:15:09 +02:00
Juan Martín Sotuyo Dodero 10add3f0f7 Merge pull request #5148 from pmd/dependabot/maven/org.apache.commons-commons-text-1.12.0
Bump org.apache.commons:commons-text from 1.11.0 to 1.12.0
2024-07-29 09:08:18 -03:00
dependabot[bot] 65b6d5e796 Bump org.apache.commons:commons-text from 1.11.0 to 1.12.0
Bumps org.apache.commons:commons-text from 1.11.0 to 1.12.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-29 03:54:56 +00:00
Juan Martín Sotuyo Dodero 9ea10ecbe3 Merge pull request #5146 from adangel/issue-5139-apex-operationwithhighcostinloop
[apex] Fix parsing of triggers with declarations
2024-07-27 16:25:03 -03:00
Andreas Dangel 3735fd145b [apex] Fix parsing of triggers with declarations
Only the grandchildren of a trigger block were ending up in the tree,
but the direct children of triggerBlock were missing, e.g.
ForLoopStatement. This caused OperationWithHighCostInLoop to not
find the loop anymore in triggers.

This will probably fix other false negatives in triggers in
other rules as well.

Fixes #5139
2024-07-27 20:17:25 +02:00
dependabot[bot] d2fbe14afa Bump org.codehaus.mojo:versions-maven-plugin from 2.16.2 to 2.17.1 (#5144)
Bumps [org.codehaus.mojo:versions-maven-plugin](https://github.com/mojohaus/versions) from 2.16.2 to 2.17.1.
- [Release notes](https://github.com/mojohaus/versions/releases)
- [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md)
- [Commits](https://github.com/mojohaus/versions/compare/2.16.2...2.17.1)

---
updated-dependencies:
- dependency-name: org.codehaus.mojo:versions-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 18:06:14 +02:00
dependabot[bot] b7d9eaaa97 Bump org.apache.maven.plugins:maven-compiler-plugin from 3.12.1 to 3.13.0 (#5142)
Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.1 to 3.13.0.
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.1...maven-compiler-plugin-3.13.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 17:46:08 +02:00
dependabot[bot] dacc8b114b Bump org.apache.maven.plugins:maven-checkstyle-plugin from 3.3.1 to 3.4.0 (#5141)
Bumps [org.apache.maven.plugins:maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.3.1 to 3.4.0.
- [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.3.1...maven-checkstyle-plugin-3.4.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 17:36:58 +02:00
Juan Martín Sotuyo Dodero 98e20a0feb Merge pull request #5135 from adangel/issue-5132-plsql-tomkytesdespair
[plsql] Fix TomKytesDespair for more complex exception handlers
2024-07-26 08:11:15 -03:00
Juan Martín Sotuyo Dodero 590ae705c3 Merge pull request #5100 from adangel/enable-dependabot
Enable Dependabot
2024-07-26 08:10:15 -03:00
Juan Martín Sotuyo Dodero cb7f923c66 Merge pull request #5136 from adangel/deprecate-parser-impl
Deprecate generated parser implementations
2024-07-26 08:09:34 -03:00
Juan Martín Sotuyo DoderoandAndreas Dangel f7b5398a04 Update pmd-javascript/src/main/resources/category/ecmascript/performance.xml
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2024-07-26 08:08:12 -03:00
Andreas Dangel f1f376d248 Deprecate generated parser implementations 2024-07-26 12:02:31 +02:00
Andreas Dangel 44d25c41e1 [plsql] Fix TomKytesDespair for more complex exception handlers
Fixes #5132
2024-07-26 12:01:21 +02:00
Andreas Dangel dbe5624a9e [javascript] Simplify AvoidConsoleStatements
Now any usage of console is flagged.
2024-07-26 11:55:02 +02:00
Andreas Dangel 8b1da5d651 Add @dschach as a contributor 2024-07-26 11:53:27 +02:00
Andreas Dangel 838705c8da [javascript] New rule AvoidConsoleStatements
Fixes #5105
2024-07-26 11:51:44 +02:00
Andreas Dangel 210e3e59ae Enable dependabot
- dependabot runs weekly
- github-action and bundler are creating
  a single PR for updating
- also integrate automatic release notes
  generation
2024-07-26 11:48:20 +02:00
Andreas Dangel 39750cf158 Use PMD 7.4.0 for checks 2024-07-26 11:08:05 +02:00
Andreas Dangel ee800d326f [release] Prepare next development version [skip ci] 2024-07-26 10:11:46 +02:00
Andreas Dangel db5fa2dbce [release] prepare release pmd_releases/7.4.0 2024-07-26 09:03:38 +02:00
Andreas Dangel 5992a2d53f Prepare pmd release 7.4.0 2024-07-26 08:43:05 +02:00
Arjen Duursma aea5db9b50 Make parsing more flexible and avoid breaking API change build error. 2024-07-25 22:27:50 +02:00
Juan Martín Sotuyo Dodero 727279977d Merge pull request #5134 from adangel/issue-5133-plsql-parse-error
[plsql] Fix ScalarDataTypeName and CollectionTypeName parsing
2024-07-25 14:36:16 -03:00
Juan Martín Sotuyo Dodero 3ffb3ec210 Merge pull request #5137 from adangel/issue-5106-AccessorClassGeneration
[java] AccessorClassGeneration - handle default ctors
2024-07-25 12:49:27 -03:00
Andreas Dangel c194d3ed0d Add @rbri as a contributor 2024-07-25 13:06:14 +02:00
Andreas Dangel 41393d4637 [java] AccessorClassGeneration - handle default ctors
Fixes #5106
2024-07-25 13:05:47 +02:00
Andreas Dangel 6a242f019d [plsql] Fix CollectionTypeName parsing 2024-07-25 11:42:22 +02:00
Andreas Dangel 87b0c4f851 [plsql] Fix ScalarDataTypeName parsing
Fixes #5133
2024-07-25 11:17:49 +02:00
Andreas Dangel 5d39923c2f [core] Don't log warning about skipLexicalErrors twice (#5102)
Merge pull request #5102 from adangel:issue-5091-skipLexicalErrors
2024-07-25 10:28:22 +02:00
Andreas DangelandClément Fournier a3f9d4af59 [java] Simplify UnusedPrivateMethodRule
Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2024-07-25 09:57:20 +02:00
Andreas Dangel 1464cbca38 [java] Fix UnusedPrivateMethod for @lombok.Builder.ObtainVia (#5111)
Merge pull request #5111 from kdebski85:issue-5110-lombok-obtain-via
2024-07-23 20:11:23 +02:00
Andreas Dangel 597f3f37dc [doc] Update release notes (#5110, #5111) 2024-07-23 20:09:50 +02:00
Andreas Dangel e8bfc0d01c [java] UnusedPrivateMethodRule - fixups from PR review 2024-07-23 20:05:11 +02:00
Andreas Dangel 607684c6cb Update gems
Fixes https://github.com/pmd/pmd/security/dependabot/58
Fixes https://github.com/pmd/pmd/security/dependabot/59
Fixes CVE-2024-39908
Fixes https://github.com/advisories/GHSA-4xqq-m2hx-25v8
2024-07-23 19:36:53 +02:00
Krzysztof Debski 57e8954556 [java] Simplify processing of MethodSource annotation 2024-07-22 17:33:45 +02:00
Arjen Duursma f6ad0d4b9b Make order of merge insert/update flexible. Allow prfixes in merge insert column names. 2024-07-22 15:01:54 +02:00
Krzysztof Debski 121cdba3a4 [java] Make 'ASTAnnotation#flatValue' method static 2024-07-22 13:27:04 +02:00
Krzysztof Debski 9006dd1a89 [java] Generalize annotation handling in UnusedPrivateMethodRule 2024-07-22 13:22:24 +02:00
Juan Martín Sotuyo Dodero b8a5793c26 Merge pull request #5127 from adangel/issue-2367-js-rename-inaccuratenumericliteral
[javascript] Rename rule InaccurateNumericLiteral
2024-07-19 12:16:51 -03:00
Andreas Dangel bb08255aab [plsql] Fixed issue with missing optional table alias in MERGE usage (#5121)
Merge pull request #5121 from duursma:merge-fix
2024-07-19 16:23:36 +02:00
Andreas Dangel f689822d19 [doc] Update release notes (#5121)
Refs #5086
2024-07-19 16:22:30 +02:00
Andreas Dangel 5fce65dbe1 [javascript] Rename rule InaccurateNumericLiteral
Fixes #2367
2024-07-19 15:54:28 +02:00
Andreas Dangel 01755015b7 Merge remote-tracking branch 'origin/master' 2024-07-19 15:17:39 +02:00
Juan Martín Sotuyo Dodero edab792478 Merge pull request #5124 from adangel/issue-4716-js-inaccuratenumber
[javascript] Correctly determine double inaccuracy
2024-07-19 10:14:40 -03:00
Andreas Dangel ba6f55073c Bump maven-pmd-plugin from 3.23.0 to 3.24.0 2024-07-19 14:49:53 +02:00
Andreas Dangel 4d2034ef0f [java] FP for UnusedPrivateMethod with Jakarta @PostConstruct/PreDestroy annotations (#5118)
Merge pull request #5118 from kdebski85:issue-5117-unused-private-method-jakarta
2024-07-19 14:48:03 +02:00
Andreas Dangel f128bd7162 [doc] Update release notes (#5118, #5117) 2024-07-19 14:46:11 +02:00
Andreas Dangel 98710abade [java] Exclude constructor with lombok.Builder for MissingStaticMethodInNonInstantiatableClass (#5109)
Merge pull request #5109 from kdebski85:issue-5108-lombok-builder
2024-07-19 14:40:50 +02:00
Andreas Dangel 8462c75077 [doc] Update release notes (#5109, #1488) 2024-07-19 14:39:17 +02:00
Andreas Dangel abe6a5fe4b Add @tomasvts as a contributor 2024-07-19 14:05:39 +02:00
Andreas Dangel b176ca72c1 [javascript] Correctly determine double inaccuracy
Fixes #4716
2024-07-19 14:05:32 +02:00
Juan Martín Sotuyo Dodero 18c1ffc165 Merge pull request #5123 from adangel/bump-rhino-1.7.15
[javascript] Bump rhino from 1.7.14 to 1.7.15
2024-07-19 08:05:12 -03:00
Juan Martín Sotuyo Dodero f28a3e6922 Merge pull request #5122 from adangel/issue-5120-cli-designer
[cli] Fix pmd.bat for Windows when starting designer with JAVAFX_HOME
2024-07-19 08:00:51 -03:00
Andreas Dangel 533979d60e [javascript] Bump rhino from 1.7.14 to 1.7.15 2024-07-19 11:31:34 +02:00
Andreas Dangel 8c7a5d0664 [cli] Fix pmd.bat for Windows when starting designer with JAVAFX_HOME
Fixes #5120
2024-07-19 10:17:27 +02:00
Arjen Duursma 0d6bb74756 Redo fix for merge without alias in table specification 2024-07-18 18:53:25 +02:00
Andreas Dangel 14238ee93e [doc] Fix release notes 2024-07-18 16:00:48 +02:00
Andreas Dangel 404a2ea77f [doc] Fix release notes 2024-07-18 12:37:32 +02:00
Andreas Dangel d21d8a6286 Fix tests after merge 2024-07-18 12:17:05 +02:00
Andreas Dangel 669f883a99 [apex] Consider VariableDeclarationGroup in ApexTreeBuilder (#5099)
Merge pull request #5099 from adangel:apex-issue-5094
2024-07-18 12:10:21 +02:00
Andreas Dangel 6e8ce46f6c [apex] AvoidNonRestrictiveQueries: use new AnnotationParameter.hasName 2024-07-18 12:07:37 +02:00
Andreas Dangel 090bd1208b [apex] ApexUnitTestShouldNotUseSeeAllDataTrue: case-insensitive check (#5098)
Merge pull request #5098 from adangel:apex-issue-5095
2024-07-18 12:06:20 +02:00
Andreas Dangel cf4df4bf13 [apex] New Rule: AvoidNonRestrictiveQueries (#5089)
Merge pull request #5089 from adangel:apex-issue-635-avoid-non-restrictive-queries
2024-07-18 12:02:21 +02:00
Andreas Dangel ec92b39cf4 [apex] AvoidNonRestrictiveQueries fix FP with multiline queries 2024-07-18 11:47:31 +02:00
Andreas Dangel 2bfde98a53 [apex] Added Inner Classes to Apex Class Naming Conventions Rule (#5048)
Merge pull request #5048 from sgnl-labs:discreet-inner-class-name-check
2024-07-18 11:38:24 +02:00
Andreas Dangel 4ec05d0aa4 [doc] Update release notes (#5048, #4800) 2024-07-18 11:29:41 +02:00
Andreas Dangel 96b1e890e1 Add @justinstroudbah as a contributor 2024-07-18 11:26:06 +02:00
Andreas Dangel bd4d8970b6 Fix tests after merge 2024-07-18 10:43:46 +02:00
Andreas Dangel 83d6a264f1 Merge branch 'master' into pr-5048 2024-07-18 10:29:42 +02:00
Andreas Dangel f6cb537238 [apex] Add ASTUserClassOrInterface.isNested() 2024-07-18 10:14:43 +02:00
Andreas Dangel 909603d7e0 [apex] ClassNamingConventions - Improve tests for inner interfaces
Refs #5048
2024-07-18 10:04:03 +02:00
Andreas Dangel 7023ea3d27 Fix checkstyle 2024-07-18 10:03:13 +02:00
Krzysztof Debski cb1d1963a4 [java] Ignore unused private methods referenced by any field annotation attribute 2024-07-17 10:18:31 +02:00
Krzysztof Debski 9d0719201d [java] Do not report UnusedPrivateMethod for method annotated with @jakarta.annotation.PostConstruct/PreDestroy 2024-07-15 16:31:58 +02:00
sgnl-labsandAndreas Dangel f0a5930a40 Update pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/codestyle/ClassNamingConventionsRule.java
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2024-07-13 05:37:01 -07:00
sgnl-labsandAndreas Dangel 5f669fca31 Update pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/codestyle/xml/ClassNamingConventions.xml
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2024-07-13 05:36:44 -07:00
sgnl-labsandAndreas Dangel 1be5242c8c Update pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/codestyle/xml/ClassNamingConventions.xml
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2024-07-13 05:36:35 -07:00
sgnl-labsandAndreas Dangel 2da3ac2cc8 Update pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/codestyle/ClassNamingConventionsRule.java
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2024-07-13 05:36:28 -07:00
Andreas Dangel fb6638c40d [doc] Update release notes (#635)
Fixes #635
2024-07-12 09:44:25 +02:00
Andreas Dangel 3ba3eb4245 [apex] AvoidNonRestrictiveQueriesRule - support SOSL 2024-07-12 09:44:11 +02:00
Andreas Dangel ccb0e2e228 [apex] AvoidNonRestrictiveQueriesRule - reuse SEE_ALL_DATA
This is already defined in ASTAnnotationParameter
2024-07-12 09:36:45 +02:00
Andreas Dangel 4044abca91 [apex] AvoidNonRestrictiveQueries: Support @isTest 2024-07-12 09:36:45 +02:00
Andreas Dangel 99f8bf826b [apex] AvoidNonRestrictiveQueries: ignore sub-queries 2024-07-12 09:36:45 +02:00
Andreas Dangel 41ca259503 [apex] AvoidNonRestrictiveQueries - handle sub-queries separately 2024-07-12 09:36:44 +02:00
Andreas DangelandJan Aertgeerts abdb57535a [apex] New Rule: AvoidNonRestrictiveQueries
Fixes #635
Refs old PR #663

Co-authored-by: Jan Aertgeerts <2192516+JAertgeerts@users.noreply.github.com>
2024-07-12 09:36:44 +02:00
Krzysztof Debski 45d68cf455 [java] Imports order fix 2024-07-11 17:33:39 +02:00
Krzysztof Debski 3609034bf7 [java] Do not report MissingStaticMethodInNonInstantiatableClass for class with @lombok.Builder 2024-07-11 17:24:38 +02:00
Krzysztof Debski c053f00fb5 [java] Do not report UnusedPrivateMethod for method referenced by @lombok.Builder.ObtainVia 2024-07-11 17:00:01 +02:00
Krzysztof Debski 3a66d50ac2 [java] Do not report MissingStaticMethodInNonInstantiatableClass for private constructor with @lombok.Builder 2024-07-11 15:30:01 +02:00
Andreas Dangel f62d038a8d [doc] Update maven.md - Typo fixed for maven target (#5107)
Merge pull request #5107 from karthikaiyasamy:patch-1
2024-07-11 11:05:15 +02:00
Andreas Dangel f574b0d6fe [doc] Update release notes (#5107) 2024-07-11 11:03:25 +02:00
Andreas Dangel a3bcb47068 Add @karthikaiyasamy as a contributor 2024-07-11 11:03:15 +02:00
Andreas Dangel adfb9568b7 [plsql] Add support for 'DEFAULT' clause on the arguments of some oracle functions (#5088)
Merge pull request #5088 from duursma:DEFAULT_ARGUMENT
2024-07-11 10:33:18 +02:00
Andreas Dangel 8feb1ef80d [doc] Update release notes (#5088) 2024-07-11 10:32:42 +02:00
Andreas Dangel d59de6c550 [plsql] DEFAULT for Argument - fixups from #5088 2024-07-11 10:32:29 +02:00
Andreas Dangel d3daf5e90e Merge branch 'master' into pr-5088 2024-07-11 10:22:26 +02:00
Andreas Dangel c059ca34f3 [plsql] Add support for SQL_MACRO (#5087)
Merge pull request #5087 from duursma:SQL_MACRO
2024-07-11 10:20:24 +02:00
Andreas Dangel a2a10b4403 [doc] Update release notes (#5087) 2024-07-11 10:16:47 +02:00
Andreas Dangel 7b172acc7c [plsql] SQL_MACRO - fixups from #5087 2024-07-11 10:15:58 +02:00
Andreas Dangel 3579f3f079 Merge branch 'master' into pr-5087 2024-07-11 09:49:04 +02:00
Andreas Dangel cbcb5a1cb6 [plsql] Fixed issue with missing optional table alias in MERGE usage (#5086)
Merge pull request #5086 from duursma:master
2024-07-11 09:17:33 +02:00
Andreas Dangel dcb56dc04f [doc] Update release notes (#5086) 2024-07-11 09:16:46 +02:00
Andreas Dangel b5127b3c7b Add @duursma as a contributor 2024-07-11 09:16:19 +02:00
Andreas Dangel 8208e20844 Merge branch 'master' into pr-5086 2024-07-11 09:13:34 +02:00
karthikaiyasamy dab088ba68 Update maven.md - Typo fixed for maven target
It should be "mvn compile" not "mvn complile".
2024-07-10 09:16:31 -07:00
Andreas Dangel 9bf476ac4f [core] Don't log warning about skipLexicalErrors twice
Fixes #5091
2024-07-05 12:07:28 +02:00
Andreas Dangel fc128c18dd [java] Fix example of JUnitStaticSuite
A method can be declared only once, so
split the example into two examples.
2024-07-05 09:16:42 +02:00
Andreas Dangel 6714c8bef2 Add @ethan-sargent as a contributor 2024-07-04 12:36:27 +02:00
Andreas Dangel dfdb63ba5b [apex] Consider VariableDeclarationGroup in ApexTreeBuilder
- Throw parse exception, when a node is not handled
- Use ApexTreeDumpTest for SwitchStatements.cls

Fixes #5094
2024-07-04 12:36:05 +02:00
Andreas Dangel 68300298ef Add @gearsethenry as a contributor 2024-07-04 12:13:13 +02:00
Andreas Dangel d0928cc185 [apex] ApexUnitTestShouldNotUseSeeAllDataTrue: case-insensitive check
The annotation parameter name "seeAllData" is now compared
case-insensitive.

Fixes #5095
2024-07-04 11:48:11 +02:00
Justin Stroud a395bd78c8 Small fix, removed duplicate unit test (accodentally created by me.) 2024-06-28 17:51:11 -07:00
Justin Stroud 33dde29264 Per @adangel, added a couple of unit tests that validate inner class naming logic. Uncovered some bugs, fixed those bugs. 2024-06-28 17:47:49 -07:00
Andreas Dangel e6397d5d5c Bump maven from 3.9.6 to 3.9.8 2024-06-28 12:58:29 +02:00
Andreas Dangel 0d18146f05 [ci] Improve release and build scripts
- clarification for instructions
- twitter -> x
- try to avoid build failures due to missing
  dependencies
2024-06-28 12:57:07 +02:00
Andreas Dangel e8c16bb683 Bump pmd from 7.1.0 to 7.3.0 2024-06-28 12:09:02 +02:00
Andreas Dangel 88483cd989 Bump maven-pmd-plugin from 3.22.0 to 3.23.0 2024-06-28 12:08:45 +02:00
Andreas Dangel d952a10790 [release] Prepare next development version [skip ci] 2024-06-28 11:27:41 +02:00
Andreas Dangel c5dbc29bea [release] prepare release pmd_releases/7.3.0 2024-06-28 11:00:04 +02:00
Andreas Dangel 2d07aa7561 Prepare pmd release 7.3.0 2024-06-28 10:42:31 +02:00
Andreas Dangel 93e3020a1d [doc] Update all-contributors
- Add @stephen-carter-at-sf as a contributor
- Add @Meijuh as a contributor
- Add @codefriar as a contributor
- Add @szymanp23 as a contributor
- Add @johnzhao9 as a contributor
2024-06-28 10:35:57 +02:00
Andreas Dangel 52b2b52c5c [plsql,tsql] Fix CPD being case sensitive in PLSQL and TSQL (#4943)
Merge pull request #4943 from oowekyala:issue4396-cpd-case-sensitive
2024-06-28 08:30:14 +02:00
Andreas Dangel 3222807dec [core] Fix memory usage regression in CPD (#5090)
Merge pull request #5090 from Monits:issue-5066
2024-06-28 08:28:08 +02:00
Andreas Dangel a9d43d0ad0 [doc] Update release notes (#5090, #5066) 2024-06-28 08:27:34 +02:00
Juan Martín Sotuyo Dodero 10bfa395e5 Explicitely use no-arg constructor
- Inadvertly I was using the constructor that received an int as
   initial capacity, which instantiated massive collections leading to
   an increase in memory usage.
2024-06-27 20:29:15 -03:00
Andreas Dangel 12b9ecefb1 [doc] Update release notes (#4396) 2024-06-27 21:18:04 +02:00
Andreas Dangel 70296aeef6 [plsql] Fix unit tests after KEYWORD_UNRESERVED is removed 2024-06-27 21:17:11 +02:00
Andreas Dangel 9b20ec524a [core] Remove AntlrLexerBehavior 2024-06-27 21:16:07 +02:00
Andreas Dangel f90093c923 Merge branch 'master' into pr-4943 2024-06-27 20:38:19 +02:00
Arjen Duursma c4ef2d9d44 Added missing newline at end of file 2024-06-27 15:37:35 +02:00
Arjen Duursma 45b75c5ca0 Add support for DEFAULT_ARGUMENT as extension to arguments (eg. TO_NUMBER) 2024-06-27 15:28:38 +02:00
Andreas Dangel 06ba547811 [java] Make impl of ASTLiteral#getLiteralText() public (#5078)
Merge pull request #5078 from adangel:issue-4885-method-should-be-accessible
2024-06-27 14:49:13 +02:00
Andreas Dangel 09aa71aed5 Remove pmd-compat6 (breaking change) (#5076)
Merge pull request #5076 from adangel:remove-compat6
2024-06-27 14:45:44 +02:00
Andreas Dangel e93ca46b5a [cli] Add exit code for processing errors (#4991)
Merge pull request #4991 from adangel:cli-exit-codes-processing-errors
2024-06-27 14:41:51 +02:00
Arjen Duursma 68584ebf0a Removed unplanned empty line 2024-06-27 14:27:03 +02:00
Arjen Duursma 7955d635f3 Revert non relevant chagne 2024-06-27 14:25:18 +02:00
Arjen Duursma 44ecb87c43 Add support for SQL_MACRO 2024-06-27 14:18:30 +02:00
Andreas Dangel 261d4d198c [plsql] Support exception handlers in compound triggers (#5065)
Merge pull request #5065 from adangel:plsql-4270-trigger-declarations
2024-06-27 14:08:39 +02:00
Andreas Dangel fbc5ddb103 [java] Add new rule UseEnumCollections (#5038)
Merge pull request #5038 from oowekyala:issue577-new-rule-use-enum-collections
2024-06-27 14:07:31 +02:00
Andreas Dangel 775baa0b74 [java] Implement record patterns and fix switch pattern scoping (#5051)
Merge pull request #5051 from oowekyala:java-implement-switch-bindings-and-record-pats
2024-06-27 14:06:31 +02:00
Arjen Duursma f994ae0e6f Fixed issue with missing optional table alias in MERGE usage 2024-06-27 13:33:00 +02:00
Andreas Dangel cd41d70546 [apex] UnusedLocalVariable - support concat strings for binding vars (#5037)
Merge pull request #5037 from adangel:issue-5000-apex-unused-local-variable
2024-06-27 11:51:57 +02:00
Andreas Dangel 6517dff840 [apex] Mention apex-parser issue
refs apex-dev-tools/apex-parser#44
2024-06-27 11:48:26 +02:00
Andreas Dangel 1680e94eea [apex] Update summit-ast and apex-parser (#4977)
Merge pull request #4977 from adangel:apex-4922-typeof
2024-06-27 11:45:23 +02:00
Andreas Dangel bc0b2c9763 Merge branch 'master' into pr-5038 2024-06-27 11:41:13 +02:00
Andreas Dangel bf8e11d9b4 [doc] Update release notes (#577, #5038) 2024-06-27 11:40:18 +02:00
Andreas Dangel f37d432b9e Revert "support TreeSet/Map"
This reverts commit 209fc13462.
2024-06-27 11:29:00 +02:00
Andreas Dangel c2a7c46ccd Merge branch 'master' into pr-5051 2024-06-27 11:00:56 +02:00
Andreas Dangel 69d2d7de28 [java] Rebuild SomeRecordsTestData.java 2024-06-27 10:55:55 +02:00
Andreas Dangel 31b4e3745a [doc] Update release notes (#5050, #5051) 2024-06-27 10:49:20 +02:00
Andreas Dangel f5ab687c6a [java] Use Objects.equals consistently in SymbolEquality 2024-06-27 10:40:49 +02:00
Andreas Dangel 55385a0255 Bump build-tools from 26-SNAPSHOT to 26 2024-06-27 09:11:36 +02:00
Andreas Dangel b5f6d4e68a [core] Update report schema location to https://pmd.github.io/schema/report_2_0_0.xsd 2024-06-27 09:11:26 +02:00
Andreas Dangel 0691b5a7ba Bump summit-ast to 2.3.0 2024-06-24 21:22:11 +02:00
Andreas Dangel 9430a27961 Merge branch 'master' into apex-4922-typeof 2024-06-24 21:18:46 +02:00
Juan Martín Sotuyo Dodero 648e2ebd6a Merge pull request #4992 from adangel/cpd-report-processing-errors
[core] CPD: Include processing errors in XML report
2024-06-24 10:47:30 -03:00
Andreas Dangel 40bd882f3e Fix cpd xslt sample templates 2024-06-23 21:03:12 +02:00
Andreas Dangel 33f9268cf7 [core] Provide a backwards compatible XMLOldRenderer as "xmlold" 2024-06-23 20:42:45 +02:00
Andreas Dangel 0340bf0568 [cli] Fix unit test after cpd report change 2024-06-23 19:45:38 +02:00
Andreas Dangel a8ab215010 Clarify namespace, version, pmdVersion 2024-06-23 19:21:49 +02:00
Andreas DangelandJuan Martin Sotuyo Dodero 29983a91a2 Fix schema types
Co-authored-by: Juan Martin Sotuyo Dodero <juansotuyo@gmail.com>
2024-06-23 19:00:01 +02:00
Andreas Dangel aed90ff62e [core] CPD: Add schema for cpd xml report 2024-06-21 20:57:56 +02:00
Andreas Dangel d76a38805b [doc] Update to 7.3.0 2024-06-21 19:36:15 +02:00
Andreas Dangel 727fb1597d Merge branch 'master' into cpd-report-processing-errors 2024-06-21 19:30:35 +02:00
Andreas Dangel d285082709 Updated doc to mention 7.3.0 2024-06-21 19:23:55 +02:00
Andreas Dangel 724b3afe95 Merge branch 'master' into cli-exit-codes-processing-errors 2024-06-21 19:14:17 +02:00
Andreas Dangel c2dc7b3d9b Bump build-tools from 25 to 26-SNAPSHOT
Refs #5077
2024-06-20 16:05:29 +02:00
Andreas Dangel 18c30415d0 [java] Make impl of ASTLiteral#getLiteralText() public
Fixes #4885
2024-06-20 15:26:21 +02:00
Juan Martín Sotuyo Dodero 923873fec8 Merge pull request #5075 from adangel/doc-release-schedule-support
[doc] Release schedule, version policies, support lifecycle
2024-06-20 10:11:23 -03:00
Andreas Dangel 5014bee7ba [doc] Update gradle docs 2024-06-20 15:02:27 +02:00
Andreas Dangel 563ad76fe9 Remove pmd-compat6
It's already deprecated. It was intended to be used with
older versions of the maven-pmd-plugin, but since
maven-pmd-plugin 3.22.0, PMD 7 is supported directly and this
module is not needed anymore.
2024-06-20 14:36:22 +02:00
Andreas Dangel dafa113fbc [doc] Release schedule, version policies, support lifecycle 2024-06-20 12:10:42 +02:00
Andreas Dangel 0dd8fc791b [java] Fix #5047 - type inference with enum #5052
Merge pull request #5052 from oowekyala:issue5047-inference-with-enum
2024-06-13 11:25:46 +02:00
Andreas Dangel 3c6190ecab [doc] Update release notes (#5047) 2024-06-13 11:24:40 +02:00
Andreas Dangel 51bfb96414 Add @anuragagarwal561994 as a contributor 2024-06-13 11:24:23 +02:00
Andreas Dangel 3c34431cb8 [plsql] Allow error logging for multi-inserts
Refs #2779
2024-06-13 10:36:53 +02:00
Andreas Dangel e0d465a81b [plsql] Fix tests, restore exception handler, implicit cursor attribute 2024-06-13 09:50:44 +02:00
Andreas Dangel 7a57aeb4db [plsql] Support exception handlers in compound triggers
- allow multiple exception handlers
- parse declarative section correctly in
  compound triggers
- CASE, CURSOR, DECLARE, EXECUTE, IF, PUBLIC, SQL are reserved words
  and cannot be used as an identifiers

Fixes #4270
2024-06-13 09:29:22 +02:00
Juan Martín Sotuyo Dodero b3851fe26e Merge pull request #5045 from adangel/update-kotest-5.9.0
Update kotest and kotlin
2024-06-10 06:40:29 -03:00
Juan Martín Sotuyo Dodero 41acdc8d25 Merge pull request #5057 from adangel/plsql-1934-merge-into
[plsql] Support MERGE statement
2024-06-10 06:39:46 -03:00
Juan Martín Sotuyo Dodero 0afe6aec78 Merge branch 'master' into plsql-1934-merge-into 2024-06-07 23:12:57 -03:00
Juan Martín Sotuyo Dodero 2ea472ac38 Merge pull request #5058 from adangel/plsql-2779-error-logging
[plsql] Support Error Logging in INSERT, UPDATE, DELETE
2024-06-07 17:19:27 -03:00
Juan Martín Sotuyo Dodero 40e9350649 Merge branch 'master' into plsql-1934-merge-into 2024-06-07 16:09:19 -03:00
Juan Martín Sotuyo Dodero 0d83a85857 Merge branch 'master' into plsql-2779-error-logging 2024-06-07 16:08:56 -03:00
Juan Martín Sotuyo Dodero c27ea64476 Merge pull request #5056 from adangel/apex-issue-5053-lexer
[apex] Use case-insensitive lexer for CPD
2024-06-07 16:08:13 -03:00
Andreas Dangel 9d803282d9 [apex] Use case-insensitive lexer for CPD
This makes it consistent with how the ApexParser
reads the files. And the case-sensitive ANTLR
rules (e.g. for string literals) work that
way.

Fixes #5053
2024-06-07 19:24:26 +02:00
Andreas Dangel d47ca10029 [plsql] Support Error Logging in INSERT, UPDATE, DELETE
Fixes #2779
2024-06-07 12:16:43 +02:00
Andreas Dangel 72bf5d07b4 [plsql] Support MERGE statement
Fixes #1934
2024-06-07 11:20:50 +02:00
Andreas Dangel a0e7bd7390 Bump kotest from 5.9.0 to 5.9.1
https://github.com/kotest/kotest/releases/tag/v5.9.1
2024-06-06 16:35:29 +02:00
Andreas Dangel 57c26dd49b Update kotest and kotlin
- Bumps kotest from 5.5.5 to 5.9.0
- Bumps kotlin from 1.7.20 to 1.9.24
- Bumps dokka from 1.7.20 to 1.9.20
2024-06-06 16:31:11 +02:00
Andreas Dangel 6595be09ac [doc] Update release notes (#4922, #5055) 2024-06-06 16:28:45 +02:00
Andreas Dangel 581b6db3d2 [apex] Use new io.github.apex-dev-tools:apex-ls for apexlink 2024-06-06 15:49:26 +02:00
Andreas Dangel 4f1be343e3 [apex] SoslExpression - expose query 2024-06-06 15:49:25 +02:00
Andreas Dangel 8b96c0fe7e [apex] Update summit-ast and apex-parser
Fixes #4922
2024-06-06 15:49:20 +02:00
Clément Fournier 2ccb39aaba Add tests for record reflection, change API
Record components can be annotated separately
from their corresponding field/method, so I add
a new type for that
2024-06-05 16:58:39 +02:00
Clément Fournier 48512a43f6 Fix #5047 - type inference with enum 2024-06-05 12:41:05 +02:00
Clément Fournier 9bd6540055 Lint 2024-06-05 12:21:33 +02:00
Clément Fournier 16346bbd63 Support properly generic records
TODO test
2024-06-05 12:17:12 +02:00
Clément Fournier 209fc13462 support TreeSet/Map 2024-06-05 11:17:57 +02:00
Clément Fournier 5170a81f79 Merge branch 'master' into issue577-new-rule-use-enum-collections 2024-06-05 11:12:55 +02:00
Clément Fournier 50562185d1 Implement record patterns and fix switch pattern scoping 2024-06-03 16:24:41 +02:00
Justin M. Stroud 0f4a59c07d Added inner interfaces. 2024-06-03 03:17:13 -07:00
Justin M. Stroud af38000d8a Moved inner class check to top. 2024-06-03 03:11:52 -07:00
Justin M. Stroud 9844cfae22 Moved inner class check to top. 2024-06-03 03:10:07 -07:00
Justin M. Stroud ac5d1135aa Added inner classes to ClassNamingConventionsRule, and added property to support name checking for inner classes. 2024-06-03 02:54:18 -07:00
Andreas Dangel 28c6c8e121 [release] Prepare next development version [skip ci] 2024-05-31 13:21:14 +02:00
Andreas Dangel 38bc997d4e [release] prepare release pmd_releases/7.2.0 2024-05-31 12:57:36 +02:00
Andreas Dangel 27a14cc61e Prepare pmd release 7.2.0 2024-05-31 12:33:41 +02:00
Andreas Dangel e27b30e0b5 Bump pmd-designer from 7.2.0-SNAPSHOT to 7.2.0 2024-05-31 11:21:36 +02:00
Andreas Dangel d37769e71c Bump builds-tools from 25-SNAPSHOT to 25 2024-05-31 10:40:36 +02:00
Andreas Dangel 2a0cba7b91 [java] Improve LocalVariableCouldBeFinal (#5003)
Merge pull request #5003 from oowekyala:issue1619-localVariableCouldBeFinal-FP
2024-05-31 10:39:37 +02:00
Andreas Dangel 8a8402a0bd [doc] Update release notes (#1619, #3122, #5003) 2024-05-31 10:37:05 +02:00
Andreas Dangel 3890b561a1 [java] Remove FPs in UnnecessaryBoxing (#5019)
Merge pull request #5019 from oowekyala:issue4903-unnecessaryboxing
2024-05-31 10:06:36 +02:00
Andreas Dangel 224f5b8303 [doc] Update release notes (#4903, #4924, #5019) 2024-05-31 09:59:35 +02:00
Andreas Dangel 910c0985ca [core] Fix Kotest based tests (#5022)
Merge pull request #5022 from adangel:kotest-fixes
2024-05-31 09:57:29 +02:00
Andreas Dangel 37451931dc [test] Add missing junit jupiter engine 2024-05-31 09:48:56 +02:00
Andreas Dangel a05faf9837 Merge branch 'master' into kotest-fixes 2024-05-31 09:48:46 +02:00
Clément Fournier 4ea0c07162 Fix pmd warning 2024-05-23 21:17:17 +02:00
Clément Fournier edb733f835 Add test for UnnecessaryCast 2024-05-23 21:10:58 +02:00
Clément Fournier 1bde246b8b Fix some FNs 2024-05-23 21:07:27 +02:00
Clément Fournier f1fc7aacbe Merge branch 'master' into issue4903-unnecessaryboxing 2024-05-23 20:15:47 +02:00
Clément Fournier 05e7724185 [java] Add new rule UseEnumCollections 2024-05-23 19:32:16 +02:00
Andreas Dangel f30b535f61 Update pmd-designer 7.2.0-SNAPSHOT 2024-05-23 18:20:08 +02:00
Andreas Dangel 3f5dc971e0 Add @pablogomez2197 as a contributor 2024-05-23 16:18:40 +02:00
Andreas Dangel 4d07d80c93 [apex] UnusedLocalVariable - support concat strings for binding vars
Fixes #5000
2024-05-23 16:13:45 +02:00
Juan Martín Sotuyo Dodero b284ca6ec8 Merge branch 'pr-5035' 2024-05-23 09:47:04 -03:00
Juan Martín Sotuyo Dodero b2f6c9a85a Update changelog, refs #5029 2024-05-23 09:46:43 -03:00
Andreas Dangel d7025a65dc [doc] Update all-contributors
- Add @bobalicious as a contributor
- Update @mluckam as a contributor
- Add @mdagcilar as a contributor
- Add @kesslerj as a contributor
- Add @Gold856 as a contributor
2024-05-23 11:32:46 +02:00
Andreas Dangel a4edb67054 [java] Make naming conventions rule skip unnamed variables (#5004)
Merge pull requets #5004 from oowekyala:issue4954-local-var-unnamed
2024-05-23 11:26:55 +02:00
Andreas Dangel a936852ba2 Add @cowwoc as a contributor 2024-05-23 11:25:32 +02:00
Andreas Dangel f36e25dd04 Merge branch 'master' into pr-5004 2024-05-23 11:19:09 +02:00
Andreas Dangel fe8920a4fc [doc] Update release notes (#4954, #5028, #5004) 2024-05-23 10:25:06 +02:00
Andreas Dangel a54dc1ea89 [java] Add Java8TreeDumpTest for UnnamedVariable
Refs #5004
2024-05-23 10:24:31 +02:00
Andreas Dangel 9e72ee26ae [java] Fix #4990 - Add attribute @PackageQualifier to ASTClassType
Merge pull request #5005 from oowekyala:issue4990-package-qualifier-attribute
2024-05-23 09:46:55 +02:00
Andreas Dangel 5bc0ab0403 [doc] Update release notes (#4990, #5005) 2024-05-23 09:45:08 +02:00
Andreas Dangel ec30fe1b01 Update gems
- Bump nokogiri from 1.16.2 to 1.16.5
- Bump rexml from 3.2.6 to 3.2.8

Fixes https://github.com/pmd/pmd/security/dependabot/52
Fixes https://github.com/pmd/pmd/security/dependabot/53
Fixes https://github.com/advisories/GHSA-r95h-9x8f-r3f7
Fixes https://github.com/pmd/pmd/security/dependabot/56
Fixes https://github.com/pmd/pmd/security/dependabot/57
Fixes https://github.com/advisories/GHSA-vg3r-rm7w-2xgh
Fixes CVE-2024-35176
2024-05-23 08:43:31 +02:00
Clément Fournier 5b24bbea87 Fix #5029 - infinite recursion in TypeOps::projectUpwards 2024-05-22 17:00:25 +02:00
Clément Fournier bbec7fd3a2 Add test for #4990
Ref #4946
2024-05-21 16:43:18 +02:00
Clément Fournier 6be50ec235 Merge branch 'master' into issue4990-package-qualifier-attribute 2024-05-21 16:10:34 +02:00
Clément Fournier 85c4f0f9ce Merge branch 'master' into kotest-fixes 2024-05-21 15:58:20 +02:00
Clément Fournier 762181d715 Merge branch 'pr/5020'
Ref #5020
2024-05-21 15:55:50 +02:00
Clément Fournier d005ed197f Update release notes, ref #5020 2024-05-21 15:52:31 +02:00
Clément Fournier a754bea5cf Merge branch 'master' into pr/5020 2024-05-21 15:47:28 +02:00
Clément Fournier 8b50584af4 Add some tests 2024-05-21 15:46:56 +02:00
Andreas Dangel 2d33d05d76 [java] Refactor kotest ParserTestSpec tests
- introduce parserTestContainer
- use either parserTest or parserTestContainer with should/doTest
- parserTestGroup is now private
  - this is to limit DSL options - with too many options maintainability suffers
  - parserTestContainer should be used instead
  - there were only 2 test classes, that used parserTestGroup
2024-05-20 13:25:06 +02:00
Andreas Dangel 0fe477ec06 Fixups from PR review
- release notes: API Changes
- fix javadoc since tags
- improve messages in ant task for deprecated skipLexicalErrors
2024-05-20 09:25:06 +02:00
Andreas Dangel 603187e41b Update javadoc 2024-05-17 16:37:37 +02:00
Andreas Dangel 10c78f26de [cpd] Deprecate skipLexicalErrors 2024-05-17 16:20:23 +02:00
Andreas Dangel b624b41673 [ant] Add new CPD parameter failOnError 2024-05-17 16:20:23 +02:00
Andreas Dangel 06efd65b16 [cli] Rename new parameter to be --no-fail-on-error 2024-05-17 16:19:58 +02:00
Andreas Dangel 2d9385f462 Merge branch 'master' into cli-exit-codes-processing-errors 2024-05-17 14:01:57 +02:00
Clément Fournier f1ac913a8b Update test references, add tests 2024-05-17 13:29:36 +02:00
Clément Fournier 04214b43ca Improve treatment of lambdas 2024-05-17 12:47:45 +02:00
Andreas Dangel 3be6df212c [doc] Update release notes (#5009) 2024-05-17 10:51:06 +02:00
Andreas Dangel 7d0355bae1 Use build-tools 25-SNAPSHOT
Refs pmd/build-tools#31
2024-05-17 10:51:05 +02:00
Andreas Dangel 087893a64d [java] Remove unused vars 2024-05-17 10:51:05 +02:00
Andreas Dangel f009de5831 [java] Ensure there is a child test case for ParserTestSpec tests 2024-05-17 10:51:05 +02:00
Andreas Dangel 24c1093bf1 [java] Fix test BranchingExprsTestCases
- Renamed to BranchingExprsTests so that it is picked up by surefire
- Fix cast context
2024-05-17 10:51:04 +02:00
Gold856 e11376f1ef Fix AvoidUsingOctalValue false-positive 2024-05-17 00:32:13 -04:00
Juan Martín Sotuyo Dodero ae76c8f293 Merge pull request #5021 from oowekyala/issue4885-method-not-accessible
[java] Remove redundant interface declarations in pmd-java
2024-05-16 13:18:19 -03:00
Clément Fournier 419ff13fe7 Add new tests 2024-05-16 18:04:01 +02:00
Clément Fournier b640194f76 Fix FN with ternary 2024-05-16 16:38:13 +02:00
Clément Fournier bd24b185ea Fix another FN with numeric contexts 2024-05-16 15:44:46 +02:00
Clément Fournier 798b2c31a1 Fix FN 2024-05-16 15:29:17 +02:00
Clément Fournier 4213083554 Remove redundant interface declarations in pmd-java
Related to #4885
2024-05-16 14:20:04 +02:00
Clément Fournier ed18c9d746 Fix PMD warning 2024-05-16 13:52:29 +02:00
Clément Fournier eb17c9aab7 Fix many problems with UnnecessaryBoxing 2024-05-15 21:49:35 +02:00
Clément Fournier 4cfe90cfdc Cleanup symtable factory 2024-05-15 09:36:39 +02:00
Clément Fournier 7341e3c880 Add version check 2024-05-15 09:19:33 +02:00
Clément Fournier 3ec3903425 Fix javadoc error 2024-05-14 22:50:22 +02:00
Clément Fournier 625fb36b14 Fix #4924 - UnnecessaryBoxing FP in lambda
Change a bit the behavior for some test cases.
Previously the rule reported necessary boxing
that could be simplified another way, but that
is an edge case and not worth complexifying
the rule
2024-05-14 22:45:22 +02:00
Juan Martín Sotuyo Dodero feddca0f4a Remove empty paragraph 2024-05-14 12:04:28 -03:00
Clément Fournier c42330d0d9 Add more doc 2024-05-14 16:37:48 +02:00
Juan Martín Sotuyo Dodero 9acb7747e7 Merge pull request #5015 from oowekyala/issue2368
[java]  Fix #2368 - UnsynchronizedStaticFormatter FP in static initializer
2024-05-14 09:28:49 -03:00
Juan Martín Sotuyo Dodero 88b8adbca7 Merge branch 'master' into issue2368 2024-05-14 09:28:38 -03:00
Juan Martín Sotuyo Dodero 3f6184300c Merge branch 'pr-5013' 2024-05-14 09:25:33 -03:00
Juan Martín Sotuyo Dodero 746f64f8e2 Update changelog, refs #4042 2024-05-14 09:25:16 -03:00
Juan Martín Sotuyo Dodero 03f5f1a651 Merge branch 'pr-5008' 2024-05-14 09:21:53 -03:00
Juan Martín Sotuyo Dodero 4472521605 Update changelog, refs #5006 2024-05-14 09:21:35 -03:00
Clément Fournier fc24eced58 Fix #4903 - UnnecessaryBoxing where explicit conversion is necessary 2024-05-14 12:36:03 +02:00
Clément Fournier 8f23cbb556 Update release notes 2024-05-13 17:25:43 +02:00
Clément Fournier 228a1f5017 [java] Fix #2368 - UnsynchronizedStaticFormatter FP in static initializer 2024-05-13 17:25:31 +02:00
Clément Fournier f1701df7f2 Revert previous two commits - pushed by mistake 2024-05-13 17:22:05 +02:00
Clément Fournier 11743a49fa Update release notes 2024-05-13 17:19:39 +02:00
Clément Fournier a80897fc71 [java] Fix #2326 - UnsynchronizedStaticFormatter FP in static initializer 2024-05-13 17:18:11 +02:00
Clément Fournier 38194a49f7 Fix #4042 - FN with StringBufferInstantiationWithChar 2024-05-13 16:54:08 +02:00
Clément Fournier b6c0a10095 [java] Fix #5006 - bad intersection in capture of recursive types 2024-05-12 15:32:03 +02:00
Clément Fournier ffc71e83a2 Don"t add publicly supported API 2024-05-11 23:15:31 +02:00
Clément Fournier 2e9aa06273 Fix API compatibility
PLSQLParserImpl is public which shouldnt be
2024-05-11 23:13:12 +02:00
Clément Fournier 7484186771 Merge branch 'master' into issue4396-cpd-case-sensitive 2024-05-11 23:07:52 +02:00
Clément Fournier 7f0d148a1b Fix FPs 2024-05-11 23:06:30 +02:00
Clément Fournier ff6f528647 Add tests 2024-05-11 16:14:34 +02:00
Clément Fournier 98d455af45 Update references 2024-05-11 16:13:13 +02:00
Clément Fournier cc17469f4e Fix #4990 - Add attribute @PackageQualifier to ASTClassType 2024-05-11 16:10:37 +02:00
Clément Fournier 40c7ffe03e Update reference files 2024-05-11 16:01:38 +02:00
Clément Fournier 690ff9d6e4 Add tests 2024-05-11 15:56:49 +02:00
Clément Fournier dab89d4806 Don"t add unnamed variables to symtable 2024-05-11 15:47:08 +02:00
Clément Fournier f1b2cda3dc Make variable naming conventions skip unnamed variables
Fix #4954
2024-05-11 15:36:35 +02:00
Clément Fournier c140acd8f9 Fix #3122 - LocalVariableCouldBeFinal should consider blank local variables 2024-05-11 15:30:23 +02:00
Clément Fournier 02cb5701fa Fix #1619 - LocalVariableCouldBeFinal FP with loops 2024-05-11 14:55:14 +02:00
Clément Fournier e5f55c08a5 Add test case for #1160 2024-05-10 20:30:59 +02:00
Juan Martín Sotuyo Dodero bce7991d2d Merge pull request #4994 from oowekyala/pr-4982-fixes
[java] Fix incompatible class bounds not checked during incorporation #4982  (second PR)
2024-05-09 14:42:17 -03:00
Clément Fournier 83b28f3f68 Merge branch 'pr/4969'
Ref #4969
2024-05-07 15:09:52 +02:00
Clément Fournier e43312789f Merge branch 'master' into pr/4969 2024-05-07 15:09:24 +02:00
Clément Fournier 3d4f165bbd Add back removed method for compatibility 2024-05-06 12:41:08 +02:00
Clément Fournier a72f851514 Invert booleans 2024-05-06 12:34:38 +02:00
Clément Fournier 62cc3b1349 fix release notes 2024-05-06 12:30:58 +02:00
Clément Fournier 788b07ba14 Move methods in order to avoid carrying around the pure parameter which is error-prone 2024-05-06 12:23:11 +02:00
Clément Fournier b2a1ef714f Fix PMD warning 2024-05-06 12:03:38 +02:00
Andreas Dangel ef19659cb6 [ci] Only run PMD twice instead of three times during build
pmd:check executes implicitly pmd:pmd, but with
the default configuration. For execution
"pmd-test" this means, we called pmd:pmd twice:
Once within "pmd-test" to check test code and
once more via pmd:check, but against the main code.

Skipping now the default configuration always
and explicitly call pmd:pmd in the two
executions.

Thanks @uhafner for the idea.
2024-05-03 20:31:32 +02:00
Andreas Dangel 516b305e50 [doc] Fix links in README.md
[skip ci]
2024-05-03 19:58:04 +02:00
Andreas Dangel 199591bbd8 [doc] Update about PMD sections
Refs #4842
2024-05-03 19:51:16 +02:00
Andreas Dangel facbdd402c [doc] Update last_updated tags
[skip ci]
2024-05-03 12:53:40 +02:00
Andreas Dangel 3e5b152a2c [doc] Update release notes (#4992)
[skip ci]
2024-05-03 12:51:43 +02:00
Andreas Dangel 5742ac62e9 Fix compat6 2024-05-03 12:47:49 +02:00
Andreas Dangel b3cf149f67 [core] CPD: Include processing errors in XML report 2024-05-03 12:22:02 +02:00
Andreas Dangel 15cc64ff24 Fix PMD errors in compat6 2024-05-03 10:52:24 +02:00
Andreas Dangel ab82f28cf1 Fix integration test 2024-05-03 10:46:33 +02:00
Andreas Dangel 95215ecde7 Fix checkstyle 2024-05-03 10:42:24 +02:00
Andreas Dangel a63cfb8228 [doc] New exit code 5, --no-fail-on-processing-error
Fixes #2827
2024-05-03 10:28:46 +02:00
Andreas Dangel d0a913e50b [cli] Move failOnViolation to AbstractConfiguration 2024-05-03 09:35:59 +02:00
Andreas Dangel e667bf6773 [cli] Add new param "--no-fail-on-processing-error" 2024-05-03 09:33:46 +02:00
Andreas Dangel 0fc23fc9f4 [cli] PMD: Add new exit code 5: VIOLATIONS_OR_PROCESSING_ERRORS 2024-05-03 09:23:10 +02:00
Andreas Dangel 468266d58d [cli] CPD: Add new exit code 5: VIOLATIONS_OR_PROCESSING_ERRORS 2024-05-03 09:06:47 +02:00
Juan Martín Sotuyo Dodero 722f25ba86 Merge branch 'master' into xpath-seq-attributes 2024-05-02 13:06:03 -03:00
Juan Martín Sotuyo DoderoandAndreas Dangel 6fd230e7aa Update docs/pages/release_notes.md
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2024-05-02 13:05:17 -03:00
Juan Martín Sotuyo DoderoandAndreas Dangel 895cfbf266 Update docs/pages/release_notes.md
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2024-05-02 13:05:04 -03:00
Juan Martín Sotuyo Dodero 18c59b2891 Merge branch 'master' into issue-4980 2024-05-02 10:23:21 -03:00
Clément Fournier b1aaf5d69b Fix conc mod exceptions during incorporation 2024-05-02 10:22:19 -03:00
Andreas Dangel a2139be00b [java] Fix impl of ASTVariableId::isResourceDeclaration / VariableId/@ResourceDeclaration (#4988)
Merge pull request #4988 from oowekyala:java-fix-isResourceDeclaration
2024-05-02 12:44:55 +02:00
Andreas Dangel b6a933b4fc [doc] Update release notes (#4988) 2024-05-02 12:43:53 +02:00
Andreas Dangel 435f0dc7b3 [java] Fix #4912 - grammar for TWR allows this expression (#4934)
Merge pull request #4934 from oowekyala:issue4912-java-grammar-fix
2024-05-02 11:39:38 +02:00
Andreas Dangel b7a39e39e9 Apply suggestions from code review 2024-05-02 11:34:43 +02:00
Andreas Dangel 42ffb31ca0 [cpd] Fix CPD crashes about unicode escapes (#4983)
Merge pull request #4983 from oowekyala:cpd-fix-crashes
2024-05-02 11:13:33 +02:00
Andreas Dangel 5bb6ece01a [doc] Update release notes (#4983) 2024-05-02 11:12:37 +02:00
Andreas Dangel 99aef24509 [java] Stop parsing Java for CPD (#4973)
Merge pull request #4973 from oowekyala:cpd-java-no-parse
2024-05-02 10:21:41 +02:00
Andreas Dangel f64fa3ed07 [doc] Update release notes (#4973) 2024-05-02 10:21:09 +02:00
Andreas Dangel c476f4c06c Merge branch 'master' into pr-4973 2024-05-02 10:20:28 +02:00
Andreas Dangel 22a31c938d [core] Actually duplicate the whole current config for RuleSetLoader (#4981)
Merge pull request #4981 from Monits:issue-4978
2024-05-01 20:32:27 +02:00
Andreas Dangel 2d11ed8e93 [core] Add a unit test for ruleset validation messages
Refs #4981
Refs #4978
2024-05-01 20:31:52 +02:00
Andreas Dangel ec7e5b61cc [java] Improve a bit the recovery behavior for unknown types (#4989)
Merge pull request #4989 from oowekyala:issue4985-unused-private-method-method-ref
2024-05-01 20:11:11 +02:00
Andreas Dangel 4993c629ec [doc] Update release notes (#4985) 2024-05-01 20:10:36 +02:00
Clément Fournier 3c39aed55e Fix #4985 UnusedPrivateMethod fp 2024-04-30 17:53:03 +02:00
Clément Fournier e327a548a4 Fix impl of ASTVariableId::isResourceDeclaration 2024-04-30 16:27:26 +02:00
Clément Fournier bca5c0ec09 Remove usages of getStableName
Fix #4930
Fix bug with symbol table in concise resources
2024-04-30 15:26:16 +02:00
Clément Fournier 6c0e736001 Update reference files 2024-04-30 14:45:11 +02:00
Clément Fournier dbfabda735 Merge branch 'master' into issue4912-java-grammar-fix 2024-04-30 14:41:44 +02:00
Juan Martín Sotuyo Dodero 6700b47b12 Remove unused code 2024-04-29 16:03:14 -03:00
Clément Fournier 8c708b2193 Check upper bound compatibility during incorporation 2024-04-29 16:00:04 -03:00
Clément Fournier d773088661 Split unit test 2024-04-29 19:00:46 +02:00
Juan Martín Sotuyo Dodero af3346455f Merge branch 'pr-4984' 2024-04-29 13:34:24 -03:00
Juan Martín Sotuyo Dodero fa176cf316 Update changelog, refs 4852 2024-04-29 13:34:06 -03:00
Clément Fournier 676767c34a Use typeIsExactly for ReplaceVectorWithList 2024-04-29 14:45:08 +02:00
Clément Fournier e2b666210b [java] Fix #4852 - TypeTestUtil.isA considers intersection type subtype of everything 2024-04-29 14:40:44 +02:00
Clément Fournier 4c96e678af Add test for document fix 2024-04-29 12:46:25 +02:00
Clément Fournier fb17f7ff9a Add test 2024-04-29 12:46:25 +02:00
Clément Fournier e81449db4a fixes 2024-04-29 12:46:24 +02:00
Clément Fournier b70521874a Fix failing tests 2024-04-28 20:10:22 +02:00
Clément Fournier 9a25d90c76 Put back old implementation in place 2024-04-28 18:23:57 +02:00
Juan Martín Sotuyo Dodero 4bb533b625 Ignore type variables 2024-04-28 13:13:29 -03:00
Juan Martín Sotuyo Dodero 458405e02d Use spaces 2024-04-28 12:43:30 -03:00
Juan Martín Sotuyo Dodero 66606648a2 Merge branch 'master' into xpath-seq-attributes 2024-04-28 17:39:08 +02:00
Juan Martín Sotuyo DoderoandClément Fournier fbb4648efc Update pmd-core/src/main/java/net/sourceforge/pmd/lang/rule/xpath/internal/SaxonXPathRuleQuery.java
Co-authored-by: Clément Fournier <clem.fournier@proton.me>
2024-04-28 12:37:42 -03:00
Juan Martín Sotuyo Dodero 124f908ca8 Properly log when the impossible happens 2024-04-28 12:36:57 -03:00
Juan Martín Sotuyo Dodero 11e6cc53c5 Update docs on writing xpath rules 2024-04-28 12:23:56 -03:00
Juan Martín Sotuyo DoderoandClément Fournier 56f12d41ea Update docs/pages/release_notes.md
Co-authored-by: Clément Fournier <clem.fournier@proton.me>
2024-04-28 12:19:32 -03:00
Juan Martín Sotuyo Dodero 28c5cd7114 Remove @Names attribute from ASTReferenceExpression 2024-04-28 12:18:36 -03:00
Juan Martín Sotuyo Dodero 7c3de05fd1 Add test case for #1548 2024-04-28 02:33:19 -03:00
Juan Martín Sotuyo Dodero 42cf1b568d Don't use Throwable 2024-04-28 00:17:44 -03:00
Juan Martín Sotuyo Dodero f24635b55c Merge branch 'master' into issue-4532 2024-04-28 05:15:50 +02:00
Juan Martín Sotuyo Dodero 5b42381061 Reintroduce old class names
- Don't break API compatibility, and set everything for removal in PMD 8
2024-04-27 22:11:39 -03:00
Juan Martín Sotuyo Dodero a77519399e Update changelog, refs #4980 2024-04-27 21:23:01 -03:00
Juan Martín Sotuyo Dodero d2e0826ed8 Improve implementation
- throw an apropriate ResolutionFailedException so we don't loose the
   message
 - handle any exception so we don't couple tightly into the LUB
   implementation
2024-04-27 21:19:57 -03:00
Juan Martín Sotuyo Dodero 6ab54e1afb Make the code actually valid 2024-04-27 20:56:27 -03:00
Juan Martín Sotuyo Dodero 0a7a52f228 Fix issue #4980
- When an applicability test fails (ie: during LUB) we don't want that
   to bubble up and fail the process, simply to discard the candidate
   and move forward. If no matching candidate is found, the inference
   will fail anyway.
2024-04-27 20:50:13 -03:00
Juan Martín Sotuyo Dodero b510f77a79 Add failing test for #4980 2024-04-27 20:48:30 -03:00
Juan Martín Sotuyo Dodero 882e9ccd2d update changelog, refs #4978 2024-04-27 19:46:56 -03:00
Juan Martín Sotuyo Dodero 289d5aed3b Actually duplicate the whole current config for RuleSetLoader
- Fixes #4978
2024-04-27 19:40:28 -03:00
Juan Martín Sotuyo Dodero 8756bf2dbd Merge pull request #4976 from adangel/fix-release-script
Fix release scripts
2024-04-28 00:34:28 +02:00
Juan Martín Sotuyo Dodero cb092dd3ae Merge pull request #4968 from adangel/saxon-node-iterators
[core] Typesafe saxon node iterators
2024-04-28 00:33:54 +02:00
Andreas Dangel eadf3d9293 Use saxon's NodeListIterator 2024-04-27 20:52:20 +02:00
Andreas DangelandJuan Martín Sotuyo Dodero e3a4be47fc Update do-release.sh
Co-authored-by: Juan Martín Sotuyo Dodero <juansotuyo@gmail.com>
2024-04-27 20:12:30 +02:00
Andreas Dangel 3f7840c1df [java] Properly handle @MethodSource in UnusedPrivateMethod (#4979)
Merge pull request #4979 from Monits:issue-4975
2024-04-27 20:06:29 +02:00
Juan Martín Sotuyo Dodero 1cfbaeb737 Update changelog, refs #4278 2024-04-26 16:25:21 -03:00
Juan Martín Sotuyo Dodero 002e8f12ff Fix #4278 2024-04-26 16:24:41 -03:00
Juan Martín Sotuyo Dodero 2f88755b48 Add failing test for #4278 2024-04-26 16:24:27 -03:00
Juan Martín Sotuyo Dodero fd14796791 Update changelog, refs #4975 2024-04-26 16:01:12 -03:00
Juan Martín Sotuyo Dodero 8b3f54c91f Fix for #4975 2024-04-26 16:00:16 -03:00
Juan Martín Sotuyo Dodero 905bb6518b Add failing test for #4975 2024-04-26 16:00:03 -03:00
Andreas Dangel 11b8fa2f45 [ci] Improve Dangerfile
- Fix FALSE -> false
- Add ?pr=123 to the download link for the report
2024-04-26 15:55:37 +02:00
Andreas Dangel c67998f64a [java] Update quickstart.xml 2024-04-26 15:43:24 +02:00
Andreas Dangel 629e3f8b83 [doc] Update releasing documentation 2024-04-26 15:39:46 +02:00
Andreas Dangel b1834d6ead [ci] Avoid caching missed dependencies
When a dependency is not available, maven creates a file
with extension .lastUpdated. When such a file is present
maven usually doesn't check again for updates (unless -U is used).
2024-04-26 15:17:12 +02:00
Andreas Dangel d296dc5782 do-release.sh: add matrix/pmd_pmd:gitter.im 2024-04-26 14:56:36 +02:00
Andreas Dangel ac6db43b6b do-release.sh: Clarify the wait 2024-04-26 14:48:39 +02:00
Andreas Dangel 8a67424c8c do-release.sh: Don't delete release_notes_pmd7.md 2024-04-26 14:47:28 +02:00
Andreas Dangel 6a1c7de03c [doc] Restore release_notes_pmd7.md
Was accidentally removed by 339e1d4f43
2024-04-26 12:42:04 +02:00
Andreas Dangel 656330c937 Use pmd 7.1.0 for checks 2024-04-26 12:03:53 +02:00
Andreas Dangel 339e1d4f43 [release] Prepare next development version [skip ci] 2024-04-26 09:04:20 +02:00
Andreas Dangel 592e80d4a9 [release] prepare release pmd_releases/7.1.0 2024-04-26 08:35:11 +02:00
Andreas Dangel 7d0dfa0b13 Prepare pmd release 7.1.0 2024-04-26 08:14:38 +02:00
Andreas Dangel 31585acc6f Bump build-tools from 24-SNAPSHOT to 24 2024-04-25 11:47:20 +02:00
Andreas Dangel d0870f3aa3 [java] New rule ConfusingArgumentToVarargsMethod (#4971)
Merge pull request #4971 from oowekyala:new-rule-UnnecessaryVarargsArrayCreation
2024-04-25 11:40:35 +02:00
Andreas Dangel 04206ecd80 Revert "[ci] Disable auto-gen-config for regression tests"
This reverts commit f5d47ac36e.
This reverts commit 102ba1e962.
2024-04-25 11:39:22 +02:00
Clément Fournier beac8ab3ac Merge branch 'master' into cpd-java-no-parse 2024-04-25 11:07:29 +02:00
Andreas Dangel f5d47ac36e [ci] Disable auto-gen-config for regression tests 2024-04-25 11:00:01 +02:00
Andreas Dangel 102ba1e962 [ci] Disable auto-gen-config for regression tests 2024-04-25 10:28:18 +02:00
Andreas Dangel a154f783bd [doc] Update all-contributors
Add @BurovnikovEvgeniy as a contributor
Add @kohlschuetter as a contributor
Add @Luro02 as a contributor
Add @rs23 as a contributor
Add @andygoossens as a contributor
Add @mitchspano as a contributor
Add @mfvanek as a contributor
Add @VishV-Android as a contributor
2024-04-25 10:04:53 +02:00
Andreas Dangel 16df3dd446 [core] Make CPD report maximal, non-repeating and non-overlapping duplicates (#4966)
Merge pull request #4966 from Monits:issue-2438
Fixes #2438
2024-04-25 09:20:16 +02:00
Andreas Dangel 202943e0cf [java] Fix #4948 - ImplicitSwitchFallthrough false positive with nested switch statement (#4963)
Merge pull request #4963 from oowekyala:issue4948-switch-fallthrough
2024-04-25 09:18:59 +02:00
Andreas Dangel 6f0de09ceb [doc] Update release notes (#4963, #4948) 2024-04-25 09:18:08 +02:00
Andreas Dangel c9b15f9c9b Bump maven-pmd-plugin from 3.21.2 to 3.22.0 2024-04-25 08:49:26 +02:00
Clément Fournier af97136018 [java] Stop parsing Java for CPD
Ref #4958
2024-04-23 19:10:41 +02:00
Clément Fournier 59bda4cc99 Merge branch 'pr/4967'
Ref #4967
2024-04-23 10:31:34 +02:00
Clément Fournier 3765e45502 Merge branch 'master' into pr/4967 2024-04-23 10:31:25 +02:00
Clément Fournier 75e50df94a Make @Image have old behavior, remove KEYWORD_UNRESERVED from tree 2024-04-21 22:55:09 +02:00
Clément Fournier a92b61711e Update pmd-java/src/main/resources/category/java/errorprone.xml 2024-04-21 22:47:24 +02:00
Andreas Dangel f3081150d2 [java] New rule LambdaCanBeMethodReference (#4918)
Merge pull request #4918 from oowekyala:new-rule-lambdacanbemethodref
2024-04-21 19:34:58 +02:00
Clément Fournier 838df27a19 Normalize token images also in PMD parser 2024-04-21 19:11:04 +02:00
Clément Fournier 95721effd4 Trick javacc into giving string literal a non-literal image 2024-04-21 15:46:18 +02:00
Clément Fournier 2f66305c9c Small optimization 2024-04-21 14:30:35 +02:00
Clément Fournier 789ec03dba fix last violation 2024-04-21 14:26:17 +02:00
Clément Fournier 52c4f435a0 Split UnnecessaryVarargsArrayCreation into two rules
The new errorprone rule catches more cases (it doesn't
only care about array allocations).
2024-04-21 14:10:17 +02:00
Clément Fournier 29b12bcbd3 Fix more violations 2024-04-21 13:37:20 +02:00
Clément Fournier 75e284075b Fix violations of UnnecessaryVarargsArrayCreation 2024-04-21 13:31:27 +02:00
Clément Fournier b931c2f1e0 Fix name of String literal token 2024-04-21 13:13:00 +02:00
Clément Fournier f4e75410f8 Treat unquotable identifiers as unquoted in PLSQL 2024-04-21 12:53:50 +02:00
Clément Fournier b56925f419 Merge remote-tracking branch 'origin/issue4396-cpd-case-sensitive' into issue4396-cpd-case-sensitive 2024-04-21 12:17:27 +02:00
Clément FournierandAndreas Dangel d45aef826a Apply suggestions from code review
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2024-04-21 12:17:08 +02:00
Clément Fournier 06eb7ead5a review comments 2024-04-21 12:16:26 +02:00
Clément Fournier c4826668c9 Merge branch 'master' into issue4396-cpd-case-sensitive 2024-04-21 12:14:42 +02:00
Clément Fournier 25dfc2d728 Fix some things 2024-04-20 21:56:08 +02:00
Clément Fournier 60f03d75bf Blocks can also be labeled (fp in jdk sources) 2024-04-20 16:22:07 +02:00
Clément Fournier ad9ff65079 Fix FN with empty switch 2024-04-20 16:18:00 +02:00
Clément Fournier 3f667eab04 Add rule to quickstart ruleset 2024-04-20 13:04:56 +02:00
Clément Fournier 653c3bfb79 Ignore annotated lambdas 2024-04-20 13:01:38 +02:00
Clément Fournier af4ed5951f Replace usages of deprecated methods 2024-04-20 12:53:10 +02:00
Clément Fournier 132a4629b6 Merge branch 'master' into new-rule-lambdacanbemethodref 2024-04-20 12:48:44 +02:00
Clément Fournier 8c3d2cd2a0 Merge branch 'master' into issue4948-switch-fallthrough 2024-04-20 12:43:00 +02:00
Clément Fournier 46cfe3c7df Handle array allocations in try block better 2024-04-20 12:19:20 +02:00
Juan Martín Sotuyo Dodero 34e0b217a2 Merge pull request #4970 from adangel/doc-small-logo
[doc] Add small logo variant
2024-04-19 12:29:50 -03:00
Andreas Dangel e01074f244 [doc] Add small logo variant 2024-04-19 16:41:54 +02:00
Juan Martín Sotuyo Dodero 3650622645 Remove unused imports 2024-04-19 09:08:21 -03:00
Juan Martín Sotuyo Dodero 346d7fd0dc Do not warn for List being deprecated by default 2024-04-19 09:02:16 -03:00
Juan Martín Sotuyo Dodero 1231a54300 Remove unsused imports 2024-04-19 08:56:48 -03:00
Juan Martín Sotuyo Dodero 62443a4c33 Update tree export test 2024-04-19 02:12:24 -03:00
Juan Martín Sotuyo Dodero 0d32ac8aa1 Update more tree dump tests 2024-04-19 02:02:49 -03:00
Juan Martín Sotuyo Dodero ca7e15c114 update output to sequences 2024-04-19 01:55:54 -03:00
Juan Martín Sotuyo Dodero d9e146da7e Update Java parser test to show modifiers properly
- no longer need to manually add the attributes…
 - …but the format is slightly different
2024-04-19 01:51:42 -03:00
Juan Martín Sotuyo Dodero d7693369ab Have the NodePrinter show collections as sequences 2024-04-19 01:51:21 -03:00
Juan Martín Sotuyo Dodero 02e7a713fa Update Apex tree dumps with the new attributes 2024-04-19 01:17:28 -03:00
Juan Martín Sotuyo Dodero 3a4abd720e Schema awareness changes the produced queries 2024-04-19 01:13:37 -03:00
Juan Martín Sotuyo Dodero 0d6f196c6d Fix broken tests 2024-04-19 01:13:21 -03:00
Juan Martín Sotuyo Dodero b74b6e5a66 Revert. Different rules on the same node report separately 2024-04-19 00:46:58 -03:00
Juan Martín Sotuyo Dodero 8d51a2f2a0 Just do it once per attribute 2024-04-19 00:31:37 -03:00
Juan Martín Sotuyo Dodero ce5e229c61 Produce deprecation warnings when atomize is used
- When Saxon determines that it needs to atomize an attribute rather
   than getStringValue() we were not producing deprecation warnings.
2024-04-19 00:28:28 -03:00
Juan Martín Sotuyo Dodero 8db0c80f24 Restrict exposed attributes based on element types 2024-04-19 00:14:11 -03:00
Juan Martín Sotuyo Dodero f307e6e6cb Update changelog 2024-04-18 23:49:35 -03:00
Juan Martín Sotuyo Dodero a01481a4f3 Add test for collection attributes 2024-04-18 23:29:37 -03:00
Andreas Dangel 75f1ee8582 [java] Avoid NPE in CloseResourceRule (#4964, #4751)
Merge pull request #4964 from Monits:issue-4751
Fixes #4751
2024-04-18 20:58:12 +02:00
Juan Martín Sotuyo Dodero 53246d584e Support sequences in XPath Attributes 2024-04-18 15:45:23 -03:00
Andreas Dangel 23671181df [core] Typesafe saxon node iterators 2024-04-18 20:45:14 +02:00
Andreas Dangel c09abb2228 [core] Upgrade saxon to 12.4 (#4959)
Merge pull request #4959 from Monits:upgrade-saxon
2024-04-18 20:41:06 +02:00
Andreas Dangel 90861df5f8 [doc] Update release notes (#4959) 2024-04-18 20:39:13 +02:00
Juan Martín Sotuyo Dodero 536ffc61e7 Merge branch 'master' into issue-2438 2024-04-18 12:54:02 -03:00
Juan Martín Sotuyo Dodero c082f3397a Merge pull request #4956 from adangel/issue-4942-cpd-skip-duplicates
[core] Add a filter possibility to FileCollector
2024-04-18 12:53:13 -03:00
Andreas Dangel 37269caa03 [core] Fixups from review (#4956) 2024-04-18 17:12:59 +02:00
Andreas Dangel 8e7a92b8f6 Merge branch 'master' into issue-4942-cpd-skip-duplicates 2024-04-18 17:04:10 +02:00
Andreas Dangel ece69561fb [java] Extend FinalCouldBeStatic to consider compile time constants (#4940, #2440)
Merge pull request #4940 from Monits:issue-2440
Fixes #2440
2024-04-18 16:57:01 +02:00
Andreas Dangel ce10ccf6e3 [java] New rule UnnecessaryVarargsArrayCreation (#4919, #3216)
Merge pull request #4919 from oowekyala:new-rule-UnnecessaryVarargsArrayCreation
Fixes #3216
2024-04-18 16:55:58 +02:00
Andreas Dangel 915c5aa727 [doc] Update release notes (#3216, #4919) 2024-04-18 16:41:54 +02:00
Andreas Dangel 3502e6460c Fix checkstyle 2024-04-18 16:37:10 +02:00
Andreas Dangel 1c7f0717c6 Merge branch 'master' into pr-4919 2024-04-18 16:23:15 +02:00
Clément Fournier f8bf6d13b3 Support labeled statements properly 2024-04-18 15:16:55 +02:00
Andreas Dangel b42108d55a [doc] Update release notes (#4967) 2024-04-18 10:17:17 +02:00
Andreas Dangel 53aecb655d Exclude pmd-cli/pmd-dist from cyclonedx BOM
This should make the bom.xml/bom.json files be
reproducible again.
2024-04-18 09:52:30 +02:00
Andreas Dangel 4b14d4e757 Use latest ant for maven-antrun-plugin
This preserves the file permissions when doing
a replaceregexp on a file.
2024-04-18 09:52:30 +02:00
Andreas Dangel d9dcaaeb93 Bump maven-source-plugin from 3.3.0 to 3.3.1 2024-04-18 09:52:29 +02:00
Juan Martín Sotuyo Dodero 540076b26b PMD fixes 2024-04-18 01:22:32 -03:00
Juan Martín Sotuyo Dodero 8f6270d3b5 Style issues 2024-04-18 01:11:38 -03:00
Juan Martín Sotuyo Dodero 701e78e8fe Update changelog 2024-04-18 01:02:45 -03:00
Juan Martín Sotuyo Dodero e1ac7a13a2 Remove multiple occurrence test from cpp
- This is superceded by a generic test in pmd-core
2024-04-18 00:54:29 -03:00
Juan Martín Sotuyo Dodero be902e61e1 Fix newly found scenarios 2024-04-18 00:37:37 -03:00
Juan Martín Sotuyo Dodero 1e0c9cd759 Add more specific tests in core 2024-04-18 00:37:27 -03:00
Juan Martín Sotuyo Dodero 0282ee3583 Properly handle multiple matches once again 2024-04-17 23:37:12 -03:00
Juan Martín Sotuyo Dodero 9d04358707 Add a failing test for multiple exact matches 2024-04-17 23:36:49 -03:00
Juan Martín Sotuyo Dodero f9cb7ab992 Ensure CPD matches are nonoverlapping maximals
- The old implementation would fail on scenarios where duplicates
   exceed the minimum token window. In general, if we have 20 identical
   tokens, 1 different, and then the same 20 again, CPD would find the
   20 at the beginning match the last 20… but also the 19 at the
   beginning match the last 19, the 18 at the beggining… down to the
   windows size
2024-04-17 20:10:40 -03:00
Juan Martín Sotuyo Dodero 2f54938793 Add failing test case for #2438 2024-04-17 20:05:11 -03:00
Juan Martín Sotuyo Dodero 61a7459247 Update changelog 2024-04-17 17:00:05 -03:00
Juan Martín Sotuyo Dodero bd89f9185b Typo 2024-04-17 16:42:37 -03:00
Juan Martín Sotuyo Dodero 7725897373 Rename JUnit4TestShouldUseTestAnnotation
- The rule is now called UnitTestShouldUseTestAnnotation as it applies
   to both JUnit and TestNG.
 - The doc is further improved to reflect this.
2024-04-17 16:42:37 -03:00
Juan Martín Sotuyo Dodero 9f1ab89d31 Rename JUnitTestsShouldIncludeAssertRule
- It's now called UnitTestsShouldIncludeAssertRule as it applies to
   JUnit and TestNG
 - The doc is updated to reflect this
2024-04-17 16:42:37 -03:00
Juan Martín Sotuyo Dodero ffec30f392 Rename JUnitTestContainsTooManyAssertsRule
- The rule is now called UnitTestContainsTooManyAssertsRule as it
   checks for JUnit and TestNG.
 - This is further cleared up in the documentation.
2024-04-17 16:42:37 -03:00
Juan Martín Sotuyo Dodero 5301a8e852 Rename JUnitAssertionsShouldIncludeMessageRule
- The rule is now called UnitTestAssertionsShouldIncludeMessageRule as
   it applies to JUnit and TestNG.
 - The doc is updated to reflect this.
2024-04-17 16:42:37 -03:00
Juan Martín Sotuyo Dodero 691731cdd4 Rename JUnit4TestShouldUseAfterAnnotation
- Call it JUnitTestShouldUseAfterAnnotation instead as it not only
   applies to JUnit4
 - Improve the doc to further clarify it's usages
2024-04-17 16:42:37 -03:00
Juan Martín Sotuyo Dodero 55686dbef4 Rename JUnit4TestShouldUseBeforeAnnotation
- Call it JUnitTestShouldUseBeforeAnnotation as it applies to JUnit 4
   and 5.
 - Improve the doc to clarify it's intended use.
2024-04-17 16:42:37 -03:00
Juan Martín Sotuyo Dodero 4ff54e42a8 Merge pull request #4951 from adangel/compat-maven-pmd-plugin-3.22.0
[compat6] Make compat6 forward compatible with maven-pmd-plugin 3.22.0
2024-04-16 18:59:44 -03:00
Juan Martín Sotuyo Dodero 5b5ac5c07d Update changelog, refs #4751 2024-04-16 17:53:10 -03:00
Juan Martín Sotuyo Dodero 693ffdb46a Avoid NPE on CloseResourceRule
- Fixes #4751
2024-04-16 17:52:11 -03:00
Juan Martín Sotuyo Dodero 32680d5b83 Merge branch 'master' into issue4912-java-grammar-fix 2024-04-16 17:38:03 -03:00
Juan Martín Sotuyo Dodero 390db62cba Merge branch 'pr-4958' 2024-04-16 17:36:50 -03:00
Juan Martín Sotuyo Dodero 1be81a55cd Update changelog, refs #4947 2024-04-16 17:36:32 -03:00
Juan Martín Sotuyo Dodero c17783802f Merge branch 'pr-4961' 2024-04-16 17:34:31 -03:00
Juan Martín Sotuyo Dodero e0705e5b28 Update changelog, refs #4961 2024-04-16 17:34:12 -03:00
Clément Fournier 9b5ae7d418 fix pmd warning 2024-04-16 19:06:03 +02:00
Clément Fournier b45e15a07e Fix finally handling 2024-04-16 18:58:52 +02:00
Clément Fournier 7b553300a1 Fix #4948 - abrupt completion of switch statement 2024-04-16 13:36:14 +02:00
Clément Fournier 9f605552ee Add one example 2024-04-15 15:25:59 +02:00
Clément Fournier 4dcdfb0d4f Fix xpath expressions in documentation
Fix #4901
2024-04-15 15:21:57 +02:00
Juan Martín Sotuyo Dodero 232c35aed4 Remove commented code 2024-04-12 20:20:18 -03:00
Juan Martín Sotuyo Dodero 2eb62bc691 Unused imports 2024-04-12 18:51:02 -03:00
Juan Martín Sotuyo Dodero 8c6401ae37 Add missing @Override 2024-04-12 18:51:02 -03:00
Juan Martín Sotuyo Dodero 3571876519 Don't extend useless class 2024-04-12 18:51:02 -03:00
Juan Martín Sotuyo Dodero 2cf36cb2cc Update tests
- The rewritten XPaths are slightly different, although equivalent
2024-04-12 18:51:02 -03:00
Juan Martín Sotuyo Dodero 71bad39603 Update pmd-xml 2024-04-12 18:51:02 -03:00
Juan Martín Sotuyo Dodero 322ac4b8d4 Accomodate for UnicodeString 2024-04-12 18:51:02 -03:00
Juan Martín Sotuyo Dodero b0d3f13367 Also handle UncheckedXPathException 2024-04-12 18:51:02 -03:00
Juan Martín Sotuyo Dodero d93c653ad9 Fix reverse iteration 2024-04-12 18:51:02 -03:00
Juan Martín Sotuyo Dodero 842c9315a2 Remove unused imports 2024-04-12 18:51:02 -03:00
Juan Martín Sotuyo Dodero 8eaecf184e Swap for the new version of getAttributeValue 2024-04-12 18:51:02 -03:00
Juan Martín Sotuyo Dodero a69d565d51 Upgrade to saxon 12.4 2024-04-12 18:50:58 -03:00
Juan Martín Sotuyo Dodero 19089c2959 Use saxon 11.6 2024-04-12 13:03:03 -03:00
Clément Fournier 967c16561a Refactor how string templates are parsed
Fix #4947
2024-04-12 18:02:20 +02:00
Juan Martín Sotuyo Dodero 184fb31f4d Typos 2024-04-12 12:57:47 -03:00
Juan Martín Sotuyo Dodero db0df4ed89 Remove empty implementation 2024-04-12 12:56:53 -03:00
Juan Martín Sotuyo Dodero 55688cf300 Upgrade to Saxon 11.6 2024-04-12 12:55:21 -03:00
Clément Fournier 64eeeec000 Add test for #4947 2024-04-12 16:34:23 +02:00
Andreas Dangel 2bddfd2b45 [core] Add a filter possibility to FileCollector
Fixes #4942
2024-04-12 12:44:55 +02:00
Juan Martín Sotuyo Dodero c472fdf48c Merge pull request #4949 from adangel/issue-4899-jar-closed
[core] Disable Caching in URLConnection for ClasspathClassLoader
2024-04-11 15:18:51 -03:00
Andreas Dangel 2905cec8ed [compat6] Make compat6 forward compatible with maven-pmd-plugin 3.22.0 2024-04-11 16:00:34 +02:00
Andreas Dangel db04a2cab0 Merge branch 'master' into issue-4899-jar-closed 2024-04-11 16:00:00 +02:00
Andreas Dangel 6ad8577880 [doc] Fix rule doc generator under Windows 2024-04-11 15:59:29 +02:00
Andreas Dangel a65975bf75 Add @mkolesnikov as a contributor 2024-04-11 14:52:30 +02:00
Andreas Dangel 62f215929c [core] Disable Caching in URLConnection for ClasspathClassLoader
Fixes #4899
2024-04-11 14:52:30 +02:00
Andreas Dangel 6d9c49858f [ci] Generate rule doc also for pull requests 2024-04-11 14:49:10 +02:00
Andreas Dangel 32b70b1d89 [doc] Fix rule reference 2024-04-11 14:48:17 +02:00
Clément Fournier 10dfb45dc2 Replace numbers with names 2024-04-09 17:24:35 +02:00
Clément Fournier 835abc80f7 Add back ctor for compatibility 2024-04-09 13:44:07 +02:00
Clément Fournier 8f1e6b077a Fix exclusive end index in antlr token 2024-04-09 11:41:16 +02:00
Clément Fournier f484c75c52 Add test for PLSQL ignore literals 2024-04-09 11:39:13 +02:00
Clément Fournier 41c01356fc Fix things 2024-04-09 11:35:14 +02:00
Clément Fournier ab80b2443d Also add this ability for Antlr lexers, adapt TSQL 2024-04-08 21:36:45 +02:00
Clément Fournier 0cb2e37ce9 Update reference files 2024-04-08 21:05:52 +02:00
Clément Fournier 1c23df7286 Fix some weird things in PLSQL tokens 2024-04-08 20:56:08 +02:00
Clément Fournier 72408ca679 Normalize image of PLSQL tokens to uppercase, reuse strings 2024-04-08 20:56:08 +02:00
Clément Fournier 44f29c3983 Fix #4396 - Fix PLSQL CPD being case-sensitive 2024-04-08 20:55:41 +02:00
Juan Martín Sotuyo Dodero 0ce6928b53 Properly handle null literals 2024-04-07 03:26:20 -03:00
Juan Martín Sotuyo Dodero f7fc9f6f0a Add test case for null literals 2024-04-07 03:26:20 -03:00
Juan Martín Sotuyo Dodero 89fff36818 Updte changelog, refs #2440 2024-04-07 02:33:48 -03:00
Juan Martín Sotuyo Dodero 4a9627c5bb Fix #2440
- Extend FinalFieldCouldBeStatic to consider all compile-time constants
   and not only single literals.
2024-04-07 02:32:00 -03:00
Juan Martín Sotuyo Dodero 8b18e9524b Add failing test for #2440 2024-04-07 02:31:43 -03:00
Juan Martín Sotuyo Dodero d4b99bb047 Merge branch 'pr-4937' 2024-04-07 01:52:03 -03:00
Juan Martín Sotuyo Dodero 2c26e43ae9 Update changelog, refs #4779 2024-04-07 01:51:41 -03:00
Juan Martín Sotuyo Dodero c81be9d17e Update changelog, refs #4902 2024-04-07 01:49:51 -03:00
Juan Martín Sotuyo Dodero 9b4054ed8d Merge pull request #4933 from oowekyala/issue4902-bad-intersection
[java] Fix problem with type inference with enums sharing a common interface
2024-04-07 01:48:17 -03:00
Juan Martín Sotuyo Dodero 412a3654ca Merge pull request #4936 from adangel/issue-4418-apex-annotation
[apex] Add ASTAnnotation#getRawName
2024-04-07 01:43:41 -03:00
Clément Fournier 2a12cb1ef7 Fix rule ref 2024-04-06 17:00:27 +02:00
Clément Fournier 78c43ed87a [java] Fix #4779 - Improve doc of MethodArgumentCanBeFinal 2024-04-06 16:58:52 +02:00
Andreas Dangel aaed4fb90a [java] Add test case for #1780 2024-04-06 12:00:38 +02:00
Andreas Dangel 3203a80f27 [apex] Add ASTAnnotation#getRawName
Fixes #4418
2024-04-06 11:16:06 +02:00
Clément Fournier eccd99bfd6 release notes 2024-04-05 16:36:48 +02:00
Clément Fournier 32e5646903 Merge branch 'master' into issue4912-java-grammar-fix 2024-04-05 16:35:28 +02:00
Clément Fournier e636c206f0 Doc 2024-04-05 16:35:09 +02:00
Clément Fournier 87691a0321 Self review 2024-04-05 16:32:27 +02:00
Clément Fournier 4a25afc864 Checkstyle 2024-04-05 16:24:11 +02:00
Clément Fournier bfe4013883 Add test case for #4902 2024-04-05 16:22:26 +02:00
Clément Fournier 89f7aecab8 Fix mostSpecific 2024-04-05 16:18:08 +02:00
Clément Fournier 6f1f72de1e Doc 2024-04-05 15:59:12 +02:00
Andreas Dangel 7da809b462 [java] ArrayIsStoredDirectly: Add test case for #1413 2024-04-05 15:58:19 +02:00
Andreas Dangel 9b0c7dc3eb [java] InvalidLogMessageFormat: Add test case for #939 2024-04-05 15:50:34 +02:00
Andreas Dangel 709396d8f3 [java] InvalidLogMessageFormat: Add test case for #253 2024-04-05 15:45:29 +02:00
Andreas Dangel 84dc794a2d Merge pull request #4917 from Monits:fix-4913
[cli] Properly wait for cpd-gui until close #4917
2024-04-05 15:33:27 +02:00
Clément Fournier 277601f9ec Fix lub and glb of arrays
We still have a problem with associativity of glb being broken.
2024-04-05 13:08:31 +02:00
Clément Fournier 7bd37cd79d Fix TypeOps::mostSpecific in the case of possible unchecked conversion 2024-04-05 12:16:28 +02:00
Clément Fournier 03b8d1acef Fix #4912 - grammar for TWR allows this expression 2024-04-05 10:19:58 +02:00
Juan Martín Sotuyo Dodero 0b74e0e18f Merge branch 'pr-4920' 2024-04-04 23:25:57 -03:00
Juan Martín Sotuyo Dodero 2159ed97bd Update changelog, refs #4602 and #4785 2024-04-04 23:25:29 -03:00
Juan Martín Sotuyo Dodero b723da59ac Merge branch 'master' into fix-4913 2024-04-04 23:18:58 -03:00
Juan Martín Sotuyo Dodero 2a5a52b4ee Merge pull request #4925 from oowekyala/typeres-explicitly-typed-lambdas
[java] Support explicitly typed lambdas
2024-04-04 23:18:16 -03:00
Juan Martín Sotuyo Dodero 9e27977244 Checkstyle fixes 2024-04-04 18:41:06 -03:00
Juan Martín Sotuyo Dodero 76b00a95ad Better document what to throw on an unsupported lang 2024-04-04 18:18:14 -03:00
Clément Fournier 6d35f14f6b Fix #4893 - throw if language is not supported 2024-04-04 18:18:14 -03:00
Juan Martín Sotuyo Dodero 79d9570213 Merge pull request #4929 from adangel/issue-4928-emptycatchblock
[java] Fix EmptyCatchBlock with allowCommentedBlock
2024-04-04 18:12:39 -03:00
Juan Martín Sotuyo Dodero 1845400734 Merge branch 'master' into issue-4928-emptycatchblock 2024-04-04 18:12:31 -03:00
Juan Martín Sotuyo Dodero 0f45215817 Merge pull request #4926 from adangel/japicmp
[core] Add japicmp
2024-04-04 15:51:34 -03:00
Juan Martín Sotuyo Dodero 7828451dbb Merge pull request #4927 from oowekyala/fix-pretty-printing
[java] More pretty printing fixes
2024-04-04 15:04:25 -03:00
Andreas Dangel d485225d1c Exclude Experimental API from japicmp check 2024-04-04 17:46:58 +02:00
Andreas Dangel f87f24ef90 Merge pull request #4906 from Monits:fix-2056
[java] CloseResource should treat parameters as external even if casted when assigned to a local variable #4906
2024-04-04 17:38:51 +02:00
Andreas Dangel 07398ac557 [java] Fix EmptyCatchBlock with allowCommentedBlock
Fixes #4928
2024-04-04 17:27:49 +02:00
Clément Fournier 8ed4d13a6d checkstyle 2024-04-04 17:17:34 +02:00
Clément Fournier 3bcfa92c8b checkstyle 2024-04-04 17:16:02 +02:00
Andreas Dangel f2a586c6f2 Merge pull request #4871 from oowekyala:issue3953-treat-formal-comments-as-normal-comments
[apex] EmptyCatchBlock: Fix FP with doc comments #4871
2024-04-04 16:53:37 +02:00
Andreas Dangel bdcc7c5609 [doc] Update release notes (#3953) 2024-04-04 16:49:43 +02:00
Clément Fournier bcb6859014 Merge branch 'master' into new-rule-lambdacanbemethodref 2024-04-04 16:49:19 +02:00
Andreas Dangel a7a9b916e3 Merge branch 'master' into pr-4871 2024-04-04 16:48:42 +02:00
Clément Fournier 6c9aa9d0ea Merge branch 'master' into fix-pretty-printing 2024-04-04 16:47:01 +02:00
Clément Fournier 5ffee032d8 Merge branch 'master' into fix-pretty-printing 2024-04-04 16:45:24 +02:00
Clément Fournier 1914871c3c Remove unnecessary parens, support unary exprs 2024-04-04 16:43:49 +02:00
Andreas Dangel 2c2a384c7d Merge branch 'master' into japicmp 2024-04-04 16:43:29 +02:00
Clément Fournier 45173880a5 Add pretty printing for infix 2024-04-04 16:38:07 +02:00
Andreas Dangel 97bd272fef Fix unused import 2024-04-04 16:36:53 +02:00
Clément Fournier 6e0aafbf44 Add pretty printing for lambdas 2024-04-04 16:29:28 +02:00
Andreas Dangel 6489cf7232 [doc] Update release notes (#494) 2024-04-04 15:52:21 +02:00
Andreas Dangel e47eb352d5 [java] Restore compatibility of SingularFieldRule 2024-04-04 15:52:13 +02:00
Juan Martín Sotuyo Dodero 3180a283cc Merge pull request #4921 from oowekyala/fix-pretty-printing
[java] Fix pretty printing for some exprs
2024-04-04 10:33:30 -03:00
Juan Martín Sotuyo Dodero eaec0dad28 Merge pull request #4923 from adangel/fix-checkstyle-config
Fix checkstyle config and checkstyle issues
2024-04-04 10:27:23 -03:00
Andreas Dangel 4fe50978b6 Add japicmp - breaks build based on semantic versioning 2024-04-04 15:20:15 +02:00
Clément Fournier 100e5c7ba2 Support explicitly typed lambdas 2024-04-04 14:54:43 +02:00
Andreas Dangel 280b1a1ee3 Bump next version to be 7.1.0-SNAPSHOT 2024-04-04 10:49:18 +02:00
Andreas Dangel d88a3c50fe Fix checkstyle config and checkstyle issues 2024-04-04 10:46:05 +02:00
Andreas Dangel b1c40f1e33 Merge pull request #4864 from emouty:parametrize-assert-methods
Fix #1084 [Java] add extra assert method names to Junit rules #4864
2024-04-04 09:26:34 +02:00
Andreas Dangel 2174fc287a [doc] Update release notes (#1084, #4864) 2024-04-04 08:56:22 +02:00
Andreas Dangel 09714757ff Add @emouty as a contributor 2024-04-04 08:45:30 +02:00
Andreas Dangel e10f622866 Merge branch 'master' into pr-4864 2024-04-04 08:44:27 +02:00
Clément Fournier 09eefeac19 Revert changes to pretty printing 2024-04-03 22:58:10 +02:00
Clément Fournier 916213cc74 Fix pretty printing for some exprs 2024-04-03 22:57:33 +02:00
Clément Fournier af3d0a34f1 Fix pretty printing ctor 2024-04-03 22:54:41 +02:00
Clément Fournier c3733c4091 Fix #4602 - unnecessaryimport FPs 2024-04-03 22:44:40 +02:00
Clément Fournier e03ff54393 fix pretty printing 2024-04-03 22:10:43 +02:00
Andreas Dangel 07d96e7128 Merge pull request #4535 from oowekyala:issue4435-unusedAssignment
[java] Fix #4435 - FP with UnusedAssignment #4535
2024-04-03 21:01:30 +02:00
Andreas Dangel bf2e5f970b [doc] Update release notes (#4618, #3694) 2024-04-03 20:31:47 +02:00
Andreas Dangel 2f29801187 [java] Reference correct issues in test cases 2024-04-03 20:31:29 +02:00
Andreas Dangel 6834b3f18c [java] Update javadoc since 2024-04-03 20:31:04 +02:00
Andreas Dangel 71633b4b2e Merge branch 'master' into pr-4535 2024-04-03 20:13:36 +02:00
Clément Fournier e524a60d28 fix fp with array creation without elements 2024-04-03 19:28:23 +02:00
Clément Fournier e32b94af3f Change defaults of the rule and ignore method calls 2024-04-03 19:03:31 +02:00
Clément Fournier 1d18209d11 Doc 2024-04-03 18:14:54 +02:00
Clément Fournier fe0b4a9b36 Improve messages when varargs call is confusing 2024-04-03 18:03:42 +02:00
Clément Fournier 955ccbf55c pmd warning 2024-04-03 18:02:40 +02:00
Clément Fournier ae0b9d6223 [java] Add rule UnnecessaryVarargsArrayCreation 2024-04-03 17:43:53 +02:00
Juan Martín Sotuyo Dodero d774e8ffd2 Merge branch 'master' into fix-4913 2024-04-03 12:16:26 -03:00
Juan Martín Sotuyo Dodero f8d1b3b1d3 Update changelog, refs #4913 2024-04-03 12:13:24 -03:00
Juan Martín Sotuyo Dodero 9bdd5384ec Wait for the CPD GUI to be closed
- Fixes #4913
2024-04-03 12:11:32 -03:00
Clément Fournier c511485f5f Mrefs without expr qualifier cannot NPE 2024-04-03 16:38:54 +02:00
Clément Fournier 2e27fa631c Support method ref with first param as receiver 2024-04-02 20:32:48 +02:00
Clément Fournier b16c8de4e0 doc and release notes 2024-04-02 20:21:34 +02:00
Clément Fournier b478c36d63 support block lambdas 2024-04-02 20:17:46 +02:00
Clément Fournier fd9aca85e6 [java] Add new rule LambdaCanBeMethodReference 2024-04-02 19:52:48 +02:00
Andreas Dangel a28943ae1b Merge pull request #4909 from Monits:fix-4388
[pom] Properly navigate dependencyManagement node #4909
2024-04-02 19:48:21 +02:00
Andreas Dangel 5fbf7a26f1 [xml] fix integration test for pom rule 2024-04-02 19:47:24 +02:00
Andreas Dangel 34c3ec6e47 Merge pull request #4908 from oowekyala:issue4569-forloopcanbeforeach
[java] Fix #4569 issue with ForLoopCanBeForeach when stride is not 1 #4908
2024-04-02 19:23:25 +02:00
Andreas Dangel 115dee1db8 [doc] Update release notes (#4569) 2024-04-02 19:22:26 +02:00
Clément Fournier 24f84f90f1 deprecate duplicate methods in lambda expression 2024-04-02 17:55:48 +02:00
Juan Martín Sotuyo Dodero 58f5d81608 Update changelog, refs #4388 2024-04-02 12:53:20 -03:00
Juan Martín Sotuyo Dodero 490775fb49 Fix incorrect XPath 2024-04-02 12:51:14 -03:00
Juan Martín Sotuyo Dodero 00afd6d0a9 Update test cases for #4388 2024-04-02 12:50:56 -03:00
Juan Martín Sotuyo Dodero c9926fba4c Add test cases for #3219 2024-04-01 23:40:57 -03:00
Juan Martín Sotuyo Dodero 32b5f86bf6 Fix and reenable test case 2024-04-01 23:08:01 -03:00
Clément Fournier 0b58805712 format 2024-04-01 23:22:56 +02:00
Juan Martín Sotuyo Dodero 86328b7ad1 Add test cases for #1592 2024-03-31 02:24:02 -03:00
Juan Martín Sotuyo Dodero 02e695ffdb Update changelog, refs #2056 2024-03-31 02:14:35 -03:00
Juan Martín Sotuyo Dodero 44b7e21e03 Fix #2056 2024-03-31 02:13:17 -03:00
Juan Martín Sotuyo Dodero cce22b93b8 Add test case for #2056 2024-03-31 02:13:00 -03:00
Juan Martín Sotuyo Dodero a47a30161c Merge pull request #4905 from adangel/issue-4885-assertions
[core] Improve AssertionUtil messages
2024-03-30 16:14:39 -03:00
Andreas Dangel c969753dd2 Merge pull request #4894 from Scrates1:space-error
Fix #4791 Error caused by space in JDK path #4894
2024-03-29 11:08:15 +01:00
Andreas Dangel 81637cfcbf [doc] Update release notes (#4791, #4894) 2024-03-29 11:07:32 +01:00
Andreas Dangel 46cd5e0c96 Update @Scrates1 as a contributor 2024-03-29 11:05:22 +01:00
Andreas Dangel 6c0571cf1b [cli] Fix double quoting in pmd.bat
Quoting happens now when we start java
2024-03-29 11:03:16 +01:00
Andreas Dangel ede73fa4ce [core] Improve assertion messages for unreachable code paths 2024-03-29 08:59:37 +01:00
Andreas Dangel f31d50fd90 [core] Test access of package private impl methods of nodes
This is a test case for #4885, but doesn't reproduce
the problem.
2024-03-29 08:56:37 +01:00
Juan Martín Sotuyo Dodero 7fc083f348 Add test case for #2937 2024-03-27 16:24:46 -03:00
Clément Fournier 4ce9507a5a Fix #4569 forloopcanbeforeach FP with non-unit stride 2024-03-27 17:34:08 +01:00
Clément Fournier f345f2c735 cleanup 2024-03-27 12:46:26 +01:00
Clément Fournier 3efb468338 Merge branch 'master' into issue4435-unusedAssignment 2024-03-27 12:44:12 +01:00
han.li 427d0951c2 fix the error caused by space in JDK path 2024-03-27 17:48:43 +08:00
Juan Martín Sotuyo Dodero 86154aa160 Merge pull request #4890 from adangel/issue-4886-BigIntegerInstatiation-Java17
[java] Fix BigIntegerInstantiation for < Java 19
2024-03-25 16:42:25 -03:00
Andreas Dangel 76e18e8969 Merge pull request #4884 from Monits/issue-3845
[java] Compute literal expressions for InsufficientStringBufferDeclaration
2024-03-25 20:31:22 +01:00
Clément Fournier ac16be86e8 Merge branch 'master' into issue4435-unusedAssignment 2024-03-25 20:13:09 +01:00
Juan Martín Sotuyo Dodero 55b5d48586 Merge pull request #4875 from adangel/issue-4873-suppress-catch-parameter
[java] Consider ASTCatchParameter in AnnotationSuppressionUtil
2024-03-25 15:50:34 -03:00
Andreas Dangel ac21a1a8c5 [java] Fix BigIntegerInstantiation for < Java 19
Fixes #4886
2024-03-25 19:30:06 +01:00
Andreas Dangel 3580c2462b Add @Akromangel as a contributor 2024-03-25 19:27:17 +01:00
Andreas Dangel 917ef86a02 [java] AnnotationSuppressionUtil - check for Annotatable 2024-03-25 18:55:45 +01:00
Andreas Dangel 53bac02cf5 Merge branch 'master' into issue-4873-suppress-catch-parameter 2024-03-25 18:45:39 +01:00
Juan Martín Sotuyo Dodero a3dccb0940 Fix handling of constant String expressions 2024-03-25 14:29:57 -03:00
Juan Martín Sotuyo Dodero 2cb1641121 Just use getConstValue 2024-03-25 13:14:56 -03:00
Juan Martín Sotuyo Dodero c9a2dea7da Cleanup 2024-03-25 11:41:49 -03:00
Juan Martín Sotuyo Dodero cd5ce3255f Rework to allow for -1 as a valid value 2024-03-25 11:14:51 -03:00
Juan Martín Sotuyo Dodero d1b5e3ef7c Use -1 for unknown values 2024-03-25 09:12:02 -03:00
Juan Martín Sotuyo Dodero d1eb55741f Add test case for #3436 2024-03-25 00:44:12 -03:00
Juan Martín Sotuyo Dodero f20a51e5ae Add defauilt case 2024-03-25 00:34:16 -03:00
Juan Martín Sotuyo Dodero ff263e29a0 Update changelog, refs #3845 2024-03-25 00:11:19 -03:00
Juan Martín Sotuyo Dodero 6420c14fc5 Properly handle more int binary ops 2024-03-25 00:09:41 -03:00
Juan Martín Sotuyo Dodero 60c7ac6337 Add test case for #3845 2024-03-25 00:09:30 -03:00
Juan Martín Sotuyo Dodero 9d9d5d0a52 Merge pull request #4876 from adangel/issue-4847-new-string-char-array
[java] StringInstantiation - allow char[] constructor
2024-03-24 23:54:02 -03:00
Juan Martín Sotuyo Dodero ebee9f63b0 Merge branch 'master' into issue-4847-new-string-char-array 2024-03-24 19:45:53 -03:00
Juan Martín Sotuyo Dodero 5a362b3ff1 Merge pull request #4883 from adangel/issue-4881-ClassNamingConventions
[java] Fix ClassNamingConventions for dealing with abstract classes
2024-03-24 19:42:21 -03:00
Andreas Dangel fb496b9ee3 [java] Fix ClassNamingConventions for dealing with abstract classes
Fixes #4881
2024-03-24 16:16:40 +01:00
Andreas Dangel 6d4172bcfe Add @sdavids as a contributor 2024-03-24 16:15:58 +01:00
Andreas Dangel aa056b5d73 [java] Revert changes to AvoidCatchingGenericException 2024-03-24 15:46:52 +01:00
Andreas Dangel e95d9d79f4 [java] Fix AvoidCatchingGenericException for multi-catch 2024-03-22 19:46:05 +01:00
Andreas Dangel eda6bce015 [java] StringInstantiation - allow char[] constructor
Fixes #4874
2024-03-22 19:38:07 +01:00
Andreas Dangel 5670517396 [java] Consider ASTCatchParameter in AnnotationSuppressionUtil
Fixes #4873
2024-03-22 19:21:52 +01:00
Andreas Dangel be44a14f1e [ci] Release scripts improvements
- Fix missing SF_BLOG_URL value
- Let pmd/cpd run again
- Use latest build-tools scripts
- Remove release_notes_pmd7 handling
- Wait after pushing the tag before committing
  the changes for next development version
- more verification links

[skip ci]
2024-03-22 16:10:56 +01:00
Andreas Dangel a3e02e1c2a Bump build-tools from 23 to 24-SNAPSHOT 2024-03-22 12:20:15 +01:00
Andreas Dangel 1233d4e05a Use pmd 7.0.0 for own dogfood checks 2024-03-22 11:12:36 +01:00
Andreas Dangel a2d8918dbd [release] Prepare next development version [skip ci] 2024-03-22 09:35:44 +01:00
Erwan Moutymbo d1e400d24b remove unnecessary import 2024-03-22 09:30:21 +01:00
Andreas Dangel 7332d61515 [release] prepare for next development iteration 2024-03-22 09:28:44 +01:00
Andreas Dangel 7979570d39 [doc] Create empty class so that javadoc jar is created
This needs to be done to fulfill the requirement of maven
central, that every artefact has to have a javadoc jar.
However, pmd-doc only contains internal classes.
2024-03-22 09:12:17 +01:00
Andreas Dangel 0541ab8591 Revert "[release] prepare for next development iteration"
This reverts commit 27620724dc.
2024-03-22 09:01:47 +01:00
Andreas Dangel 27620724dc [release] prepare for next development iteration 2024-03-22 08:46:33 +01:00
Andreas Dangel 8704b85ffe [ci] Fix build.sh 2024-03-22 08:45:03 +01:00
Andreas Dangel 2e91f316f4 Revert "[release] prepare for next development iteration"
This reverts commit 0c7c038636.
2024-03-22 08:44:25 +01:00
Andreas Dangel 0c7c038636 [release] prepare for next development iteration 2024-03-22 08:36:51 +01:00
Andreas Dangel ccb123f1ff [release] prepare release pmd_releases/7.0.0 2024-03-22 08:36:44 +01:00
Andreas Dangel 32ef9d7488 Prepare pmd release 7.0.0 2024-03-22 08:17:21 +01:00
Andreas Dangel 097f45c294 [ci] Push to pmd.github.io only after the release 2024-03-22 08:02:52 +01:00
Clément Fournier eaaed0ecec Merge branch 'master' into parametrize-assert-methods 2024-03-21 20:14:56 +01:00
Clément Fournier 03c98413a4 Treat formal comments as normal comments for the purposes of @ContainsComment
Fix #3953
2024-03-21 19:54:05 +01:00
Clément Fournier e57d26b31a Add test for #1688 2024-03-21 19:24:53 +01:00
Clément Fournier 2d5000a6c3 Add tests for #3353 2024-03-21 19:21:42 +01:00
Clément Fournier 8c4eb75110 Add tests 2024-03-21 19:13:15 +01:00
Clément Fournier 29affeedc4 Remove unnecessary property declarations 2024-03-21 19:04:38 +01:00
Clément Fournier 2639643e40 Remove unnecessary test 2024-03-21 19:03:33 +01:00
Clément Fournier 03407db09e Use set properties instead 2024-03-21 18:14:55 +01:00
Juan Martín Sotuyo Dodero 4cb9607c4f Add test case for #4114 2024-03-21 13:04:05 -03:00
Andreas Dangel baa7e3d8be [core] Fix CodeClimateRendererTest for releases 2024-03-21 14:31:12 +01:00
Andreas Dangel fb2516bc7f [ci] Fix do-release.sh for scm info modification 2024-03-21 14:31:07 +01:00
Andreas Dangel 8d08747cb5 [ci] release script fixes
- Make sure, BUILD_CLI_DIST_ONLY is set
- run builds on other os than linux for release builds
  depending on BUILD_CLI_DIST_ONLY
- generate site only once during release builds
2024-03-21 12:23:24 +01:00
Andreas Dangel dccc739182 [ci] Remove build support for experimental-apex-parser
This branch is gone and has been merge
2024-03-21 11:49:05 +01:00
Andreas Dangel 35861c7102 Bump build-tools from 23-SNAPSHOT to 23 2024-03-21 11:12:17 +01:00
Andreas Dangel ba63a16d4c [doc] Fix styling for details sections
using parse_block_html:true destroyed shuffle_panel on index.md...
2024-03-21 11:12:17 +01:00
Andreas Dangel 40d7bad89b Add @wangzitom12306 as a contributor 2024-03-21 11:12:17 +01:00
Andreas Dangel 73952508cc [dist] Make mvnw executable in source dist zip
Fixes #4867
2024-03-21 11:12:16 +01:00
Erwan Moutymbo 42f78b603b [Java] add extra assert method names to Junit rules 2024-03-20 12:17:34 +01:00
Juan Martín Sotuyo Dodero 8df40cccf5 Add test case for #2534 2024-03-19 13:14:56 -03:00
Andreas Dangel 307598e602 Merge pull request #4841 from adangel:issue-4817-UnusedPrivateMethod
[java] UnusedPrivateMethod - fix false positive with lambdas #4841
2024-03-18 19:30:04 +01:00
Andreas Dangel 3d74e40e66 Merge pull request #4848 from adangel:issue-4828-apex-null-coalescing
[apex] Add support for null coalescing operator (apex 60) #4848
2024-03-18 19:27:01 +01:00
Andreas Dangel 646549c610 Update release notes - external contributions 2024-03-18 19:24:38 +01:00
Andreas Dangel b7365cdb4a Update SPONSORS.md 2024-03-18 19:18:56 +01:00
Andreas Dangel bc29fa671b Add @flxbl-io as a contributor 2024-03-18 19:15:47 +01:00
Andreas Dangel cbc9d79ce7 Add @screamingfrog as a contributor 2024-03-18 19:14:59 +01:00
Juan Martín Sotuyo Dodero a26717533c Add test case for #4277 2024-03-18 00:27:43 -03:00
Juan Martín Sotuyo Dodero 6be72b2795 Add test case for #3802 2024-03-18 00:27:43 -03:00
Juan Martín Sotuyo Dodero e7ec34ee65 Add test case for #3627 2024-03-18 00:27:43 -03:00
Juan Martín Sotuyo Dodero 07850f3423 Add test case for #3467 2024-03-18 00:27:43 -03:00
Juan Martín Sotuyo Dodero 5a614bcfb5 Add test case for #1081 2024-03-18 00:27:43 -03:00
Juan Martín Sotuyo Dodero d0f8383c3e Add test case for #935 2024-03-18 00:27:43 -03:00
Juan Martín Sotuyo Dodero 37d352b3c1 Add test case for #1316 2024-03-18 00:27:43 -03:00
Juan Martín Sotuyo Dodero c084e54c58 Add test case for #3430 2024-03-18 00:27:43 -03:00
Juan Martín Sotuyo Dodero e2eda6cec7 Add test case for #2710 2024-03-18 00:27:43 -03:00
Juan Martín Sotuyo Dodero 033f556006 Add test case for #3626 2024-03-18 00:27:43 -03:00
Andreas Dangel 90ecae91b7 Merge branch 'master' into issue-4817-UnusedPrivateMethod 2024-03-15 18:39:08 +01:00
Andreas Dangel 1b02df40a0 Merge branch 'master' into issue-4828-apex-null-coalescing 2024-03-15 18:35:59 +01:00
Juan Martín Sotuyo Dodero 7d9dc2fcb6 Merge pull request #4859 from adangel/doc-release-notes-7
[doc] Doc release notes 7
2024-03-15 13:46:18 -03:00
Juan Martín Sotuyo Dodero 4ce5cc824a Merge branch 'master' into doc-release-notes-7 2024-03-15 13:45:08 -03:00
Andreas Dangel 2d3ab86412 [doc] Update Apex info - user mode database operations 2024-03-15 14:34:03 +01:00
Andreas Dangel b79518191d Merge pull request #4752 from 219sansim:fix_flaky_LatticeRelation
[core] Fix flaky LatticeRelationTest #4752
2024-03-15 13:46:21 +01:00
Andreas Dangel 7318b61423 [doc] Update release notes (#4752) 2024-03-15 13:44:59 +01:00
Andreas DangelandClément Fournier 3237f13d92 Update pmd-core/src/main/java/net/sourceforge/pmd/util/GraphUtil.java
Co-authored-by: Clément Fournier <clem.fournier@proton.me>
2024-03-15 13:40:45 +01:00
Andreas Dangel d96c60b663 Merge pull request #4857 from oleksandr-shvets:UnnecessaryBlock-issues
[javascript] Fix UnnecessaryBlock issues with empty statements #4857
2024-03-14 20:48:02 +01:00
Andreas Dangel 8a4d74a142 Merge pull request #4562 from nwcm:patch-2
[apex] Fixes #4556 - Update Apex bind regex match for all possible combinations #4562
2024-03-14 20:46:54 +01:00
Andreas Dangel dcc85136eb [doc] Update release notes (#4857, #2305) 2024-03-14 20:43:45 +01:00
Andreas Dangel 55b3a418ce Add @oleksandr-shvets as a contributor 2024-03-14 20:40:36 +01:00
Andreas Dangel c3ec240794 [javascript] Simplify UnnecessaryBlock rule, update tests 2024-03-14 20:39:56 +01:00
Andreas Dangel ff2ebf5026 Merge branch 'master' into pr-4857 2024-03-14 20:24:31 +01:00
Andreas Dangel 3156b88abe [doc] Update release notes (#4562, #4556) 2024-03-14 20:19:34 +01:00
Andreas Dangel 4e5ef6ba59 Update @nwcm as a contributor 2024-03-14 20:18:10 +01:00
Andreas Dangel 88d63a8ca4 [apex] UnusedLocalVariable - add test cases for #4556 2024-03-14 20:16:02 +01:00
Andreas Dangel ffb92231fe Merge branch 'master' into pr-4562 2024-03-14 20:13:52 +01:00
Andreas Dangel cddadf5532 Fix integration test (new apex version 60) 2024-03-14 18:30:58 +01:00
Andreas Dangel 576c83fa83 [apex] Bump apex-link from 2.3.5 to 2.3.7 2024-03-14 18:06:14 +01:00
Andreas Dangel 0fc4dceda7 [apex] Bump summit-ast from 2.1.1 to 2.2.0 2024-03-14 18:04:46 +01:00
Andreas Dangel 89f6ca6bd7 Merge branch 'master' into issue-4828-apex-null-coalescing 2024-03-14 18:02:33 +01:00
Andreas Dangel 274497bbf4 [doc] Fix more external links 2024-03-14 16:53:48 +01:00
Andreas Dangel 9f862f9ac9 [doc] Fail doc generation for invalid jdoc links 2024-03-14 14:33:06 +01:00
Andreas Dangel b739a8c412 Merge branch 'master' into doc-release-notes-7 2024-03-14 13:42:47 +01:00
Andreas Dangel 17481f6b70 [doc] Replace jdoc tags in release_notes_pmd7 during release 2024-03-14 13:38:59 +01:00
Andreas Dangel 7668fe23d0 [doc] Prerender includes in release notes 2024-03-14 13:32:33 +01:00
Andreas Dangel d54b8b3e8f [core] Internalize deprecated default ctor of XPathRule 2024-03-14 12:31:16 +01:00
Andreas Dangel adef8c29d5 [doc] Review links in release notes
Replace links with fixed urls
2024-03-14 12:30:31 +01:00
Andreas Dangel fb90ba3e38 [doc] Review links in release notes
Replace links with fixed urls
2024-03-12 20:20:27 +01:00
Andreas Dangel 2dc91b3de5 Update gems
Add bigdecimal and csv module, to be ruby 3.4 ready
2024-03-12 19:33:10 +01:00
Andreas Dangel 873dea97ff [doc] Review links in release notes
- fix javadoc links
2024-03-12 19:28:40 +01:00
Juan Martín Sotuyo Dodero cca5c9cb6c Cleanups
- remove TODO
 - ensure listeners are called if we tried to solve
2024-03-11 14:39:20 -03:00
Andreas Dangel 10aba575fa [doc] Review links in release notes
- fix javadoc links
2024-03-11 18:18:57 +01:00
Andreas Dangel afaa198237 [doc] Add tag jdoc_package_old 2024-03-11 17:50:27 +01:00
Clément Fournier ebfd02584d Update AST dump references 2024-03-11 17:44:34 +01:00
Clément Fournier fa60d0e8a7 fix merge
Add back isStatic and isFinal on some nodes for convenience
2024-03-11 17:40:21 +01:00
Clément Fournier 0034fb5f57 Merge branch 'master' into issue4435-unusedAssignment 2024-03-11 17:34:03 +01:00
Juan Martín Sotuyo Dodero 7bdc0b2f3d Merge pull request #4834 from adangel/issue-4757-npe
[java] Fix intermittent NPE ClassSub.enclosingInfo is null
2024-03-10 22:52:31 -03:00
Juan Martín Sotuyo Dodero e7ee97a3e5 Merge branch 'master' into issue-4757-npe 2024-03-10 22:52:15 -03:00
Andreas Dangel eb631b987d [doc] Review links in release notes and doc pages
- fix javadoc to find Kotlin files
- fix formatting for language info box
- fix tocmaker link generator
2024-03-10 20:21:01 +01:00
Oleksandr Shvets 3c0aea6c52 rewrite xpath rule and add some test cases 2024-03-10 18:08:07 +02:00
Andreas Dangel d1ef7c728c [doc] Review release notes
- make sure, everything is mentioned in both files
- unify formatting
- combine java 21/22 changes
- sort language related changes alphabetically
2024-03-10 16:16:26 +01:00
Juan Martín Sotuyo Dodero a62ac41403 Remove unsued imports 2024-03-10 01:42:50 -03:00
Juan Martín Sotuyo Dodero da9ce6ba65 Remove no longer needed workaround
- The inference now works for this case
2024-03-10 01:38:28 -03:00
Juan Martín Sotuyo Dodero 3d8c4fce84 Rework inference to more closely match the JLS
- This should fix some inference errors
2024-03-10 01:37:36 -03:00
Juan Martín Sotuyo Dodero faf3d65520 Fix param name 2024-03-10 01:37:16 -03:00
Oleksandr Shvets 0ec6a4f770 simplify UnnecessaryBlock xpath rule 2024-03-09 23:38:37 +02:00
Sashko 3b9dcc0f2f Revert completly Java test 2024-03-09 23:38:37 +02:00
Andreas Dangel 708c8f14c6 [doc] Rework release notes
- move more details into release_notes_pmd7.md
- sort sections alphabetically (in language related changes)
2024-03-09 19:57:39 +01:00
Andreas Dangel 8cc2d291da [core] Fix unused import 2024-03-09 10:21:16 +01:00
Andreas Dangel f758571ca7 [ci] Update sonar call
sonar.login is deprecated, use sonar.token
2024-03-09 10:20:53 +01:00
Andreas Dangel 81a24f6f8f [doc] Update release notes - Short summary and details
- fix render_release_notes.rb for ruby 3
- allow markdown in details blocks
- fix tocmaker
2024-03-08 20:20:46 +01:00
Andreas Dangel 65d4d26dbf [doc] Update release notes - API Changes
- Move API changes already to pmd7 release notes
2024-03-08 18:55:32 +01:00
Andreas Dangel 7ca8229dd7 [doc] Update release notes
- remove release candidate info box
- unify "Updated PMD Designer" sections
- remove apex jorje update
- unify "Changed: Apex ..." sections
- add missing Java 22 section
2024-03-08 17:15:38 +01:00
Andreas Dangel 54770b075a [java] Improve documentation about auxClasspath 2024-03-08 16:48:21 +01:00
Andreas Dangel 806a9720b8 Merge pull request #4855 from adangel:javadoc-doclint
Fix javadoc syntax errors (doclint) #4855
2024-03-08 09:38:28 +01:00
Andreas Dangel 48dcafd5fd [doc] Mention designer changes in release notes
- Refs pmd/pmd-designer#54
- Refs pmd/pmd-designer#65
2024-03-08 09:37:26 +01:00
Andreas Dangel ec0bfd1c4c Fix more javadoc errors
These worked with Java 21, but not with Java 11.
2024-03-08 08:53:02 +01:00
Andreas Dangel 1b53d71a19 Enable doclint and fail build on javadoc errors 2024-03-07 21:18:46 +01:00
Andreas Dangel 8758dbb85c [compat6] Fix javadoc errors 2024-03-07 21:18:00 +01:00
Andreas Dangel c02165c880 [xml] Fix javadoc errors 2024-03-07 21:10:08 +01:00
Andreas Dangel 180820238e [plsql] Fix javadoc errors 2024-03-07 21:04:12 +01:00
Andreas Dangel 3e4cb1b4b0 Fix javadoc of generated antlr4 classes 2024-03-07 20:55:22 +01:00
Andreas Dangel 2585068f2c [java] Fix javadoc errors 2024-03-07 20:30:07 +01:00
Andreas Dangel 7badd49c05 [core] Fix javadoc errors 2024-03-07 19:53:18 +01:00
Andreas Dangel 1492c7cf78 Merge pull request #4854 from adangel/update-dependencies
Update various dependencies
2024-03-07 16:51:14 +01:00
Andreas Dangel f42428b1c1 Revert "Bump progressbar from 0.9.5 to 0.10.0"
This reverts commit 996bd3fb5b.
2024-03-07 12:26:10 +01:00
Andreas Dangel 84af109823 [ci] Skip pmd/cpd during release builds to avoid failures
Refs #4757
2024-03-07 12:20:02 +01:00
Andreas Dangel e9a004e8dd javacc-wrapper: Avoid replace for non existent parser files
This avoids errors like
[ERROR] [replaceregexp] The following file is missing: '.../pmd/pmd-javascript/target/generated-sources/javacc/net/sourceforge/pmd/lang/ecmascript5/ast/Ecmascript5ParserImpl.java'
2024-03-07 12:01:57 +01:00
Andreas Dangel 92fd84fc38 Remove duplicated dependency of guava 2024-03-07 11:47:06 +01:00
Andreas Dangel b2ed833b66 Bump commons-logging from 1.2 to 1.3.0 2024-03-07 11:41:40 +01:00
Andreas Dangel e76d2a021c [java] Fix JUnitTestsShouldIncludeAssert after assertj upgrade 2024-03-07 11:41:40 +01:00
Andreas Dangel 6323dfb15f Bump assertj-core from 3.11.0 to 3.25.3 2024-03-07 11:41:40 +01:00
Andreas Dangel 38d6927589 Bump log4j from 2.17.1 to 2.23.0 2024-03-07 11:41:39 +01:00
Andreas Dangel 7eb9dbeb03 Bump jsoup from 1.15.3 to 1.17.2 2024-03-07 11:41:39 +01:00
Andreas Dangel 23e227786b [scala] Fix tests after scala upgrade 2024-03-07 11:41:39 +01:00
Andreas Dangel 1583a3b1e2 Bump scala-library from 2.13.12 to 2.13.13 2024-03-07 11:41:38 +01:00
Andreas Dangel ac9d7789a0 Bump scala-library from 2.12.18 to 2.12.19 2024-03-07 11:41:38 +01:00
Andreas Dangel c8354518f7 Bump scalameta from 4.8.11 to 4.9.1 2024-03-07 11:41:38 +01:00
Andreas Dangel ad9e4649c8 Move nice-xml-messages to dependency management 2024-03-07 11:41:38 +01:00
Andreas Dangel abae565fd4 Bump junit4 from 4.13.1 to 4.13.2 2024-03-07 11:41:37 +01:00
Andreas Dangel 3b2973c83f Bump protobuf-java from 3.16.3 to 3.25.3 2024-03-07 11:41:37 +01:00
Andreas Dangel 4616ab386f Bump jetbrains annotations from 13.0 to 24.1.0 2024-03-07 11:41:37 +01:00
Andreas Dangel d38a676651 Bump byte-buddy from 1.14.9 to 1.14.12 2024-03-07 11:41:36 +01:00
Andreas Dangel 2a7b427b2b Bump junit-platform-suite from 1.9.0-M1 to 1.10.2 2024-03-07 11:41:36 +01:00
Andreas Dangel be33a964d0 Bump scala-reflect and scala-library from 2.13.12 to 2.13.13
Used by apexlink
2024-03-07 11:41:15 +01:00
Andreas Dangel bc29e6b7f9 Bump gson from 2.8.9 to 2.10.1 2024-03-07 11:39:43 +01:00
Andreas Dangel 07740f1792 Bump groovy from 4.0.15 to 4.0.19 2024-03-07 11:39:43 +01:00
Andreas Dangel 737672deb1 Bump commons-text from 1.3 to 1.11.0 2024-03-07 11:39:43 +01:00
Andreas Dangel 961fae6d14 Bump commons-lang3 from 3.8.1 to 3.14.0 2024-03-07 11:39:42 +01:00
Andreas Dangel 90c08d4790 Bump checker-qual from 2.5.2 to 2.11.1 2024-03-07 11:39:42 +01:00
Andreas Dangel 9df7eca80e Bump pcollections from 3.1.3 to 3.2.0 2024-03-07 11:39:42 +01:00
Andreas Dangel 996bd3fb5b Bump progressbar from 0.9.5 to 0.10.0 2024-03-07 11:39:42 +01:00
Andreas Dangel 95d389245c Bump picocli from 4.7.0 to 4.7.5 2024-03-07 11:39:41 +01:00
Andreas Dangel 6ab2ba8d96 Bump saxon-HE from 10.7 to 10.9
Remove old saxon
2024-03-07 11:39:41 +01:00
Andreas Dangel a64b4dc1db Bump antlr4 from 4.9.1 to 4.9.3 2024-03-07 11:39:41 +01:00
Andreas Dangel f6d3242510 Bump ant from 1.10.13 to 1.10.14 2024-03-07 11:39:33 +01:00
Andreas Dangel 28d56c35be Upgrade various maven plugins
maven-surefire-plugin: 3.0.0-M8 -> 3.2.5
checkstyle: 10.7.0 -> 10.14.0
maven-javadoc-plugin: 3.4.1 -> 3.6.3
maven-assembly-plugin: 3.5.0 -> 3.6.0
maven-dependency-plugin: 3.5.0 -> 3.6.1
maven-release-plugin: 3.0.0-M7 -> 3.0.1
maven-clean-plugin: 3.2.0 -> 3.3.2
build-helper-maven-plugin: 3.3.0 -> 3.5.0
maven-compiler-plugin: 3.10.1 -> 3.12.1
maven-deploy-plugin: 3.1.0 -> 3.1.1
maven-install-plugin: 3.1.0 -> 3.1.1
maven-resources-plugin: 3.3.0 -> 3.3.1
maven-shade-plugin: 3.4.1 -> 3.5.2
exec-maven-plugin: 3.1.0 -> 3.2.0
maven-source-plugin: 3.2.1 -> 3.3.0
maven-enforcer-plugin: 3.2.1 -> 3.4.1
maven-site-plugin: 4.0.0-M4 -> 4.0.0-M13
versions-maven-plugin: 2.14.2 -> 2.16.2
cyclonedx-maven-plugin: 2.7.9 -> 2.7.11
maven-gpg-plugin: 3.0.1 -> 3.1.0
2024-03-07 09:01:11 +01:00
Andreas Dangel c4262bc592 Bump maven from 3.9.4 to 3.9.6 2024-03-07 08:42:04 +01:00
Andreas Dangel a69068de2d [compat6] Mark pmd-compat6 module as deprecated 2024-03-07 08:27:12 +01:00
Juan Martín Sotuyo Dodero daa741c817 Merge pull request #4843 from adangel/cli-banner-display
[cli] Display pmd banner, version improvement, logging
2024-03-05 16:57:31 -03:00
Juan Martín Sotuyo Dodero 31b3398024 Merge pull request #4847 from adangel/cleanup-todos
Cleanup some TODOs
2024-03-05 16:25:06 -03:00
Andreas Dangel 434d136d41 [doc] Update pmd-demo.gif 2024-03-05 20:12:01 +01:00
Andreas Dangel 754400ef2c [cli] Don't show PMD banner+version for every command
Only when calling "--version"
2024-03-05 19:42:35 +01:00
Andreas Dangel 079a13ec4b Merge branch 'master' into cli-banner-display 2024-03-05 19:40:48 +01:00
Andreas DangelandJuan Martín Sotuyo Dodero a8c539eddb [test-schema] Fix trim indentation for test codes
Co-authored-by: Juan Martín Sotuyo Dodero <juansotuyo@gmail.com>
2024-03-05 19:10:20 +01:00
Andreas Dangel dffc44ecde Merge branch 'master' into cleanup-todos 2024-03-05 18:53:49 +01:00
Andreas Dangel 451f719884 Merge pull request #4831 from adangel:issue-4830-consolidate-packages
Consolidate packages in each maven module #4831
2024-03-04 19:46:56 +01:00
Andreas Dangel b64489a515 Merge branch 'master' into issue-4830-consolidate-packages 2024-03-04 19:21:16 +01:00
Andreas Dangel 49bc53590b Merge pull request #4824 from adangel:issue-4794-java-22
[java] Support JDK 22 #4824
2024-03-04 19:09:37 +01:00
Andreas Dangel 6593a902d0 [java] Fix AstTreeDumpTests after merge
MethodDeclaration doesn't have @Image attribute anymore.
2024-03-04 18:50:11 +01:00
Andreas Dangel 93bf4d59cd Merge branch 'master' into issue-4794-java-22 2024-03-04 18:28:35 +01:00
Juan Martín Sotuyo Dodero 04c2c0106d Merge pull request #4823 from adangel/rename-pmd-designer
Update to use renamed pmd-designer
2024-03-03 16:35:19 -05:00
Juan Martín Sotuyo Dodero 2b37fbe9ba Merge branch 'master' into rename-pmd-designer 2024-03-03 16:35:11 -05:00
Juan Martín Sotuyo Dodero 82db75bedf Merge pull request #4801 from adangel/issue-932-SingletonClassReturningNewInstance
[java] SingletonClassReturningNewInstance - fix double assignment case
2024-03-03 16:32:50 -05:00
Juan Martín Sotuyo Dodero 5ee8176b27 Merge pull request #4827 from adangel/compat6-improvements
[compat6] Support config errors and cpd for csharp
2024-03-03 16:29:58 -05:00
Juan Martín Sotuyo Dodero ab29eba3f9 Merge branch 'master' into compat6-improvements 2024-03-03 16:29:51 -05:00
Juan Martín Sotuyo Dodero a9baf48c4d Merge pull request #4851 from adangel/core-nodestream-test
[core] NodeStreamBlanketTest - prefilter the test data
2024-03-01 13:36:09 -05:00
Juan Martín Sotuyo Dodero d64ac4bdfe Merge pull request #4850 from adangel/fix-kotlin-compiler-warnings
Fix kotlin compiler warnings
2024-03-01 11:54:59 -05:00
Juan Martín Sotuyo Dodero 577f830941 Merge pull request #4849 from adangel/fix-npe-analysiscache
[core] Fix NPE in AbstractAnalysisCache in case of processing errors
2024-03-01 11:18:40 -05:00
Andreas Dangel dc92c64135 [core] NodeStreamBlanketTest - prefilter the test data
in order to avoid many ignored unit tests.
E.g. before this change, we had:

Tests passed: 5,417, ignored: 2,539 of 7,956 tests
meaning about 30% of the tests were ignored.
2024-03-01 17:06:58 +01:00
Andreas Dangel cc3da7b21e Fix kotlin compiler warnings 2024-03-01 16:55:01 +01:00
Andreas Dangel 5e277c8211 [core] Fix NPE in AbstractAnalysisCache in case of processing errors 2024-03-01 14:50:35 +01:00
Andreas Dangel 150c0c88a4 [apex] Update doc about apex parser [skip ci] 2024-03-01 14:37:17 +01:00
Andreas Dangel 55a0988e19 [apex] Remove AntlrVersionCheckSuppression
This is not needed anymore with the new Summit AST
which uses the updated apex-parser

Fixes #4845
2024-03-01 14:21:43 +01:00
Andreas Dangel 98bac9a30f Add @vctqs1 as a contributor 2024-03-01 14:14:52 +01:00
Andreas Dangel 51be813cd7 [apex] Support Apex 60, Null Coalescing operator
Fixes #4828
2024-03-01 13:36:42 +01:00
Andreas Dangel a96b6016af [apex] Verify ApexDoc with annotated classes
Fixes #4774
2024-03-01 12:47:15 +01:00
Andreas Dangel a24bc9be1a Add @liqingjun123 as a contributor 2024-03-01 12:45:02 +01:00
Andreas Dangel ab0d740d81 Cleanup some TODOs 2024-03-01 12:07:48 +01:00
Andreas Dangel 5b84459368 [doc] Update pmd-demo.gif 2024-03-01 08:29:30 +01:00
Andreas Dangel aa672e9d0e [cli] Remove unnecessary logging 2024-02-29 20:49:33 +01:00
Andreas Dangel c2a215d7b5 [cli] Display a PMD banner and more detailed version info
Generated via https://www.asciiart.eu/image-to-ascii
from docs/images/logo/pmd-logo-300px.png
2024-02-29 18:47:29 +01:00
Andreas Dangel 80db40b6a2 [core] Include revision and build time in PMDVersion
- Using git-commit-id-maven-plugin
- Adding the version via an explicit property file
  and resource filtering
- For snapshots, it will be the git commit timestamp
- For release, it will be the release timestamp
2024-02-29 18:42:44 +01:00
Juan Martín Sotuyo Dodero 642716fabf Merge pull request #4833 from adangel/issue-4704-doc-multivalued-props
[doc] Fix configuring rule docu for multivalues properties
2024-02-29 09:01:11 -05:00
Juan Martín Sotuyo Dodero 08b16d9555 Merge pull request #4836 from adangel/remove-deprecated-rule-props
Remove deprecated rule props
2024-02-29 09:00:16 -05:00
Juan Martín Sotuyo Dodero 3b9ee96840 Merge pull request #4838 from adangel/fix-javadoc-config
Fix javadoc/dokka configuration
2024-02-29 08:59:48 -05:00
Andreas Dangel 9248b55d12 Merge branch 'master' into issue-4817-UnusedPrivateMethod 2024-02-29 14:56:49 +01:00
Juan Martín Sotuyo Dodero 35c34785a0 Merge pull request #4840 from adangel/issue-4816-UnnecessaryImport
[java] UnnecessaryImport - keep analyzing with failed overload selection
2024-02-29 08:44:07 -05:00
Juan Martín Sotuyo Dodero f90d222ed1 Merge pull request #4839 from adangel/issue-4603-UnusedAssignment-records
[java] UnusedAssignment false positive in record compact constructor
2024-02-29 08:41:53 -05:00
Andreas Dangel dc3a473baa [java] UnusedPrivateMethod - fix false positive with lambdas
Fixes #4817
2024-02-29 14:35:04 +01:00
Andreas Dangel ef18609309 [java] UnnecessaryImport - keep analyzing with failed overload selection
Fixes #4816
2024-02-29 13:33:04 +01:00
Andreas Dangel f0cbbddcfc [java] UnusedAssignment false positive in record compact constructor
Fixes #4603
2024-02-29 10:06:27 +01:00
Andreas Dangel 3b0dd7a82b Add @enexusde as a contributor 2024-02-29 08:58:22 +01:00
Andreas Dangel 87f2241f3a [java] Verify UnnecessaryLocalBeforeReturn #4239
Fixes #4239
2024-02-29 08:51:13 +01:00
Andreas Dangel ce8ca0652d [java] Verify UnusedPrivateMethod #4625
Fixes #4625
2024-02-29 08:40:22 +01:00
Andreas Dangel 2b70986f09 [java] Verify UnnecessaryFullyQualifiedName #4631
Fixes #4631
2024-02-29 08:37:01 +01:00
Andreas Dangel b036931995 Fix javadoc/dokka configuration 2024-02-27 19:49:23 +01:00
Andreas Dangel f5d3c737f9 [java] NonSerializableClass: Remove property prefix
This property has been deprecated since PMD 6.52.0
2024-02-26 19:58:34 +01:00
Andreas Dangel 504fc3e967 [java] CommentRequired: Remove property headerCommentRequirement
This property has been deprecated since PMD 6.21.0
2024-02-26 19:58:19 +01:00
Andreas Dangel fb4f4888c9 [doc] Fix release notes, add missing change in EmptyControlStatement
Refs #4754
2024-02-26 19:26:45 +01:00
Andreas Dangel 53323de951 [apex] MethodNamingConventions: Remove prop skipTestMethodUnderscores
This property was deprecated since PMD 6.15.0.
2024-02-26 19:25:56 +01:00
Andreas Dangel cf124350ec [doc] Update release notes (#4757) 2024-02-25 16:41:34 +01:00
Andreas Dangel 6b454deb43 [java] Improve logging in ParseLock in case of failure 2024-02-25 16:40:25 +01:00
Andreas Dangel a8c41a5096 [java] Fix intermittent NPE ClassSub.enclosingInfo is null
Refs #4757
2024-02-24 21:09:57 +01:00
Andreas Dangel 9adf12f7be [doc] Fix configuring rule docu for multivalues properties
Fixes #4704
2024-02-23 21:15:04 +01:00
Andreas Dangel 689a7d5a28 [doc] Update release notes, fixes #4830 2024-02-23 17:47:59 +01:00
Andreas Dangel f49f25f0e1 Rename lang-terse-name to lang-id 2024-02-23 17:46:39 +01:00
Andreas Dangel 7813f544e3 [doc] Fix rule doc generation and dead links
- previous existing rule docs will be deleted now
2024-02-23 17:46:39 +01:00
Andreas Dangel 1aa6112aae [velocity] Rename package and language id from vm to velocity
Also change prefix from Vm to Vtl
2024-02-23 17:46:32 +01:00
Andreas Dangel d21e5c95d0 [visualforce] Rename package and language id from vf to visualforce 2024-02-23 17:46:31 +01:00
Andreas Dangel 4bee79712a [visualforce] Consolidate test packages 2024-02-23 17:46:31 +01:00
Andreas Dangel 80b1436277 [plsql] Consolidate test packages 2024-02-23 17:46:31 +01:00
Andreas Dangel 5f6d357fc3 [jsp] Consolidate test packages 2024-02-23 17:46:30 +01:00
Andreas Dangel 36cfde4735 [javascript] Consolidate test packages 2024-02-23 17:46:30 +01:00
Andreas Dangel a00916b4f0 [java] Consolidate test packages 2024-02-23 17:46:30 +01:00
Andreas Dangel 194f759533 [dist] Move test classes into correct package 2024-02-23 17:46:30 +01:00
Andreas Dangel 414c119be1 [apex] Move metrics tests into internal package 2024-02-23 17:46:29 +01:00
Andreas Dangel 9d5e229704 [core] Consolidate test packages
Fix CpdAnalysisTest
Add test cases of PMDFilelistTest into FileCollectorTest
Moved ZipFileTest as FileCollectorZipTest
Remove unnecessary test resources
2024-02-23 17:46:29 +01:00
Andreas Dangel 845154716c [test] Consolidate packages, move PmdRuleTst, SimpleAggregatorTst 2024-02-23 17:46:29 +01:00
Andreas Dangel 5c5456a6bf [xml] Consolidate packages for Pom, Wsdl, Xsl language modules 2024-02-23 17:46:28 +01:00
Andreas Dangel 9c5cef2566 [scala] Remove deprecated module pmd-scala, consolidate packages 2024-02-23 17:46:28 +01:00
Andreas Dangel 3a7460de29 [lang-test] Move classes into n.s.p.lang.test 2024-02-23 17:46:23 +01:00
Andreas Dangel 45d2a6935e [doc] Internalize all classes in pmd-doc 2024-02-23 11:34:35 +01:00
Andreas Dangel 95870ffa58 [html] Move HtmlCpdLexer 2024-02-23 11:24:49 +01:00
Andreas Dangel ce347bd736 Fix coveralls integration 2024-02-23 10:56:30 +01:00
Andreas Dangel 7069e6146c Simplify kotlin compiler configuration 2024-02-23 10:50:58 +01:00
Andreas Dangel 44e299945d Bump maven-checkstyle-plugin from 3.2.1 to 3.3.1 2024-02-23 10:27:33 +01:00
Andreas Dangel 621cd0e013 Update to use renamed pmd-designer
See pmd/pmd-designer#80
2024-02-22 19:13:10 +01:00
Andreas Dangel f9d9ac63a4 Merge pull request #4806 from experimental-apex-parser
[apex] Use apex-parser and Summit AST #4806
2024-02-22 19:11:00 +01:00
Andreas Dangel 3b5149eb86 [dist] Remove now unnecessary exclude for apex-jorje 2024-02-22 18:48:06 +01:00
Andreas Dangel e6c9d71f7b [apex] Fix compile errors after merge 2024-02-22 18:45:50 +01:00
Andreas Dangel 3a7b570df0 Merge branch 'master' into experimental-apex-parser 2024-02-22 18:38:17 +01:00
Andreas Dangel 9e71e36ab1 Merge pull request #4811 from adangel:issue-4349-cleanup-deprecations
Cleanup remaining experimental and deprecated API #4811
2024-02-22 17:08:51 +01:00
Andreas Dangel 609e364861 Merge pull request #4809 from adangel:issue-4348-internal-api
[core] Consolidate @InternalApi classes #4809
2024-02-22 17:03:03 +01:00
Andreas Dangel bd9fa30cf3 [dist] Bump commons-compress from 1.21 to 1.26.0
Fixes https://github.com/pmd/pmd/security/dependabot/51
Fixes CVE-2024-26308
Fixes https://github.com/advisories/GHSA-4265-ccf5-phj5
2024-02-22 14:05:49 +01:00
Andreas Dangel 8adc11964d [ci] Fix upload of sbom after rename 2024-02-22 14:03:42 +01:00
Andreas Dangel 474274e129 [dist] Remove unnecessary exclusion for pmd-cli:sh:completion
Note: java and javascript are needed for tests in cli

Refs #4594
2024-02-22 13:00:04 +01:00
Andreas Dangel decb759a8f [dist] Make SBOM optional in assembly descriptor
fix dist sbom
2024-02-22 12:59:56 +01:00
Andreas Dangel db02f357c5 [doc] Update maven doc, include PMD 7 usage, remove maven1 2024-02-22 11:54:14 +01:00
Andreas Dangel d6c282bfba [doc] Update migration guide for XML Report Format changes 2024-02-22 11:40:10 +01:00
Sashko b01d630e2e revert UnnecessaryBlockTest.java 2024-02-22 01:48:03 +02:00
Sashko 8350de911a fix UnnecessaryBlock 2024-02-21 23:38:17 +00:00
Sashko df55c44499 add jdestructure assigments test 2024-02-21 23:38:17 +00:00
Sashko a015835756 Update UnnecessaryBlockTest.java 2024-02-21 23:06:20 +02:00
Sashko e5247d1703 do not apply UnnecessaryBlock for the ECMAScript6 destructuring variable declarations 2024-02-21 22:19:53 +02:00
Andreas Dangel f2aedc86e5 [doc] Update release notes (#4827) 2024-02-18 09:15:11 +01:00
Andreas Dangel 3dd4ace643 [compat6] add dependency to pmd-cs 2024-02-18 09:13:04 +01:00
Andreas Dangel b223b1a672 [compat6] Support other cpd languages like cs 2024-02-17 18:43:42 +01:00
Andreas Dangel 0f7dff6909 [compat6] Support configuration errors 2024-02-17 18:43:30 +01:00
Andreas Dangel d23395a440 Merge pull request #4825 from lbovet:master
[plsql] Fix ignored WITH clause for SELECT INTO statements #4825
2024-02-16 08:50:15 +01:00
Andreas Dangel a481a062fe [doc] Update release notes (#4820, #4825) 2024-02-16 08:49:34 +01:00
Andreas Dangel 81206f2ee3 Add @lbovet as a contributor 2024-02-16 08:48:42 +01:00
Andreas Dangel 019039c606 Merge pull request #4776 from adangel:issue-4776-ruby3
[ci] Upgrade to ruby 3 #4826
2024-02-16 08:27:35 +01:00
Andreas Dangel e002b161e5 [ci] Use regular PMD_CI_SCRIPTS_URL 2024-02-16 08:24:49 +01:00
Andreas Dangel 828bcaa89b Fix Dangerfile 2024-02-15 21:25:08 +01:00
Andreas Dangel 04509a9fba Make sure, ruby and bundler are available 2024-02-15 20:44:07 +01:00
Andreas Dangel aa6851e2d2 Update gems
Fixes https://github.com/pmd/pmd/security/dependabot/49
Fixes https://github.com/pmd/pmd/security/dependabot/50
2024-02-15 20:31:17 +01:00
Andreas Dangel fa01fcd38b [ci] Upgrade to ruby 3
Fixes #4776
2024-02-15 20:28:34 +01:00
Andreas Dangel ccebca525c Ignore empty catch block 2024-02-15 17:05:07 +01:00
Andreas Dangel ac2c52e220 [ant] Fix ant Formatter with Java 22
Java 22 provides a real console from System.console()
even if it is non-interactive. In that case, we need to
check whether we have a terminal.
2024-02-15 16:54:27 +01:00
Andreas Dangel 01647beb59 [doc] Update release notes (#4794) Java 22 2024-02-15 15:13:27 +01:00
Andreas Dangel 2a1aaa6bce [java] Fix tests with ExplicitConstructorInvocations 2024-02-15 15:07:50 +01:00
Laurent Bovet 4509b6b966 [plsql] Fix support of WITH clause 2024-02-15 13:38:04 +01:00
Andreas Dangel bfe9ce66e2 [java] JEP 447: Statements before super(...) (Preview) (Java 22) 2024-02-15 13:20:46 +01:00
Andreas Dangel 4e01a3dafb [java] JEP 456: Unnamed Variables & Patterns
This is now standardized.
2024-02-15 12:12:12 +01:00
Andreas Dangel cb3ceef17a [java] Update Tests for JEP 463: Implicitly Declared Classes and Instance Main Methods 2024-02-15 11:26:12 +01:00
Andreas Dangel fbb9da24f2 [java] Update Tests for JEP 459 String Templates
TemplateFragment now has an attribute "content".
2024-02-15 11:16:24 +01:00
Andreas Dangel 96bc9ef6c6 [java] Update LanguageLevelChecker#RegularLanguageFeature
- after 20-preview is gone
- Note: DECONSTRUCTION_PATTERNS_IN_ENHANCED_FOR_STATEMENT is completely
  gone. This was only available for 20-preview and has been removed
  with 21.
2024-02-15 10:30:55 +01:00
Andreas Dangel c4eccf49af [java] Remove old java 20 preview features
- Record patterns in enhanced for statements
- parenthesized patterns

These features have not been standardized.
2024-02-15 10:16:31 +01:00
Andreas Dangel 2a53ebaa55 [java] Remove java language version 20-preview 2024-02-15 09:50:06 +01:00
Andreas Dangel c4620635ee Update asm dependency to 9.6 2024-02-15 09:50:06 +01:00
Andreas Dangel 73dbd56ec4 [java] Add new java language versions 22 and 22-preview 2024-02-15 09:50:01 +01:00
Andreas Dangel 9e900a2c70 [java] Enable tests in JavaCpdLexerTest 2024-02-15 07:57:20 +01:00
Andreas Dangel 59537fb15c Merge branch 'master' into experimental-apex-parser 2024-02-13 20:12:39 +01:00
Andreas Dangel ee1d72955d [doc] Update release notes - Apex: Replaced Jorje with fully open source front-end
Fixes #3766
2024-02-13 20:12:28 +01:00
Andreas Dangel dbe6053af4 [apex] Remove module pmd-apex-jorje 2024-02-13 19:18:16 +01:00
Andreas Dangel a4280011a3 [apex] Remove now unneeded dependency to antlr 3 2024-02-13 19:09:36 +01:00
Andreas Dangel 7d326c5fd0 Bump guava from 31.0.1-android/32.0.1-jre to 33.0.0-jre 2024-02-13 19:00:45 +01:00
Andreas Dangel f12beff7c9 [apex] Decimal LiteralExpression - add TODO
Refs https://github.com/google/summit-ast/pull/47
2024-02-13 18:46:24 +01:00
Andreas Dangel 204232c238 [apex] Remove ASTBridgeMethodCreator
Update release notes/migration guide
2024-02-13 18:43:09 +01:00
Andreas Dangel f57a072e5c [apex] Normalize bound vars in SOQL 2024-02-13 18:42:24 +01:00
Andreas Dangel 526d9684c5 [apex] Remove namespace implementations
Fixes TODO(b/243905954)
2024-02-12 20:17:53 +01:00
Andreas Dangel e811b9ceb3 [apex] DefiningType for ASTApexFile 2024-02-12 20:17:53 +01:00
Andreas Dangel 0a557dfcf8 [apex] AbstractApexNode - calculateTextRegion for many nodes as union 2024-02-12 20:17:53 +01:00
Andreas Dangel e8e19a294f [apex] Fix RealLoc of ASTModifierNode and ASTField 2024-02-12 20:17:52 +01:00
Andreas Dangel 95d0cf4733 [apex] ApexXPathRuleTest - remove old test
This was testing a deprecated XPath attribute,
but that attribute was already removed.
2024-02-12 20:17:52 +01:00
Andreas Dangel cf67ebf4a5 [apex] ApexLexerTest - reenable and finish
Fixes TODO(b/239648780)
2024-02-12 20:17:41 +01:00
Andreas Dangel 50514b3736 [apex] ApexParser - init logging 2024-02-12 17:37:55 +01:00
Andreas Dangel f5979b5bfb [apex] ASTSoqlExpression - provide simple canonical query 2024-02-11 16:35:12 +01:00
Andreas Dangel 19907a74d9 [apex] Finish ASTReferenceExpression
- removed method getContext() - always returned null
  Fixes TODO(b/243906211)
- Verify that getReferenceType() returns the correct values
  Fixes TODO(b/239648780)
2024-02-10 21:01:52 +01:00
Andreas Dangel dbde030d8f [core] Remove @DeprecatedUntil700 2024-02-10 13:10:53 +01:00
Andreas Dangel 1b4acab7c4 Merge branch 'master' into issue-4349-cleanup-deprecations 2024-02-10 12:36:58 +01:00
Andreas Dangel b0818362e7 [ant] Add javadoc, internalize ReportException 2024-02-10 11:57:11 +01:00
Andreas Dangel dc4d195d77 [doc] Fix javadoc for moved classes 2024-02-10 11:57:11 +01:00
Andreas Dangel 5705847594 [core] Consolidate internal api in properties
PropertyTypeId - moved to internal
PropertyDescriptor#getTypeId
2024-02-10 11:56:58 +01:00
Andreas Dangel 68d4561544 [core] Consolidate internal api in XPath Attribute
Attribute#replacementIfDeprecated
2024-02-10 10:51:19 +01:00
Andreas Dangel 5e92b5907e [core] Consolidate internal api in FileCollector
FileCollector#newCollector
2024-02-10 10:47:07 +01:00
Andreas Dangel 3a635da9c2 [core] Consolidate internal api in PMDConfiguration
PMDConfiguration#setAnalysisCache
PMDConfiguration#getAnalysisCache
2024-02-10 10:38:26 +01:00
Andreas Dangel 2cc9ae9d7e [core] Consolidate internal api in LexException 2024-02-10 10:05:56 +01:00
Andreas Dangel 7c5bf74402 [core] Consolidate internal api in n.s.p.lang.rule
RuleSet#applies
RuleSetLoader#loadRuleSetsWithoutException
RuleSetLoadException ctors
2024-02-10 09:58:53 +01:00
Andreas Dangel 72edaee08a [core] Internalize ParametricRuleViolation 2024-02-09 22:02:36 +01:00
Andreas Dangel bc5be45566 Merge branch 'master' into issue-4348-internal-api 2024-02-09 21:31:05 +01:00
Andreas Dangel 19496ef198 Merge pull request #4808 from adangel:issue-3905-tree-export-api
[core] Promote Tree Export API as stable #4808
2024-02-09 16:56:56 +01:00
Andreas Dangel 0c82e97b6a [compat6] Fix XPathRule compatibility 2024-02-09 16:49:13 +01:00
Andreas Dangel 5931461ca9 Merge pull request #4804 from adangel:issue-4309-xpath-cleanups
[core] XPath cleanups #4804
2024-02-09 16:23:58 +01:00
Andreas Dangel 7698b6a994 [compat6] Fix compatibility layer
This is now an unhealthy mixture of old and new
classes. But the integration tests are working.
2024-02-09 16:12:32 +01:00
Andreas Dangel 8950cec263 [doc] Fix javadoc links after moving reporting 2024-02-09 15:49:54 +01:00
Andreas Dangel a2f2720f77 Fix imports 2024-02-09 15:41:36 +01:00
Andreas Dangel 6a328d6cd0 Merge pull request #4803 from adangel:issue-3903-reporting-package
[core] Consolidate n.s.pmd.reporting package #4803
2024-02-09 15:32:55 +01:00
Andreas Dangel 4bf2c8b980 [compat6] Remove RuleSetFactory - not needed
It was used by RuleSetLoader, but this was stripped
down to do nothing anymore. See the comments
in that file.
2024-02-09 15:14:55 +01:00
Andreas Dangel a9c0ee0cd7 [doc] Fix javadoc links after moving Rule 2024-02-09 14:47:15 +01:00
Andreas Dangel 2a3128fb86 Merge pull request #4799 from adangel:issue-3917-rule-package
[core] Consolidate n.s.pmd.lang.rule package #4799
2024-02-09 14:39:03 +01:00
Andreas Dangel ef165acebe [apex] ApexNode - fix javadoc 2024-02-09 12:16:52 +01:00
Andreas Dangel e0eb36b195 [apex] FieldDeclarationsShouldBeAtStartRule - remove STATIC_INITIALIZER_METHOD_NAME 2024-02-09 12:16:38 +01:00
Andreas Dangel f6bf245914 [apex] AbstractApexNode - hide literalToString and caseNormalizedTypeIfPrimitive
These are helper methods to be used only inside the ast package.
2024-02-09 12:10:17 +01:00
Andreas Dangel 31a79ef671 [apex] Remove TestQueryValidators - was only needed for Jorje 2024-02-09 12:03:16 +01:00
Andreas Dangel b9f2ca7432 [apex] ASTMethod - remove #isSynthetic
- keep CONSTRUCTOR_ID and STATIC_INIT_ID private
- update migration documentation
2024-02-09 12:02:35 +01:00
Andreas Dangel bf008596bf [apex] ASTLiteralExpression - add workaround for decimal 2024-02-09 11:11:28 +01:00
Andreas Dangel 5964add71f [apex] ASTFieldDeclarationStatements - clarify #getTypeArguments
Also simplify ApexCRUDViolationRule

Fixes TODO(b/239648780)
2024-02-09 10:49:00 +01:00
Andreas Dangel 6c4f3efbc7 [apex] ASTBlockStatement - verify curlyBrace 2024-02-09 09:50:24 +01:00
Andreas Dangel 17848c484d Merge branch 'master' into experimental-apex-parser 2024-02-09 09:29:16 +01:00
Andreas Dangel baef47bf19 Remove unused imports 2024-02-09 09:23:08 +01:00
Andreas Dangel da26d5cdb3 [doc] Update release notes (#4349) 2024-02-09 08:48:09 +01:00
Andreas Dangel 0d40878b0a Promote experimental APIs as stable
- HTML support and Kotlin support no more experimental
- The only left over experimental APIs are java preview features
2024-02-09 08:46:48 +01:00
Andreas Dangel 4ff00bfe66 [compat6] Fix compile errors after merge 2024-02-08 19:09:28 +01:00
Andreas Dangel d92f9ae0d8 Fix checkstyle 2024-02-08 18:31:33 +01:00
Andreas Dangel 05f4a23eca [doc] Fix migration doc after renaming Java AST classes 2024-02-08 18:28:35 +01:00
Andreas Dangel ec374a071f [doc] Migrating java MethodDeclaration @Image 2024-02-08 18:24:49 +01:00
Andreas Dangel 5599a8fd65 Merge branch 'master' into issue-4349-cleanup-deprecations 2024-02-08 18:23:41 +01:00
Andreas Dangel b6adbf5bb5 [java] Remove deprecated classes and methods
AbstractPackageNameModuleDirective#getImage
AbstractTypeDeclaration#getImage
ASTAnnotation#getAnnotationName
ASTClassType#ASTClassType(String)
ASTClassType#getImage
ASTClassType#isReferenceToClassSameCompilationUnit
ASTFieldDeclaration#getVariableName
ASTLiteral#is_xxx_Literal
ASTMethodDeclaration#getMethodName
ASTMethodReference#getImage
ASTModuleName#getImage
ASTPrimitiveType#getImage
ASTType#getTypeImage
ASTType#getArrayDepth
ASTType#isPrimitiveType #isArrayType #isClassOrInterfaceType
ASTTypeDeclaration#getImage
ASTUnaryExpression#isPrefix
ASTVariableId#getImage
ASTVariableId#getVariableName
JavaComment#getImage
JavaNode#jjtAccept
JavaParserVisitor
JavaParserVisitorAdapter
ModifierOwner#isFinal #isAbstract ... #isPublic ...
TypeNode#getType
2024-02-08 17:54:19 +01:00
Andreas Dangel 77beab517a [core] Remove deprecated methods in RuleSetLoader and RuleViolation
RuleSetLoader#toFactory
RuleViolation#getPackageName
RuleViolation#getClassName
RuleViolation#getMethodName
RuleViolation#getVariableName
2024-02-08 13:47:53 +01:00
Andreas Dangel d1ff6b89e7 [core] Remove deprecated method Report#merge 2024-02-08 13:33:08 +01:00
Andreas Dangel 28f2cf8e40 [core] Remove deprecated methods in AbstractConfiguration and PMDConfiguration
AbstractConfiguration#setIgnoreFilePath
AbstractConfiguration#setInputFilePath
AbstractConfiguration#setInputPaths
AbstractConfiguration#setInputUri
PMDConfiguration#prependClasspath
PMDConfiguration#getRuleSets
PMDConfiguration#setRuleSets
PMDConfiguration#setReportFile
PMDConfiguration#getReportFile
2024-02-08 11:16:00 +01:00
Andreas Dangel 0543cf0819 [core] Remove deprecated methods in CollectionUtil
CollectionUtil#invertedMapFrom
CollectionUtil#mapFrom
2024-02-08 10:54:07 +01:00
Andreas Dangel bc5ba3a54f [core] Remove deprecated DataSource classes
DataSource
FileDataSource
ReaderDataSource
ZipDataSource
2024-02-08 10:36:11 +01:00
Andreas Dangel 5c02b62623 [core] Remove deprecated members in Reportable
Reportable#getBeginLine
Reportable#getBeginColumn
Reportable#getEndLine
Reportable#getEndColumn
2024-02-08 10:10:09 +01:00
Andreas Dangel 50cbfe6834 [core] Remove deprecated members in AbstractPropertySource
AbstractPropertySource#propertyDescriptors (private now)
AbstractPropertySource#propertyValuesByDescriptor (private now)
AbstractPropertySource#copyPropertyDescriptors
AbstractPropertySource#copyPropertyValues
2024-02-08 09:53:48 +01:00
Andreas Dangel 9e5115479d [core] Remove deprecated methods in Language, LanguageRegistry
Language#getTerseName
LanguageModuleBase#getTerseName
LanguageRegistry#getLanguage
LanguageRegistry#findLanguageByTerseName
LanguageRegistry#findByExtension
2024-02-08 09:53:34 +01:00
Andreas Dangel 90ab50ca29 [core] Remove XPathRule#XPATH_DESCRIPTOR 2024-02-08 09:00:33 +01:00
Andreas Dangel cdc70c633a [core] Remove deprecated methods in RuleReference
RuleReference#setRuleSetReference
RuleReference#hasOverriddenProperty
2024-02-08 08:29:55 +01:00
Andreas Dangel 1900aa79c4 [core] Remove deprecated methods in AbstractRule
AbstractRule#deepCopyValuesTo
AbstractRule#addRuleChainVisit
AbstractRule#addViolation
AbstractRule#addViolationWithMessage
2024-02-08 08:25:45 +01:00
Andreas Dangel f95431f336 [core] Remove deprecated AbstractDelegateRule 2024-02-06 21:33:33 +01:00
Andreas Dangel 3ec38df9b0 [core] Remove deprecated XPathVersions 2024-02-06 21:33:08 +01:00
Andreas Dangel 9748580ee2 [ci] Fix dogfood SNAPSHOT version 2024-02-04 15:52:42 +01:00
Andreas Dangel 41938cacea Use latest pmd-designer 7.0.0-SNAPSHOT 2024-02-04 14:53:03 +01:00
Andreas Dangel 14ae7f4ce0 [compat6] Fix compile errors 2024-02-02 20:39:04 +01:00
Andreas Dangel 5e4b7f5eb5 Merge pull request #4798 from adangel:textcolor-renderer
[core] TextColorRenderer: Remove property color #4798
2024-02-02 20:02:02 +01:00
Andreas Dangel fa97cff7ff Merge pull request #4797 from adangel:lexexception-cpdlexer
[core] Rename TokenMgrError to LexException, Tokenizer to CpdLexer #4797
2024-02-02 19:59:41 +01:00
Andreas Dangel a78e17b7a6 Merge pull request #4796 from adangel:remove-deprecated-and-release-rulesets
Remove deprecated and release rulesets #4796
2024-02-02 19:57:04 +01:00
Andreas Dangel a76ec3410c Merge pull request #4795 from adangel:remove-ruleset-factory-compatibility
[core] Remove ruleset compatibility filter (RuleSetFactoryCompatibility) and CLI option --no-ruleset-compatibility #4795
2024-02-02 19:53:51 +01:00
Andreas Dangel a411bc5dac Merge pull request #4793 from adangel:undeprecate-dysfunction-reason
[core] Undeprecate PropertySource::dysfunctionReason in PMD 7 #4793
2024-02-02 19:51:05 +01:00
Andreas Dangel c8686a0dff Merge pull request #4792 from adangel:undeprecate-node-getImage
[core] Undeprecate Node::getImage() in PMD 7 #4792
2024-02-02 19:49:26 +01:00
Andreas Dangel 5b2b03847e Merge pull request #4786 from adangel:issue-4313-remove-old-rule-reference-notation
[core] Remove support for deprecated rule set references notation #4786
2024-02-02 19:46:55 +01:00
Andreas Dangel 2fbe5cb147 Merge pull request #4782 from adangel:avoid-image
[core] Avoid using getImage/@Image #4782
2024-02-02 18:25:49 +01:00
Andreas Dangel c6ce5a9557 Merge branch 'master' into avoid-image 2024-02-02 16:56:54 +01:00
Andreas Dangel 5c69ec0360 [core] Remove deprecated classes/methods
FileCollector#addZipFile
TextDocument#readOnlyString
TextFile#dataSourceCompat
2024-02-02 16:20:54 +01:00
Andreas Dangel 8111d450c2 [core] Remove deprecated classes/methods
Node#getParentsOfType
Node#findChildrenOfType
Node#findDescendantsOfType
Node#getFirstChildOfType
Node#getFirstDescendantOfType
Node#hasDescendantOfType
2024-02-02 15:57:34 +01:00
Andreas Dangel 19f9bdde5f [core] Remove deprecated classes/methods
CpdLanguageProperties#DEFAULT_SKIP_BLOCKS_PATTERN
BaseAntlrNode#joinTextToken
Node#getNthParent
Node#getFirstChildOfType
2024-02-02 14:41:45 +01:00
Andreas Dangel 2a59be965a [visualforce] Remove deprecated classes/methods 2024-02-02 12:42:26 +01:00
Andreas Dangel 7494260ffc [apex] Remove deprecated classes/methods 2024-02-02 12:34:50 +01:00
Andreas Dangel 2695eb250b Removed references to removed apex rules 2024-02-01 21:22:45 +01:00
Andreas Dangel 16e22f2d22 Removed references to removed rule Excessive(Class|Method)Length 2024-02-01 19:41:38 +01:00
Andreas Dangel 81a29abccd Removed references to removed rule BeanMembersShouldSerialize 2024-02-01 19:22:13 +01:00
Andreas Dangel 0ab9d45b3a [javascript] Remove deprecated classes/methods 2024-02-01 18:59:08 +01:00
Andreas Dangel 78bfe05cc5 [vm] Remove deprecated classes/methods 2024-02-01 18:47:35 +01:00
Andreas Dangel bd5f5819c8 [scala] Rename ScalaParserVisitor(Adapter) -> ScalaVisitor(Base) 2024-02-01 18:44:11 +01:00
Andreas Dangel 3ca4d96eef [scala] Remove deprecated classes/methods 2024-02-01 18:43:05 +01:00
Andreas Dangel c49a44fb32 [plsql] Remove deprecated classes/methods 2024-02-01 18:31:24 +01:00
Andreas Dangel 00f22abe2e [modelica] Remove deprecated classes/methods 2024-02-01 18:10:47 +01:00
Andreas Dangel 463fd2d318 [jsp] Remove deprecated classes/methods 2024-02-01 18:10:31 +01:00
Andreas Dangel c22448eae6 Removed references to removed rules 2024-02-01 17:35:40 +01:00
Andreas Dangel b7363c98bb [java] Remove deprecated rules
use consequently macro "{% deleted_rule" in docs
2024-02-01 16:38:25 +01:00
Andreas Dangel 69a58987a5 [apex] Remove deprecated rules 2024-02-01 16:27:47 +01:00
Andreas Dangel 7ca993429a [doc] Update release notes
Fixes #4348
2024-02-01 12:17:49 +01:00
Andreas Dangel 7cd94ebb7d [core] Cleanup javadoc regarding InternalApi
Refs #4348
2024-02-01 12:17:30 +01:00
Andreas Dangel fae522a002 [core] Unify javadoc for InternalApiBridge classes
Refs #4348
2024-02-01 12:09:12 +01:00
Andreas Dangel 83879dc420 [core] Hide internal API methods in LanguageProcessor.AnalysisTask
Refs #4348
2024-02-01 11:39:33 +01:00
Andreas Dangel 7c34085b17 [doc] Fix javadoc links in release notes 2024-02-01 11:32:44 +01:00
Andreas Dangel d2ae17a474 [doc] Mark ADR 3 accepted
Refs #4756
2024-02-01 10:54:45 +01:00
Andreas Dangel 4978e66500 Fix javadoc generation - exclude also sub-packages of internal 2024-02-01 10:47:15 +01:00
Andreas Dangel 5e9ba14681 [visualforce] Cleanup InternalApi methods
Refs #4348
2024-02-01 10:39:18 +01:00
Andreas Dangel d1c3212ea7 [scala] Cleanup InternalApi methods
Refs #4348
2024-02-01 10:37:11 +01:00
Andreas Dangel 8285d70fe5 [plsql] Cleanup InternalApi methods
Refs #4348
2024-02-01 10:31:48 +01:00
Andreas Dangel 1997984569 [modelica] Cleanup InternalApi methods
Refs #4348
2024-02-01 10:29:09 +01:00
Andreas Dangel 3ff3f5b4d1 [jsp] Cleanup InternalApi methods
Refs #4348
2024-02-01 10:08:16 +01:00
Andreas Dangel 35db84a0a8 [java] Cleanup InternalApi methods
Refs #4348
2024-02-01 09:33:17 +01:00
Andreas Dangel 7ec2bc4865 [apex] Cleanup InternalApi methods
Refs #4348
2024-01-30 20:17:59 +01:00
Andreas Dangel 2f47edfd3b [ant] Cleanup InternalApi methods
Refs #4348
2024-01-30 19:36:46 +01:00
Andreas Dangel e3cf1c6567 [core] RuleContext - addViolationNoSuppress()
This was not used and not tested.
To be readded with #2736 and #2896

Refs #4348
2024-01-28 19:46:56 +01:00
Andreas Dangel 627fef132d [core] RuleContext - remove getRule(), create()
Introduce InternalApiBridge to collect all internal
API endpoints.

Refs #4348
2024-01-28 19:46:29 +01:00
Andreas Dangel 589d14418e [core] Report - ctor and addRuleViolation, addConfigError, addError are private
Refs #4348
2024-01-28 18:44:22 +01:00
Andreas Dangel 8b8b11d5f3 [core] AbstractAccumulatingRenderer#renderFileReport(Report) is final
Refs #4348
2024-01-28 18:30:11 +01:00
Andreas Dangel bc31401258 [core] LanguageProcessor.AnalysisTask#withFiles now internal
Refs #4348
2024-01-28 18:15:39 +01:00
Andreas Dangel a0a289f4ef [core] RuleTargetSelector#isRuleChain removed
Refs #4348
2024-01-27 19:41:45 +01:00
Andreas Dangel 932c2e38f8 [core] XPath Attribute#replacementIfDeprecated stays Internal API
Refs #4348
2024-01-27 19:41:45 +01:00
Andreas Dangel 4f8d09460c [core] FileCollector - factories stay internal, other methods are now public api
Refs #4348
2024-01-27 19:41:45 +01:00
Andreas Dangel 217f0f43f8 [core] PropertyTypeId and PropertyDescriptor#getTypeId
Both stay Internal API, update javadoc

Refs #4348
2024-01-27 19:41:00 +01:00
Andreas Dangel db0392cba1 [core] n.s.pmd.cpd.Tokens#Tokens() is now package private
Refs #4348
2024-01-27 18:39:20 +01:00
Andreas Dangel daef0cde8d [core] Move n.s.pmd.util.internal.ResourceLoader
Refs #4348
2024-01-27 18:06:23 +01:00
dependabot[bot] 1d95f0f03e Bump actions/cache from 3 to 4
Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-26 19:16:37 +01:00
Andreas Dangel 3a5ff11dc2 [core] Rename MessageReporter to PmdReporter as public API
PmdReporter is supposed to be used when configuring PMD
(see AbstractConfiguration#setReporter), so it can't be internal.

Refs #4348
2024-01-26 19:06:08 +01:00
Andreas Dangel 906baf9b50 [core] Internalize AnalysisCache and related types
Refs #4348
2024-01-26 18:41:00 +01:00
Andreas Dangel 3290815fff Merge branch 'master' into experimental-apex-parser 2024-01-26 17:49:50 +01:00
Andreas Dangel 4a1ba2c3c0 [doc] Remove not existing -language cli param
It was already removed for PMD 7.
2024-01-26 17:45:25 +01:00
Juan Martín Sotuyo Dodero 033ede2925 Fix broken link 2024-01-26 11:55:38 -03:00
Juan Martín Sotuyo Dodero 68680de9cb Fix Windows dir separator 2024-01-26 11:52:24 -03:00
Juan Martín Sotuyo Dodero f70b0d04cf Fix Windows samples 2024-01-26 11:50:29 -03:00
Andreas Dangel 88239b703e Merge pull request #4777 from adangel:fix-deprecated-api-usage
Fix deprecated API usage #4777
2024-01-26 15:16:54 +01:00
Andreas Dangel 7041f27d9f Merge pull request #4775 from adangel:apex-fix-deprecated-api-usage
[apex][visualforce] Fix deprecated API usage #4775
2024-01-26 15:15:58 +01:00
Andreas Dangel 59c2e86203 Merge pull request #4772 from adangel:plsql-fix-deprecated-api-usage
[plsql] Fix deprecated API usage #4772
2024-01-26 15:14:53 +01:00
Andreas Dangel 0c4b4f4dcd Merge pull request #4768 from adangel:java-ast-updates
[java] Updates to AST nodes #4768
2024-01-26 15:13:40 +01:00
Andreas Dangel d9321d70f2 [core] Promote Tree Export API as stable
Fixes #3905
2024-01-25 16:26:10 +01:00
Andreas Dangel f5c4aaddf2 [doc] Update release notes (#4309) 2024-01-25 14:41:39 +01:00
Andreas Dangel 304ff2ec25 [core] XPathHandler/XPathFunctionDefintion: Refactoring, javadoc 2024-01-25 14:41:20 +01:00
Andreas Dangel 721661c3f9 [core] XPathHandler: Avoid direct dependency on saxon, Part 2
Define new interface FunctionCall, that replaces the
saxon interface ExtensionFunctionCall.
2024-01-25 12:28:25 +01:00
Andreas Dangel b8ecc890af [core] XPathHandler: Avoid direct dependency on saxon, Part 1 2024-01-25 10:56:01 +01:00
Andreas Dangel c800bba733 [compat6] Provide XPathRule under old package 2024-01-21 10:02:19 +01:00
Andreas Dangel 3941fe1988 [compat6] Fix SuppressedViolations compatibility 2024-01-20 18:20:45 +01:00
Andreas Dangel 049f2c7c59 [core] XPathRule - remove version property (#4309) 2024-01-20 17:40:02 +01:00
Andreas Dangel 7c29f16eac [core] Move XPathRule into subpackage lang.rule.xpath (#4309) 2024-01-19 12:52:51 +01:00
Andreas Dangel f6440c6dab [compat6] Making compat6 layer for m-pmd-p work again 2024-01-19 11:49:08 +01:00
Andreas Dangel f13cd58c7f [core] Move classes into n.s.pmd.reporting
- Report
- RuleContext
- RuleViolation
- ViolationSuppressor
- ParametricRuleViolation

Fixes #3903
2024-01-18 20:27:34 +01:00
Andreas Dangel 83522e96ef [ci] Update sonar, use Java 17 2024-01-18 08:32:27 +01:00
Andreas Dangel 023e51e67f [java] SingletonClassReturningNewInstance - variant 2 (#932) 2024-01-17 18:02:45 +01:00
Andreas Dangel 9f4d870fa5 [java] SingletonClassReturningNewInstance - fix double assignment case
Fixes #932
2024-01-17 17:44:29 +01:00
Andreas Dangel 963a9a965c [java] Verify fix for BrokenNullCheck (#718)
Closes #718
2024-01-17 17:43:15 +01:00
Andreas Dangel faaec5ed6d [core] Actually move into correct package lang.rule 2024-01-13 20:57:56 +01:00
Andreas Dangel 7b680eecaf [doc] Update release notes (#3917) 2024-01-13 18:51:56 +01:00
Andreas Dangel 2461a4d00e [core] Move RuleSets/RuleSetReference into internal sub-package 2024-01-13 18:50:29 +01:00
Andreas Dangel 301678fe01 [compat6] Make maven-pmd-plugin work again
Provide some extra bridge methods for backwards
compatible getter, e.g. RuleViolation#getRule()
or PMDConfiguration#getMinimumPriority()
2024-01-13 18:26:10 +01:00
Andreas Dangel 9e668c22fc [core] Move Rule/RuleSet related type into net.sourceforge.pmd.rule
Refs #3917
2024-01-12 18:14:04 +01:00
Andreas Dangel 6d955d6b9a [core] Move Rule into package net.sourceforge.pmd.rule 2024-01-12 11:04:02 +01:00
Andreas Dangel b17fe92fb5 Merge branch 'master' into java-ast-updates 2024-01-12 10:41:41 +01:00
Andreas DangelandClément Fournier 8bd78b4b8f Update pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/internal/PrettyPrintingUtil.java
Co-authored-by: Clément Fournier <clement.fournier@tu-dresden.de>
2024-01-12 10:30:49 +01:00
Andreas Dangel 035909ca36 Merge pull request #4739 from adangel:issue-4722-apex-fixes
[apex] Fixes for experimental apex parser #4739
2024-01-12 10:04:29 +01:00
Andreas Dangel a52baa0150 Merge branch 'master' into experimental-apex-parser 2024-01-12 10:03:50 +01:00
Andreas Dangel b06d00fb40 [java] SingularField: verify #174
Closes #174
2024-01-12 09:59:17 +01:00
Andreas Dangel abb251a85e Merge pull request #4778 from dependabot/github_actions/master/actions/upload-artifact-4
Bump actions/upload-artifact from 3 to 4 #4778
2024-01-12 09:27:14 +01:00
Andreas Dangel e65f10bc57 Merge pull request #4766 from adangel:issue-4319-typeres-symbols-api
[doc] Document TypeRes API and Symbols API (#4319) #4766
2024-01-12 09:25:51 +01:00
Andreas Dangel acb3fd8dc5 Merge pull request #4764 from adangel:issue-4308-xpath-lang-impl
[doc] Document XPath integration (#4308) #4764
2024-01-12 09:21:33 +01:00
Andreas Dangel 661d76ca61 Merge pull request #4762 from adangel:issue-2511-doc-rules
[doc] Review rule writing documentation for PMD 7 #4762
2024-01-12 09:19:53 +01:00
Andreas Dangel afe1ffac25 Merge pull request #4756 from adangel:issue-995-api-doc
[doc] ADR 3 - API evolution principles #4756
2024-01-12 09:17:31 +01:00
Andreas Dangel a8426fd996 [doc] Update release notes (#995) 2024-01-12 09:16:45 +01:00
Andreas Dangel 524ac69ecc [core] TextColorRenderer: Remove property color
Fixes #4312
2024-01-11 17:37:53 +01:00
Andreas Dangel bd933461d3 [doc] Update release notes (#4065) 2024-01-11 17:06:15 +01:00
Andreas Dangel 6163f67b06 [core] Rename Tokenizer to CpdLexer
See #4065
2024-01-11 17:04:48 +01:00
Andreas Dangel 55d91791c3 [core] Rename TokenMgrError to LexException
See #4065
2024-01-11 15:56:28 +01:00
Andreas Dangel 742394068e [doc] Update release notes (#4796) 2024-01-11 14:55:48 +01:00
Andreas Dangel a63a477396 Remove releases rulesets 2024-01-11 14:53:32 +01:00
Andreas Dangel bb75ff41c3 Fix old usages of old rulesets 2024-01-11 14:43:59 +01:00
Andreas Dangel 9977c0ffeb Remove old rulesets
These were from PMD 5. In PMD 6, these rules
have been moved into categories.
2024-01-11 12:28:30 +01:00
Andreas Dangel ba602d1978 [core] Remove ruleset compatibility filter (RuleSetFactoryCompatibility) and CLI option --no-ruleset-compatibility
Fixes #4314
Closes #4378
2024-01-11 12:05:10 +01:00
Andreas Dangel ed0cff6da9 Merge branch 'master' into java-ast-updates 2024-01-11 10:28:21 +01:00
Andreas Dangel a1d238cff6 [doc] Update release notes (#1307, #3751) 2024-01-11 10:26:32 +01:00
Andreas Dangel 29a4aaec47 [core] Undeprecate PropertySource::dysfunctionReason in PMD 7
refs #3868 and #3901
2024-01-11 10:20:54 +01:00
Andreas Dangel 60eca92180 [core] Undeprecate Node::getImage() in PMD 7
This should be done for 7.x again - see #4787
2024-01-11 09:47:10 +01:00
Andreas Dangel e36055c8e0 [doc] Update migration guide (refs #4787) 2024-01-06 12:07:44 +01:00
Andreas Dangel 986293d748 [doc] Update release notes/migration guide for @Image changes 2024-01-06 11:53:21 +01:00
Andreas Dangel ce5aff837d [jsp] Avoid using @Image, add AbstractContentNode 2024-01-06 10:25:32 +01:00
Andreas Dangel 120d24dae4 [xml] Fix impl and tests 2024-01-05 17:23:42 +01:00
Andreas Dangel adfd3963a0 [xml] Avoid using @Image - added new attribute @Text 2024-01-05 16:48:29 +01:00
dependabot[bot] 2d6dba7de2 Bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-05 14:51:49 +00:00
Andreas Dangel 2e7263af69 Merge pull request #4746 from adangel:build-improvements
[ci] Build improvements #4746
2024-01-05 15:49:37 +01:00
Andreas Dangel 4595ec11ab Merge branch 'experimental-apex-parser' into issue-4722-apex-fixes 2024-01-05 15:44:36 +01:00
Andreas Dangel f9541beb85 Merge branch 'master' into experimental-apex-parser 2024-01-05 15:43:48 +01:00
Andreas Dangel 13673d43fd [apex] Use summit-ast 2.1.1 2024-01-05 15:43:26 +01:00
Andreas Dangel 1c1cdb52de Merge pull request #4718 from adangel:issue-4717-xsltrenderer-leak
[core] XSLTRenderer: Close original writer at the end #4718
2024-01-05 15:12:55 +01:00
Andreas Dangel a382d675b6 Merge branch 'master' into issue-4717-xsltrenderer-leak 2024-01-05 15:12:13 +01:00
Andreas Dangel b4781ada3b Merge pull request #4694 from oowekyala:issue4635-cpd-lexical-error
[core] Fix line/col numbers in TokenMgrError #4694
2024-01-05 15:07:02 +01:00
Andreas Dangel bd7fb70c13 [ci] Bump build-tools to master (23-SNAPSHOT)
Should fix the expired release key
2024-01-05 14:59:39 +01:00
Andreas Dangel 194a644cee [ci] Bump build-tools to 23-SNAPSHOT
Should fix the expired release key
2024-01-05 14:57:09 +01:00
Andreas Dangel fb0e9c5344 [doc] Update release notes (#4694) 2024-01-05 14:55:14 +01:00
Andreas Dangel b65589175c [core] Add tests for TokenMgrError location 2024-01-05 14:48:10 +01:00
Andreas Dangel 6255274659 Merge branch 'master' into pr-4694 2024-01-05 14:15:37 +01:00
Andreas Dangel 070cca8743 Merge pull request #4628 from adangel:support-jrt-fs
[java] Support loading classes from java runtime images #4628
2024-01-05 13:51:40 +01:00
Andreas Dangel b0669c5d64 [doc] Update migration guide 2024-01-05 13:45:18 +01:00
Andreas Dangel 35062c3caf Remove unneeded dependency to WireMock 2024-01-05 13:36:04 +01:00
Andreas Dangel 7b24edc0db [core] Remove support for deprecated rule set references notation
The old notation <lang>-<ruleset> is not supported anymore. It is
now interpreted as a ruleset reference without a ruleset and just
referencing a single rule. Also the release number notation is
not supported anymore.

Since RuleSetReferenceId is Internal+Deprecated, no API changes.
Clarified External/Internal: A RuleSetReference is either absolute
(RuleSet is known) or relative (RuleSet is not known).

Fixes #4313
2024-01-05 12:43:56 +01:00
Andreas Dangel 411d32607b [core] Introduce TextNode and CommentNode for XPath/HTML 2023-12-19 20:45:05 +01:00
Andreas Dangel bf66f816f0 [html] Remove @Image attributes of text nodes 2023-12-19 20:45:00 +01:00
Andreas Dangel a234e5e353 [vm] Remove unused setImage() 2023-12-19 20:44:52 +01:00
Andreas Dangel 34693e4ca0 [scala] Avoid using @Image 2023-12-19 20:44:42 +01:00
Andreas Dangel 76f2c12d83 [modelica] Avoid using @Image 2023-12-19 20:43:45 +01:00
Andreas Dangel c8333f034d [javascript] Avoid using @Image 2023-12-19 20:34:19 +01:00
Andreas Dangel 20e0aacfa4 [ant] Remove deprecated reference to language's terse name 2023-12-19 20:05:26 +01:00
Andreas Dangel 7424491ea8 [core] Fix BaseAntlrNode::getTextRegion 2023-12-16 19:12:56 +01:00
Andreas Dangel b059ecb98a Fix deprecated API usage
Fixes in pmd-doc, html, javascript,
jsp, modelica, objectivec, scala,
swift, vm
2023-12-16 18:34:55 +01:00
Andreas Dangel bbebf03cc0 Merge branch 'master' into apex-fix-deprecated-api-usage 2023-12-16 17:06:41 +01:00
Andreas Dangel a558fd17eb [ci] Use bundler 2.4.22, which is still compatible with ruby 2.7 2023-12-16 13:03:32 +01:00
Andreas Dangel 3cdc99be81 [visualforce] Fix deprecated API usage 2023-12-15 20:39:37 +01:00
Andreas Dangel 4e02a21e3a [apex] Fix deprecated API usage 2023-12-15 20:23:01 +01:00
Andreas Dangel 686851acd2 [plsql] Fix deprecated API usage 2023-12-14 15:03:58 +01:00
Andreas Dangel 3a3a8784f1 [java] Remove ASTClassDeclaration#isPackagePrivate() 2023-12-14 13:57:50 +01:00
Andreas DangelandClément Fournier 97d141d577 [core][java] Expose Chars attributes in XPath
- taken from #4352 (avoid getImage())
- Exposes @LiteralText for ASTLiteral

Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2023-12-14 13:48:21 +01:00
Andreas DangelandClément Fournier 73fcf6e38c [core][java] Integrate improvements from #4352 (avoid getImage())
- This improves ASTLiteral implementation
- Adds ASTLiteral#getLiteralText() - not yet exposed as XPath attribute

Co-authored-by: Clément Fournier <clement.fournier76@gmail.com>
2023-12-14 12:10:00 +01:00
Andreas Dangel 7a0f7316b7 [java] Avoid usage of deprecated methods
- firstChild() instead of getFirstChildOfType()
- descendants() instead of findDescendantsOfType()
- ancestors() instead of getFirstParentOfType()
2023-12-14 09:40:26 +01:00
Andreas Dangel 0fb4593234 [java] Avoid usage of deprecated methods
- getName() instead of getMethodName() or getVariableName()
- firstChild() instead of getFirstChildOfType()
- getRoot() instead of getFirstParentOfType(ASTCompilationUnit.class)
- children() instead of findChildrenOfType()
- no more addRuleChainVisit()
- ancestors() instead of getNthParent()
- descendants() instead of findDescendantsOfType()
2023-12-13 18:20:28 +01:00
Andreas Dangel e283f11551 [java] Avoid usage of deprecated addViolation 2023-12-13 11:49:07 +01:00
Andreas Dangel 21ec4b9235 [java] Update change log in Java.jjt 2023-12-13 10:51:47 +01:00
Andreas Dangel c579576b32 [java] Rename ASTClassOrInterfaceBody to ASTClassBody 2023-12-13 10:49:13 +01:00
Andreas Dangel ba0611534d [java] Rename ASTVariableDeclaratorId to ASTVariableId 2023-12-13 10:30:39 +01:00
Andreas Dangel 8198218ad7 [java] Rename ASTMethodorConstructorDeclaration to ASTExecutableDeclaration
Also rename AbstractMethodOrConstructorDeclaration to AbstractExecutableDeclaration
2023-12-13 09:48:58 +01:00
Andreas Dangel 8b4caed003 [java] Rename ASTAnyTypeDeclaration to ASTTypeDeclaration
Also rename AbstractAnyTypeDeclaration to AbstractTypeDeclaration
2023-12-13 08:54:34 +01:00
Andreas Dangel e79e8402c1 [java] Rename ASTClassOrInterfaceDeclaration to ASTClassDeclaration 2023-12-12 20:09:51 +01:00
Andreas Dangel 6cba870669 [doc] Fix migration guide after renaming ClassType 2023-12-12 19:36:48 +01:00
Andreas Dangel b0b47ff3c6 Remove TODO, fix javadoc 2023-12-12 16:12:19 +01:00
Andreas Dangel 698ca0d3ff [java] Rename ASTClassOrInterfaceType to ASTClassType 2023-12-12 16:01:34 +01:00
Andreas Dangel 33c0d20f98 [java] Rename AccessNode to ModifierOwner 2023-12-12 15:31:00 +01:00
Andreas Dangel 721e88e812 Fix tests - ASTMethodDeclaration now has isFinal() 2023-12-12 14:55:33 +01:00
Andreas Dangel 9febf2ceae [java] Remove FinalizableNode 2023-12-12 14:35:42 +01:00
Andreas Dangel 6909a9d704 Fix tests - Use consequently BaseJavaTreeDumpTest 2023-12-11 16:44:54 +01:00
Andreas Dangel ae2846df8a Fix tests
* @PackagePrivate is deprecated now and gone
* @Static is no more deprecated for types, methods, fields
2023-12-11 16:36:05 +01:00
Andreas Dangel 22e46404ee [java] Add hasVisibility method
Deprecate ASTClassOrInterfaceDeclaration#isPackagePrivate().
Use #hasVisibility(Visibility) instead, which can correctly
differentiate between local and package private classes.
2023-12-11 15:54:02 +01:00
Andreas Dangel 9869dccf4b [java] Push isStatic() down to declaration
Only on ASTMethodDeclaration, ASTFieldDeclaration and ASTAnyTypeDeclaration.
This makes it possible to remove it
from AccessNode.
2023-12-11 15:19:12 +01:00
Andreas Dangel e4f2307b06 Merge pull request #4726 from Monits:upgrade-groovy
[groovy] Support Groovy to 3 and 4 and CPD suppressions #4726
2023-12-11 13:42:29 +01:00
Andreas Dangel 552ce7d36f [doc] Update release notes and docs for groovy (#4726) 2023-12-11 13:42:01 +01:00
Andreas Dangel 65b4c38bca Merge branch 'master' into pr-4726 2023-12-11 13:25:32 +01:00
Andreas Dangel 2862d36f4e Merge pull request #4685 from adangel:issue-4676-cpd-cli
[cli] Clarify CPD documentation, fix positional parameter handling #4685
2023-12-11 11:18:47 +01:00
Andreas Dangel 6ea7206f65 Fix unit tests 2023-12-11 11:14:16 +01:00
Andreas Dangel 1ecda3f749 [doc] Update release notes (#4685) 2023-12-11 10:52:44 +01:00
Andreas Dangel 9ecbe2e5ce [cli] Use setters for --dir and positional parameters
This makes it possible to combine both inputs into a single list of
files to be analyzed.
2023-12-11 10:49:44 +01:00
Andreas Dangel dfcde5acde [doc] Update release notes (#4697) 2023-12-11 10:35:14 +01:00
Andreas Dangel fc3fce1d02 Merge branch 'master' into issue-4676-cpd-cli 2023-12-11 10:32:34 +01:00
Andreas Dangel cc8455ee1b Merge pull request #4698 from openium:feature/swift-5.9-support
[swift] Add macro expansion support for swift 5.9 #4698
2023-12-11 10:05:13 +01:00
Andreas Dangel 84c2eb7511 [doc] Update release notes (#4698) 2023-12-11 10:04:29 +01:00
Andreas Dangel 020e2da270 [swift] Log parser errors
* Eventually, this should throw, but the grammar
is very incomplete.
* Support opaque-types
2023-12-11 09:57:39 +01:00
Andreas Dangel dbfde44b92 [swift] Make Macro expansion an expression
Add parser tests
2023-12-11 09:56:18 +01:00
Andreas Dangel 4666d22e09 [doc] ADR 3 - API principles - updates
* clarify impl
* remove @ReservedSubclassing
2023-12-11 08:36:24 +01:00
Andreas Dangel b6df95c344 [doc] Update rule writing docs (#2511)
Add NodeStream
2023-12-08 19:45:44 +01:00
Andreas Dangel 8ce3176c11 [doc] Document TypeRes API and Symbols API (#4319) 2023-12-08 18:53:55 +01:00
Andreas Dangel e9b37fd6c8 [doc] Document XPath integration (#4308) 2023-12-08 12:28:23 +01:00
Andreas Dangel abed5b00dc Merge pull request #4749 from bergander:FixNoSuchMethodErrorInPmdCompat6
Fixes NoSuchMethodError on processing errors in pmd-compat6 #4749
2023-12-07 20:49:19 +01:00
Andreas Dangel 071a632de1 Merge branch 'master' into pr-4749 2023-12-07 20:08:52 +01:00
Andreas Dangel 729d035f26 [doc] Update release notes (#4749) 2023-12-07 20:08:16 +01:00
Andreas Dangel dcdab9d792 Fix test 2023-12-07 20:05:35 +01:00
Andreas Dangel 0a63e74d2d Merge pull request #4759 from marcindabrowski:fix-java-errorprone-warnings
[java] fix: remove delimiter attribute from ruleset category/java/errorprone.xml #4759
2023-12-07 19:20:07 +01:00
Andreas Dangel 49e6777fff [apex] Remove deprecated rule ref to ApexCSRF
This rule has been moved from security to errorprone
since PMD 6.21.0 already
2023-12-07 19:15:34 +01:00
Andreas Dangel aa93a75009 [test] Test built-in rulesets for warnings while loading 2023-12-07 18:44:41 +01:00
Andreas Dangel 9f9a8f7068 Add @marcindabrowski as a contributor 2023-12-07 18:43:52 +01:00
Andreas Dangel 272b23d7b2 [doc] Update release notes (#4759) 2023-12-07 18:43:34 +01:00
Andreas Dangel b2aca33e80 [doc] Update release notes (#4642) 2023-12-07 18:18:43 +01:00
Andreas Dangel ad00f1f571 [doc] Update release notes (#2511) 2023-12-07 17:09:45 +01:00
Andreas Dangel 10dd8e07bc [doc] Update rule writing docs (#2511) 2023-12-07 17:08:27 +01:00
Andreas Dangel fa12c0d500 [doc] Update rule writing docs (#2511) 2023-12-07 12:43:05 +01:00
Andreas Dangel add430b038 [doc] Update rule writing docs (#2511) 2023-12-07 10:42:40 +01:00
Marcin Dąbrowski 6d09555af6 fix: remove delimiter attribute from pmd-java/src/main/resources/category/java/errorprone.xml
When using `category/java/errorprone.xml` ruleset with PMD 7.0.0-rc4 I'm getting these warnings:

```
Warning at category/java/errorprone.xml:1039:78
 1037|         <properties>
 1038|             <property name="version" value="2.0"/>
 1039|             <property name="typesThatCompareByReference" type="List[String]" delimiter="," description="List of canonical type names for which reference comparison is allowed.">
                                                                                    ^^^^^^^^^ Delimiter attribute is not supported anymore, values are always comma-separated.

 1040|                 <value>java.lang.Enum,java.lang.Class</value>
 1041|             </property>
Warning at category/java/errorprone.xml:2353:62
 2351|         <priority>3</priority>
 2352|         <properties>
 2353|             <property name="annotations" type="List[String]" delimiter="," value="org.springframework.beans.factory.annotation.Autowired,javax.inject.Inject,com.google.inject.Inject" description="If a constructor is annotated with one of these annotations, then the class is ignored."/>
                                                                    ^^^^^^^^^ Delimiter attribute is not supported anymore, values are always comma-separated.

 2354|             <property name="xpath">
 2355|                 <value>
 ```
2023-12-04 12:05:45 +01:00
kenji 10ae2fae96 Add swift 5.9 support 2023-12-01 15:48:31 +01:00
Andreas Bergander f73d75d5a3 Fix NoSuchMethodError on processing errors in pmd-compat6 2023-12-01 15:30:17 +01:00
Andreas Dangel c6d55ca059 Merge pull request #4706 from Debamoy:issue/1831-detached-test-case-reports-package-private-methods
[java] DetachedTestCase should not report on abstract methods #4706
2023-12-01 15:07:41 +01:00
Andreas Dangel 990090d6d1 [doc] Update release notes (#4706, #1831) 2023-12-01 15:05:22 +01:00
Andreas Dangel b0e2ab68c9 Add @Debamoy as a contributor 2023-12-01 15:04:45 +01:00
Andreas Dangel 10c184b44b Fix checkstyle 2023-12-01 15:02:24 +01:00
Andreas Dangel 3875ae2726 Merge pull request #4754 from bergander:AllowCommentedBlocks
[java] EmptyControlStatementRule: Add allowCommentedBlocks property #4754
2023-12-01 14:29:03 +01:00
Andreas Dangel 5ccae72a30 Update @bergander as a contributor 2023-12-01 14:27:42 +01:00
Andreas Dangel 1e8d5874ed [doc] Update release notes (#4754) 2023-12-01 14:27:15 +01:00
Andreas Dangel b06ff0bda4 Merge pull request #4755 from oowekyala:issue4753-capture-of-wildcard
[java] Fix #4753 - PMD crashes while using generics and wildcards #4755
2023-12-01 11:19:23 +01:00
Andreas Dangel b69b126292 Add @soyodream as a contributor 2023-12-01 11:18:53 +01:00
Andreas Dangel d77d936daa [doc] Update release notes (#4753) 2023-12-01 11:18:24 +01:00
Andreas Dangel 32327876fb [doc] ADR - formatting of headers 2023-12-01 11:07:28 +01:00
Andreas Dangel 8763e1a19f [doc] ADR 3 - API principles 2023-12-01 11:05:01 +01:00
Andreas Dangel 1d2db3dfe0 [doc] ADR 3 - API principles 2023-12-01 09:41:09 +01:00
Andreas Dangel 98ed6b36e8 [doc] ADR 3 - API principles 2023-11-30 15:54:43 +01:00
Clément Fournier c3a91ea495 Update release notes 2023-11-28 17:56:32 +01:00
Clément Fournier b7b26f01f5 Fix #4753 2023-11-28 17:48:59 +01:00
Andreas Bergander de2a7e15ee Add allowCommentedBlocks property to EmptyControlStatementRule 2023-11-27 16:00:40 +01:00
Debamoy Datta 3fc9d8fc77 issue-1831 added test cases 2023-11-25 11:02:22 +05:30
sandhu5 7b58a7ef1b Fix flaky LatticeRelationTest 2023-11-24 12:16:16 -06:00
Andreas Dangel f030d7f8d7 Merge pull requets #4750 from 219sansim:fix_flaky_SummaryHTMLRenderer
[core] Fix flaky SummaryHTMLRenderer #4750
2023-11-23 19:16:11 +01:00
Andreas Dangel a8e80cc74b [doc] Update release notes (#4750) 2023-11-23 19:15:45 +01:00
Andreas Dangel 69e5307339 Add @219sansim as a contributor 2023-11-23 19:12:59 +01:00
Andreas Dangel f2e61b7ec3 No need to enable profile cli-dist anymore
Undo 1ac1bde6e2
2023-11-23 18:22:37 +01:00
Andreas Dangel f5f3ea127b Merge branch 'master' into build-improvements 2023-11-23 18:20:50 +01:00
Andreas Dangel f1b6081774 Merge branch 'experimental-apex-parser' into issue-4722-apex-fixes 2023-11-23 18:18:12 +01:00
Andreas Dangel 04dd3bae48 Merge branch 'master' into experimental-apex-parser 2023-11-23 18:17:56 +01:00
Andreas Dangel 1ac1bde6e2 Explicitly enable profile cli-dist for PR builds 2023-11-23 18:17:30 +01:00
Andreas Dangel 556644a136 Merge branch 'experimental-apex-parser' into issue-4722-apex-fixes 2023-11-23 17:35:47 +01:00
Andreas Dangel 759d5fd6cc Revert "[ci] regression tester: Use new regression tester"
This reverts commit 50bc72d057.
2023-11-23 17:34:25 +01:00
Andreas Dangel f62604946a Merge branch 'master' into experimental-apex-parser 2023-11-23 17:31:31 +01:00
Andreas Dangel da95ddb4e3 Use PMD 7.0.0-rc4 for maven-pmd-plugin 2023-11-23 12:25:17 +01:00
Andreas Dangel b72c277e9b Bump maven-pmd-plugin from 3.20.0 to 3.21.1 2023-11-23 12:24:39 +01:00
Andreas Dangel 2939e3e091 Bump build-tools from 22 to 23-SNAPSHOT 2023-11-23 12:24:18 +01:00
sandhu5 49bf440634 Fix flaky SummaryHTMLRenderer 2023-11-22 23:01:06 -06:00
Andreas Dangel bdc08e44fd [doc] Fix dead links checker 2023-11-18 11:21:17 +01:00
Andreas Dangel 0aa781c3ab [compat6] Update version to use 7.0.0-SNAPSHOT 2023-11-18 10:36:29 +01:00
Andreas Dangel 655d1dc6c3 Prepare release of pmd-compat6 7.0.0-rc4 2023-11-18 10:33:47 +01:00
Andreas Dangel 621dffdf4e Merge pull request #4741 from adangel:pmd-compat6-module
Add pmd-compat6 module for maven-pmd-plugin #4741
2023-11-18 10:28:50 +01:00
Andreas Dangel 4df11b35f1 [doc] Improve release notes, migration guide 2023-11-18 10:28:04 +01:00
Andreas Dangel 1e331f08b4 Fix property name skip-pmd-compat6 2023-11-18 10:16:57 +01:00
Andreas Dangel 3870c8694c [doc] Update release procedure 2023-11-18 10:10:02 +01:00
Andreas Dangel 42b336c4a5 [doc] Update release notes (#4736) 2023-11-16 14:59:06 +01:00
Andreas Dangel 7432ae5a9b Update build scripts to use BUILD_CLI_DIST_ONLY 2023-11-16 14:58:26 +01:00
Andreas Dangel e286135c70 Build modules cli and dist, unless property "skip-cli-dist" is set 2023-11-16 10:47:49 +01:00
Andreas Dangel 1c8c5cf434 Bump pmdtester from 1.5.4 to 1.5.5 2023-11-16 10:27:54 +01:00
Andreas Dangel aed95e6870 Remove unused imports 2023-11-14 21:07:37 +01:00
Andreas Dangel 94cdd8a022 [doc] Update release notes and migration guide (#4717) 2023-11-14 20:44:04 +01:00
Andreas Dangel a0814be895 Test formats csv and txt for PMD 2023-11-14 20:31:15 +01:00
Andreas Dangel 9dd646a030 Support formats csv and txt for CPD 2023-11-14 20:21:21 +01:00
Andreas Dangel 9176d3393f Merge branch 'experimental-apex-parser' into issue-4722-apex-fixes 2023-11-10 12:02:15 +01:00
Andreas Dangel 5d72bd8deb Merge branch 'master' into experimental-apex-parser 2023-11-10 11:55:18 +01:00
Andreas Dangel 16967d3c60 Merge pull request #4719 from ciufudean:master
[java] UnnecessaryCaseChange: example doc toUpperCase() should compare to a capitalized string #4719
2023-11-10 09:23:08 +01:00
Andreas Dangel 9c71f587c6 Add @ciufudean as a contributor 2023-11-10 09:18:48 +01:00
Andreas Dangel 5aaaf2b5ec [doc] Update release notes (#4719) 2023-11-10 09:18:29 +01:00
Andreas Dangel 1140aa2d00 Merge pull request #4724 from Monits:pattern-properties
[java] Make allowExceptionNameRegex a Regex #4724
2023-11-10 09:13:36 +01:00
Andreas Dangel e4d9a02824 [doc] Update release notes (#1027, #4724) 2023-11-10 09:12:39 +01:00
Juan Martín Sotuyo Dodero 4ac1d5f5f3 Bump snayeyaml dependency 2023-11-10 08:57:57 +01:00
Andreas Dangel 9037f708ba Merge pull request #4738 from ethauvin:master
[doc] Added reference to the PMD extension for bld
2023-11-10 08:53:06 +01:00
Andreas Dangel dabd1b1a35 [doc] Update release notes (#4738) 2023-11-10 08:52:36 +01:00
Andreas Dangel 6567cfe0cf Add @ethauvin as a contributor 2023-11-10 08:52:23 +01:00
Andreas Dangel 08de860ed9 [doc] Link to correct pages of build tools from index 2023-11-10 08:51:57 +01:00
Andreas Dangel dd2bb98aa0 Fix PMD dogfood issue 2023-11-09 21:57:21 +01:00
Andreas Dangel 64d20e0368 Fix it verification scripts, only build for java11 2023-11-09 21:29:20 +01:00
Andreas Dangel 1c43a4689c Log failing integration tests 2023-11-09 20:58:41 +01:00
Andreas Dangel b5d0ffb02f New pmd-compat6 module
This makes it possible to use PMD7 with maven-pmd-plugin
2023-11-09 20:02:23 +01:00
Andreas Dangel bd28fbea5e Merge branch 'master' into issue-4722-apex-fixes 2023-11-09 11:56:45 +01:00
Andreas Dangel 50bc72d057 [ci] regression tester: Use new regression tester
This should include the fix for pmd/pmd-regression-tester#121
2023-11-09 11:54:46 +01:00
Andreas Dangel 633d7b30f4 [ci] regression tester: Disable multithreading for now
This should fix some of the parsing errors.
2023-11-09 11:53:33 +01:00
Andreas Dangel 195d56d8d0 [apex] Verify qualified names for method arguments with generics
Note: previously, there was no space between type params, now there is.

Refs #4722
2023-11-09 11:51:13 +01:00
Andreas Dangel 31a1b86769 [apex] Fix formal comment handling for Fields
Note: Apex Jorje variant didn't consider comments for fields at all.

Refs #4722
2023-11-09 10:42:46 +01:00
Andreas Dangel e33fe924e9 [apex] Fix ApexDoc for interface methods
Interface methods are implicit public and abstract

Refs #4722
2023-11-09 09:38:21 +01:00
Andreas Dangel 83e6377752 [apex] Fix FieldNamingConventions reporting wrong lines
Using now FieldDeclarations instead of Fields for report location.

Refs #4722
2023-11-09 09:15:32 +01:00
Andreas Dangel d586a3d23e [apex] Fix FieldDeclarationsShouldBeAtStartRule reporting wrong lines
Using now FieldDeclarations instead of Fields for report location.

Refs #4722
2023-11-07 20:05:30 +01:00
Andreas Dangel 3428baec4f [apex] AvoidDeeplyNestedIfStmts - add test
now the reported violations are correct: each if block is reported.
With Apex Jorje, the line numbers of the second if block were wrong and
two violations on the same line were
reported.
2023-11-07 19:52:44 +01:00
Andreas Dangel cd6712598e [apex] Fix EmptyStatementBlock false positive with empty catch
For empty catch blocks, there is the separate rule EmptyCatchBlock.
EmptyStatementBlock shouldn't report these.

Refs #4722
2023-11-07 19:33:04 +01:00
Andreas Dangel 4574cb251c [apex] Fix AvoidNonExistentAnnotationsRule for enum values 2023-11-05 21:42:29 +01:00
Andreas Dangel cf51fa2c45 [apex] Fix AntlrVersionCheckSuppression
This must not be called in multiple threads as we otherwise stop logging
to System.err.
2023-11-05 19:28:23 +01:00
Erik C. Thauvin 057f0ac40c Added reference to the PMD extension for bld 2023-11-04 17:03:28 -07:00
Andreas Dangel c5503c938f Merge pull request #4677 from tprouvot:feature/apex/avoidGetGlobalDescribesInLoops
[apex] Add new rule: OperationWithHighCostInLoop #4677
2023-10-28 12:55:33 +02:00
Andreas Dangel 5f5c63bab9 [apex] OperationWithHighCostInLoop: add test for SObjectDescribeOptions 2023-10-28 12:25:27 +02:00
Andreas Dangel 49a3a96ec9 [doc] Update release notes (#4675, #4677) 2023-10-28 12:16:04 +02:00
Andreas Dangel 8b4f677774 Merge branch 'master' into pr-4677 2023-10-28 12:10:35 +02:00
Andreas Dangel c7cc050983 [apex] OperationWithHighCostInLoop - support System.Schema... as well
And improve test cases
2023-10-28 12:07:23 +02:00
Andreas Dangel 95609960ac [apex] OperationWithHighCostInLoop - improve rule doc 2023-10-28 11:52:59 +02:00
Andreas Dangel 6d240b2a75 [apex] performance.xml - sort rules alphabetically 2023-10-28 11:24:56 +02:00
Andreas Dangel df52c374ee Merge pull request #4673 from wener-tiobe:patch-2
[javascript] CPD: Added support for decorator notation #4673
2023-10-26 17:11:34 +02:00
Andreas Dangel db45dcd6db Fix tests 2023-10-26 16:45:06 +02:00
Andreas Dangel e29cb490e0 [doc] Update release notes (#4673) 2023-10-26 16:39:32 +02:00
Andreas Dangel 567bf9ed71 [javascript] Separate @ from Identifier 2023-10-26 16:39:28 +02:00
Andreas Dangel 59a23b1f8a Merge branch 'master' into pr-4673 2023-10-26 16:25:34 +02:00
Andreas Dangel 1111004991 [cli] Disable closures in annotations feature of picocli
This makes it probably a bit faster and doesn't leave an open groovy
jar file behind.
2023-10-26 15:50:21 +02:00
Andreas Dangel bf55388e51 [java] Explicitly closing the URLClassLoader of the JrtFileSystemProvider 2023-10-26 15:50:15 +02:00
Andreas DangelandClément Fournier d4725e6c1b [java] Improve logging of aux classpath
This includes some stats in AsmSymbolResolver.

Co-authored-by: Clément Fournier <clement.fournier@tu-dresden.de>
2023-10-26 15:49:57 +02:00
Andreas DangelandClément Fournier 14ef905fab Use Math.max
Co-authored-by: Clément Fournier <clement.fournier@tu-dresden.de>
2023-10-26 15:46:55 +02:00
Andreas Dangel a643c3ce29 Revert "Add close routines for class stubs"
This reverts commit 644f85836b.
2023-10-26 10:16:51 +02:00
Andreas Dangel 19a9a4bd36 Revert "Improve stats reporting"
This reverts commit 5355594b51.
2023-10-26 10:16:44 +02:00
Andreas Dangel 37a75bd94e Merge branch 'master' into support-jrt-fs 2023-10-26 10:02:11 +02:00
Juan Martín Sotuyo Dodero 95ec080bf1 Bump Groovy to 4.0.15
- We now support parsing all Groovy features from Groovy 3 and 4
 - Support for 5 is not included as it would not work with Java 8
 - Along the way, this also fixes #4674
2023-10-21 02:07:56 -03:00
Andreas Dangel 20a7f612d8 Merge pull request #4594 from Monits:runtime-completion
[cli] Change completion generation to runtime #4594
2023-10-20 12:46:35 +02:00
Andreas Dangel ec3abf0ca2 [doc] Update release notes (#4594) 2023-10-20 11:45:58 +02:00
Andreas Dangel 1951c68589 [java] Revert unrelated change in LawOfDemeter.xml 2023-10-20 11:39:30 +02:00
Andreas Dangel 3d0839dd64 Merge pull request #4670 from pmd/dependabot/github_actions/master/actions/checkout-4
Bump actions/checkout from 3 to 4
2023-10-20 11:29:00 +02:00
Andreas Dangel 504a21cf76 [doc] Update sidebar
The new XML rule introduced xml-bestpractices...
2023-10-20 11:27:02 +02:00
Andreas Dangel bc005a2c61 [doc] Update release notes (#3175, #4659, #4669, #4723, #4640) 2023-10-20 11:05:27 +02:00
Juan Martín Sotuyo Dodero 981f44406f Merge pull request #4686 from adangel/remove-apexversion
[apex] Remove ApexNode.getApexVersion()
2023-10-19 23:56:33 -03:00
Juan Martín Sotuyo Dodero 93f5a68218 Make allowExceptionNameRegex a Regex 2023-10-19 22:00:34 -03:00
Juan Martín Sotuyo Dodero b355e11c17 Merge pull request #4705 from adangel/issue-4645-CommentDefaultAccessModifier
[java] CommentDefaultAccessModifier: Fix ParameterizedTest annotation
2023-10-19 21:43:13 -03:00
Juan Martín Sotuyo Dodero 4c590a71bd Merge branch 'master' into issue-4645-CommentDefaultAccessModifier 2023-10-19 21:42:36 -03:00
Juan Martín Sotuyo Dodero 8e3d60a772 Merge branch 'master' into remove-apexversion 2023-10-19 21:34:35 -03:00
Juan Martín Sotuyo Dodero ef57fb643f Merge pull request #4669 from adangel/doc-bld-tool
[doc] Add bld PMD Extension to Tools / Integrations
2023-10-19 21:13:51 -03:00
Juan Martín Sotuyo Dodero 3b44f93f39 Merge pull request #4661 from adangel/issue-3175-doc-language-modules
[doc] Update language modules
2023-10-19 21:11:52 -03:00
Juan Martín Sotuyo Dodero 854d6e5c05 Merge branch 'master' into issue-3175-doc-language-modules 2023-10-19 21:11:32 -03:00
Juan Martín Sotuyo Dodero be429e9a3d Merge pull request #4659 from adangel/issue-4658-doc-ant-tasks
[ant] Improve documentation
2023-10-19 21:06:10 -03:00
Juan Martín Sotuyo Dodero 5bb4a9290d Add @shai-bennathan as a contributor 2023-10-19 20:59:28 -03:00
Juan Martín Sotuyo Dodero e0633a1c65 Update changelog refs #4640 2023-10-19 20:46:57 -03:00
Juan Martín Sotuyo Dodero 2fa80cbc34 Merge branch 'pr-4640' 2023-10-19 20:44:11 -03:00
Juan Martín Sotuyo Dodero 0e94fe55d1 Fix issue for conf dir too 2023-10-19 20:43:17 -03:00
Juan Martín Sotuyo Dodero a768230ca8 Merge pull request #4612 from adangel/multithreading-errors
[core] Deal with errors from threads in multithreading mode
2023-10-19 20:38:03 -03:00
Juan Martín Sotuyo Dodero 2e4e1275d4 Merge branch 'master' into runtime-completion 2023-10-19 20:32:19 -03:00
Juan Martín Sotuyo Dodero 974092b7b9 Update javadoc to reflect new behavior 2023-10-19 20:30:25 -03:00
Juan Martín Sotuyo Dodero 508034d4dd Assume pmd is in the PATH already when enabling completion 2023-10-19 20:27:04 -03:00
Juan Martín Sotuyo Dodero 7792404e7d Don't hide the completion command 2023-10-19 20:24:26 -03:00
Andreas Dangel fb468ada4d Merge pull request #4702 from adangel:update-experimental-apex-parser
Update experimental apex parser #4702
2023-10-19 11:08:16 +02:00
Andreas Dangel b811d3097e Merge branch 'master' into update-experimental-apex-parser 2023-10-19 11:07:21 +02:00
Andreas Dangel 14b9029e97 Merge pull request #4592 from Monits:xml-declaration
[xml] Add MissingEncoding rule #4592
2023-10-19 10:29:53 +02:00
Andreas Dangel 42c7fb0f17 [doc] release notes (#4592) xml-bestpractices/MissingEncoding 2023-10-19 10:29:21 +02:00
Andreas Dangel 7fc50e434c [xml] MissingEncoding - fix rule metadata 2023-10-19 10:24:45 +02:00
Andreas Dangel e92de6c1da [xml] MissingEncoding - only look at root document element 2023-10-19 10:16:10 +02:00
Andreas Dangel 7b69ff7355 Merge branch 'master' into pr-4592 2023-10-19 10:10:55 +02:00
ciufudean 453685d6c4 toUpperCase() should compare to a capitalized string 2023-10-19 11:09:45 +03:00
Andreas Dangel 0c53b69e82 Merge pull request #4586 from adangel:ruleset-xml
Use explicit encoding in ruleset xml files #4586
2023-10-19 09:41:57 +02:00
Andreas Dangel 2450177da6 [doc] Update release notes (#4586) 2023-10-19 09:40:19 +02:00
Andreas Dangel b9bc6ac58b Merge pull request #4699 from adangel:build-with-java21
Make PMD buildable with java 21 #4699
2023-10-19 09:37:05 +02:00
Andreas Dangel 809e1f8763 [doc] Update release notes (#4699) 2023-10-19 09:35:24 +02:00
Andreas Dangel d983be0a83 [ci] Use ga of java 21 from adoptium 2023-10-19 09:35:04 +02:00
Andreas Dangel 6366dc3d97 Bump byte-buddy from 1.12.19 to 1.14.9 2023-10-18 17:24:01 +02:00
Andreas Dangel 546a28aa23 Revert "[core] PmdAnalysisTest: Use concrete class to spy on"
This reverts commit df6a271f4f.
2023-10-18 17:23:26 +02:00
Andreas Dangel e52fecc130 [test] Close the streams in the tests 2023-10-18 16:07:49 +02:00
Andreas Dangel fbf2f77871 [java] Don't cache jar files when loading classes
This makes sure, that the underlying JarFiles are closed
as soon as the streams to read single classes are closed.
2023-10-18 16:07:17 +02:00
Thomas ProuvotandAndreas Dangel f4c3fc02a8 Update pmd-apex/src/main/resources/category/apex/performance.xml
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2023-10-18 15:42:09 +02:00
Thomas ProuvotandAndreas Dangel f0f05c6e2c Update pmd-apex/src/main/resources/category/apex/performance.xml
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2023-10-18 15:41:38 +02:00
Andreas Dangel 95b1150e25 Add @nakul777 as a contributor 2023-10-18 15:06:15 +02:00
Andreas Dangel fc9767b65b [core] XSLTRenderer: Close original writer at the end
Fixes #4717
2023-10-18 15:05:49 +02:00
Debamoy Datta 4aedeec734 #1831 resolved the issue 2023-10-07 17:11:16 +05:30
Andreas Dangel 2bbb193d4e Merge pull request #4561 from adangel:issue-2847-new-rule-explicit-types
[java] New Rule: Use Explicit Types #4561
2023-10-06 19:51:40 +02:00
Andreas Dangel f7c913084a Add @harbulot as a contributor 2023-10-06 19:44:21 +02:00
Andreas Dangel e31c77c101 Merge pull request #4591 from Monits:fix-4578
[java] Fix #4578 - CommentDefaultAccessModifier comment needs to be before annotation if present #4591
2023-10-06 19:43:57 +02:00
Andreas Dangel 01a8a36f49 Merge branch 'master' into pr-4591 2023-10-06 19:15:58 +02:00
Andreas Dangel 8aeb45d9d7 [doc] Update release notes (#2847) 2023-10-06 19:06:57 +02:00
Andreas Dangel e9ed7dc25c [java] Fix quickstart ruleset for new rule UseExplicitTypes 2023-10-06 19:06:42 +02:00
Andreas Dangel 4ca9b26abb Merge branch 'master' into issue-2847-new-rule-explicit-types 2023-10-06 19:01:53 +02:00
Andreas Dangel c071143880 [java] CommentDefaultAccessModifier: Fix ParameterizedTest annotation
Fixes #4645
2023-10-06 18:58:15 +02:00
Andreas Dangel 8528a8ed7d Merge branch 'master' into experimental-apex-parser 2023-10-02 19:40:59 +02:00
Andreas Dangel 89c7da82f4 [doc] Restore release notes for next rc 2023-09-30 20:52:56 +02:00
Andreas Dangel 70e25642ff [ci] Fix build scripts 2023-09-30 20:44:03 +02:00
Andreas Dangel 96e897ecdd Prepare next development version [skip ci] 2023-09-30 17:16:58 +02:00
Andreas Dangel 345bb24a25 [release] prepare for next development iteration 2023-09-30 17:15:59 +02:00
Andreas Dangel df6a271f4f [core] PmdAnalysisTest: Use concrete class to spy on
This makes mockito be happy even with java21.
2023-09-29 14:56:20 +02:00
Andreas Dangel 3e7e050251 [apex] Remove ApexNode.getApexVersion() 2023-09-22 19:39:42 +02:00
Andreas Dangel 672afa95c0 [core] CLI - make sure positional inputPaths are not lost 2023-09-22 19:11:11 +02:00
Andreas Dangel a281e3d518 Add @Scrates1 as a contributor 2023-09-22 17:31:19 +02:00
Andreas Dangel ed61460401 [doc] Update release notes (#4676) 2023-09-22 17:30:14 +02:00
Andreas Dangel 428dce72e8 [doc] Clarify CPD CLI for --ignore-identifiers and such
Fixes #4676
2023-09-22 17:26:55 +02:00
Andreas Dangel a91e7f8310 [core] Improve logging for CPD 2023-09-22 16:59:00 +02:00
Andreas Dangel 93d3d73666 Merge pull request #4479 from aaronhurst-google:experimental-apex-parser
Merge main (7.x) branch into experimental-apex-parser and fix tests #4479
2023-09-22 12:08:23 +02:00
Andreas Dangel e191bb913a Fix unused import 2023-09-21 17:31:09 +02:00
Andreas Dangel cc7d97ccb9 [vf] Restore test ApexClassPropertyTypesVisitorTest 2023-09-21 17:21:36 +02:00
Andreas Dangel 3757191d4b [apex] Refactor AntlrVersionCheckSuppression 2023-09-21 17:20:39 +02:00
Andreas Dangel b015bda6ce [apex] Use current languageVersion for ApexVersion property 2023-09-21 17:05:52 +02:00
Andreas Dangel 55ee8b3461 [apex] Improve handling of <clinit> and such... 2023-09-21 16:47:58 +02:00
Andreas Dangel 22f5a09715 Fix pmd issues - LooseCoupling 2023-09-14 11:03:28 +02:00
Thomas Prouvot 2d7521401d Add apex new rule OperationWithHighCostInLoop 2023-09-14 10:10:37 +02:00
Andreas Dangel 82bc73c825 Merge branch 'master' into pr-4479 2023-09-14 09:56:38 +02:00
Andreas Dangel 30416aee1a [apex] ASTMethod#getImage - Use BaseApexClass
Refs #4479
2023-09-14 09:34:14 +02:00
Andreas Dangel 17601960a3 [core][apex] Support TextDocument#offsetAtLineColumn
- not for FragmentedTextDocuments

Refs #4479
2023-09-14 09:33:31 +02:00
wener ec36fcc52f Fixed stylecheck issue. 2023-09-12 13:09:49 +02:00
wener dca539b841 Added unittest for decorators. 2023-09-12 11:30:34 +02:00
Wener 940585de9a Update TypeScriptTokenizerTest.java 2023-09-12 11:05:21 +02:00
Wener e0b3d206c2 Create decorator.ts 2023-09-12 10:50:05 +02:00
Wener 836230b7e7 Added support for "@" in identifiers
This is to resolve the following error on a typescript file:

[main] ERROR net.sourceforge.pmd.cli - Error while tokenizing: Lexical error in file '.\TableList.js' at
 line 67, column 1: "@" (64), after : "" (in lexical state DEFAULT)
2023-09-12 10:36:12 +02:00
dependabot[bot] c7401e130b Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-11 03:41:17 +00:00
Andreas Dangel 518a5ee747 [doc] Add style for blockquotes 2023-09-09 12:00:41 +02:00
Andreas Dangel 839539d14b [doc] Add bld PMD Extension to Tools / Integrations 2023-09-09 11:48:18 +02:00
Andreas Dangel 52381a2acb Update TODO [skip ci] 2023-09-08 21:12:44 +02:00
Andreas Dangel ced61fb9bf [doc] Create experimental features page 2023-09-08 21:08:40 +02:00
Andreas Dangel 6978f4020c [doc] Improve language docs
- add links to language docs
- make summary consistent
- rename TSql -> T-SQL
2023-09-08 21:01:54 +02:00
Andreas Dangel 039f5fbd85 [doc] Improve language docs 2023-09-05 19:53:21 +02:00
Andreas Dangel 81b1d7e32b [doc] Add tags PmdCapableLanguage and CpdCapableLanguage 2023-09-04 19:18:50 +02:00
Andreas Dangel 92b2718da7 Fix unit test 2023-09-04 19:09:21 +02:00
Andreas Dangel 91a1c21680 [doc] jdoc tag: Report location incl. linenumber for warnings 2023-09-01 13:00:45 +02:00
Andreas Dangel 107b8e5b67 [doc] Add pages for all supported language 2023-09-01 12:13:56 +02:00
Andreas Dangel ca40dc41b0 [doc] Add language info summary 2023-09-01 09:41:46 +02:00
Andreas Dangel 291a5aa956 [doc] Update language module docs (apex, java, visualforce) 2023-08-31 17:17:54 +02:00
Andreas Dangel 6e61b9f2a8 [ant] Improve documentation
Refs #4658
2023-08-31 14:42:53 +02:00
Andreas Dangel 5d873fd241 Merge branch 'master' into issue-2847-new-rule-explicit-types 2023-08-28 20:26:17 +02:00
Andreas Dangel e33be0ba48 [java] UseExplicitTypes - move to category codestyle 2023-08-28 20:26:05 +02:00
Andreas Dangel 34cd92c55e [java] UseExplicitTypes - improve rule documentation 2023-08-28 19:42:22 +02:00
Shai BennathanandJuan Martín Sotuyo Dodero 56ae02ad35 Update pmd-dist/src/main/resources/scripts/pmd
Co-authored-by: Juan Martín Sotuyo Dodero <juansotuyo@gmail.com>
2023-08-07 15:32:11 +03:00
Shai Bennathan 295ee304a4 Issue: Launch failure via bin/bash
Currently if run.sh is launched via 'bin/bash run.sh', when run.sh is not in the local directory (i.e., accessed via path env var) it thinks it runs in the local directory.
This change makes sure that all cases are covered.
Tested on local Ubuntu 22.04.
2023-08-07 12:51:09 +03:00
Clément Fournier 310f68aa52 Fix line/col numbers in TokenMgrError
Ref #4635

Col number of zero may happen when the error is reported
on a newline. In the rest of PMD a newline is considered
to sit at the last index of the previous line. So the index
is now the first character of the next line, which is slightly
wrong but that doesn't matter much.
2023-07-26 17:17:54 +02:00
Clément Fournier 5355594b51 Improve stats reporting 2023-07-07 17:19:08 +02:00
Clément Fournier 644f85836b Add close routines for class stubs 2023-07-07 17:05:17 +02:00
Andreas Dangel c4df61d257 [doc] Update release notes (#4628) [skip ci] 2023-07-06 18:04:48 +02:00
Andreas Dangel 05668150b1 [doc] Add a note for aux classpath missing doc 2023-07-06 17:55:49 +02:00
Andreas Dangel ec2882a4f3 Fix StringIndexOutOfBoundsException for default packages 2023-07-06 17:53:22 +02:00
Andreas Dangel 1fcb1077d0 [core] Support loading classes from runtime images
That's one missing piece to support running PMD on a different JRE
than the one used for analyzing. For Java up to version 8, one can put
lib/rt.jar on the auxclasspath. But since Java 9, the runtime classes
are stored in runtime images, that need to be loaded through the
jrt:/ file system.

Since the jrt-URLs are not connected anymore to a specific runtime
image, AsmSymbolResolver needs to use directly the streams instead
of URLs.

The ClasspathClassLoader is basically disabled to actually load
classes for reflection (#loadClass). In PMD 7, we shouldn't use that
anymore.

See also https://openjdk.org/jeps/220
2023-07-06 17:38:09 +02:00
Clément Fournier b92e7512ee Update rule descriptions,
add test case for #4616
2023-07-02 16:37:06 +02:00
Clément Fournier 34871e97e8 Fix #4618 2023-07-01 17:56:36 +02:00
Andreas Dangel 6fc45493e7 [core] Deal with errors from threads in multithreading mode
If an error occurs in multithreading mode, PMD now
rethrows this. Such errors indicate a serious problem
like incomplete runtime classpath of PMD or other
VM error (out of memory) that shouldn't be swallowed.
2023-06-29 18:56:10 +02:00
Clément Fournier 3599ac8427 Merge branch 'master' into issue4435-unusedAssignment 2023-06-25 19:51:26 +02:00
Clément Fournier 287e5f44ad Fix FP of UnusedAssignment with synchronized 2023-06-24 18:07:36 +02:00
Clément Fournier 9d6a075c34 Fix new FP with SingularField and static fields 2023-06-24 17:52:08 +02:00
Clément Fournier af1d1b4d90 Add couple of tests based on regression tester output 2023-06-24 17:26:05 +02:00
Clément Fournier ba559c1a2b Merge branch 'master' into issue4435-unusedAssignment 2023-06-24 17:16:45 +02:00
Juan Martín Sotuyo Dodero 2fc4cb9929 Remove completion dependency from dist 2023-06-09 11:42:54 -03:00
Juan Martín Sotuyo Dodero 7062d79577 Fix indentation 2023-06-08 10:13:46 -03:00
Juan Martín Sotuyo Dodero 5a55af46d3 Change completion generation to runtime
- We no longer ship a pre-built completion script
 - A hidden subcommand is available to generate it dynamically based on
   actually available languages.
 - We update docs everywhere accordingly.
2023-06-08 00:28:58 -03:00
Juan Martín Sotuyo Dodero febd279be2 Fix import order 2023-06-07 10:10:12 -03:00
Juan Martín Sotuyo Dodero 3bac231516 Fix import order 2023-06-07 00:51:15 -03:00
Juan Martín Sotuyo Dodero 7f66265c1c Update AST tests 2023-06-06 23:07:20 -03:00
Juan Martín Sotuyo Dodero 34a3f792c9 Add test cases 2023-06-05 23:59:41 -03:00
Juan Martín Sotuyo Dodero 59fca83d10 Add a new rule for MissingEncoding
- Enforce XML files have an encoding set in the XML Declaration
2023-06-05 23:59:10 -03:00
Juan Martín Sotuyo Dodero f2c7da364c Expose XML Declaratoin as attributes 2023-06-05 23:58:39 -03:00
Juan Martín Sotuyo Dodero e9ee4a94c6 Update changelog, refs #4578 2023-06-05 23:05:07 -03:00
Juan Martín Sotuyo Dodero 1d6f0a43b5 Be more explicit as to when we want to extend the range 2023-06-05 23:02:59 -03:00
Juan Martín Sotuyo Dodero d1daf9e3fd Allow comment parsing to include comments after
- This is safe even for the last token
 - I don't love the semantics of this… get leading comments vs token
   in, and actually allowing tokens "around"… a lot of this is for
   the AccessNode special case and what we consider "leading" to be for
   those
2023-06-05 19:49:53 -03:00
Juan Martín Sotuyo Dodero e342bfd7f8 Add failing use case for #4578 2023-06-05 19:49:26 -03:00
Clément Fournier baf3417bff Fix compilation issue with regex (illegal escape character) 2023-06-02 15:01:52 +02:00
Andreas Dangel 451a364ed7 Use explicit encoding in internal ruleset files 2023-06-01 17:36:15 +02:00
Andreas Dangel 8a89a4c786 Use explicit encoding in ruleset files 2023-06-01 17:29:24 +02:00
Clément Fournier 5df1d35ded Fix FP with static increment 2023-05-29 14:01:31 +02:00
Clément Fournier 1794f683ae Fix dataflow 2023-05-28 16:31:35 +02:00
Clément Fournier b49043d617 Merge branch 'issue3694-singularfield-static-final' into issue4435-unusedAssignment 2023-05-28 15:43:02 +02:00
Clément Fournier 4c07f66e75 Merge branch 'master' into issue4435-unusedAssignment 2023-05-28 15:12:42 +02:00
Clément Fournier 60367d07ae Fix new FN of ImmutableField 2023-05-21 21:45:46 +02:00
Clément Fournier 076b4cfd41 Merge branch 'master' into issue4435-unusedAssignment 2023-05-21 21:45:37 +02:00
nwcm 49dc7b75b7 Update APEX bind regex match for all possible combinations
Matches variables with underscores
Matches `=:food` and `=: foo`
2023-05-15 10:55:57 +10:00
Andreas Dangel 665187633f [java] Update quickstart.xml ruleset 2023-05-14 11:11:09 +02:00
Andreas Dangel d49178ae5f [java] New Rule: Use Explicit Types
Fixes #2847
2023-05-14 11:05:30 +02:00
Clément Fournier 44a1e5ecae Merge branch 'master' into issue4435-unusedAssignment 2023-05-12 19:34:21 +02:00
Clément Fournier 9502a1deb9 #3694 Make singularfield detect static vars 2023-05-03 18:03:17 +02:00
Clément Fournier 0bc8e50ace Fix ImmutableField 2023-05-03 12:47:45 +02:00
Clément Fournier 1f791df9a1 Update release notes 2023-05-02 23:33:32 +02:00
Clément Fournier 8edbb06bd2 Fix #4435 2023-05-02 23:30:44 +02:00
Clément Fournier edace010f5 Fix an FP with this leaks 2023-05-02 22:45:31 +02:00
Aaron Hurst c26003f8b2 Merge remote-tracking branch 'origin/master' into experimental-apex-parser 2023-04-18 01:04:44 +00:00
Aaron Hurst 48645dea5e Fix visualforce conflicts and test failures. 2023-04-17 23:41:41 +00:00
Aaron Hurst 9a8698915c Fix checkstyle violations. 2023-04-17 22:13:42 +00:00
Aaron Hurst 81c53eefd8 Fix PMD violations. 2023-04-17 15:29:47 +00:00
Aaron Hurst 293afd29f1 Passing testsuite.
Changes include:
  * Create root ASTApexFile nodes
  * Correct source locations
  * Insert comments by offset rather than line/column, using more of the mainline code
  * Removed some unused methods
  * Suppress Summit logger INFO output
  * Suppress some (but not all) ANTLR version mismatch output
2023-04-17 14:25:12 +00:00
Aaron Hurst 50a470af8a Fix compilation errors in test code. 2023-04-06 19:57:52 +00:00
Aaron Hurst 45b3470365 Fix compilation errors.
Changes include:
  * Eliminate ASTFormalComment.getToken()
  * Remove deleted APIs: getLocation, hasSuppressWarningsAnnotationsFor, getModifiers
  * Remove code that was factored into BaseApexClass
  * Replace all references to Jorje in rules
2023-04-05 23:37:24 +00:00
Aaron Hurst d94f5dd2c2 Remove old ApexTreeBuilder 2023-04-05 20:00:49 +00:00
Aaron Hurst 8412124e07 First pass on ApexTreeBuilder compilation.
This included:
  * Passing AbstractApexNode instead of ApexNode during tree building
  * Extending and using TextFileContent to convert line+column (as is native in Summit) to offset
  * Using the new visitor method and interface
  * Adding a top-level ASTApexFile node
2023-04-05 19:45:54 +00:00
Aaron Hurst 88807474f2 Post-merge fixup: node type hierarchy.
* Replace ApexRootNode with BaseApexClass.
  * Remove AbstractApexNodeBase
2023-04-04 18:21:17 +00:00
Aaron Hurst 32a4ca45a3 Merge remote-tracking branch 'origin/master' into experimental-apex-parser 2023-04-03 22:25:04 +00:00
Aaron Hurst 65ec632100 Bump summit-ast to new release 2.1.0 (and remove workaround). 2023-03-31 23:11:20 +02:00
Andreas Dangel 28ac77141a Use apex-parser 2.17.0 2023-03-02 15:11:16 +01:00
Andreas Dangel e97da89056 Merge branch 'master' into experimental-apex-parser 2023-03-02 14:51:29 +01:00
Andreas Dangel a9cbe7edfd Fix typo for @TestVisible annotation 2023-01-14 12:03:00 +01:00
Andreas Dangel 9d05cff8cc Merge branch 'master' into experimental-apex-parser 2023-01-14 11:48:12 +01:00
Andreas Dangel 5c4e5ecf96 Merge pull request #4251 from aaronhurst-google:clean-testsuite
[apex] Summit-AST Apex module - Part 6 Passing testsuite #4251
2023-01-14 11:28:18 +01:00
Aaron Hurst b8ccafa672 Fix checkstyle issue. 2023-01-06 03:53:56 +00:00
Aaron Hurst ebb861a282 Sort children of ASTUserClass to order ASTField nodes earlier, immediately after modifiers.
This matches one observed property in the way that Jorje ordered nodes.

Update the dump test.
2023-01-06 03:50:14 +00:00
Aaron Hurst 58ca81da06 Updated test after removing getApexVersion. 2023-01-06 02:59:44 +00:00
Aaron Hurst b4b9dd2b93 Remove ApexRootNode.getApexVersion.
The deprecation was proposed for master/pmd6.
2023-01-06 01:38:50 +00:00
Aaron Hurst 656dff93da Remove development Maven repository. 2023-01-05 22:54:46 +00:00
Aaron Hurst 60da7bd129 Reduce visibility of ApexCommentBuilder. Remove @Deprecated for new class. 2023-01-03 21:48:50 +00:00
Aaron HurstandAndreas Dangel 8745d00824 Update pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/ast/ASTLiteralExpression.java
Co-authored-by: Andreas Dangel <andreas.dangel@adangel.org>
2023-01-03 16:39:51 -05:00
Aaron Hurst 626aec595b Move guava to a non-test dependency, due to implicit dependencies that were previous satisfied by copy inside Jorje JAR.
Change-Id: Iebbc77d4f1ece8ec4712f749356d877858c14d21
2022-12-02 17:11:30 +00:00
Aaron Hurst 1a5c57155e Update tested return type name to match Summit, which returns the syntactic type name.
Change-Id: I6ea22b890e60f24c2684f85753223f240e33509a
2022-12-02 17:11:30 +00:00
Aaron Hurst 6d35496e0c Property getter and setter methods default to visibility of property.
Change-Id: Ib8d4a2d5941b47c47cbd469c1af5ab5f405b120f
2022-12-02 17:11:30 +00:00
Aaron Hurst e9eafdde3e Change case normalization of primitive from 'ID' to 'Id' to match existing behavior.
Change-Id: I7b3406a60bbc18dc2b1e441b8c0122452f709404
2022-12-02 17:11:30 +00:00
Aaron Hurst 16a492f66d Fix checkstyle violations.
Change-Id: I6c371bdecaf08d306bee7308e94f2f1bc5ef0e4c
2022-12-02 17:11:30 +00:00
Aaron Hurst 8734d45bb8 Fix PMD dogfood issues.
Change-Id: I3371e80418e11766657e7f461d26f440fcd78e79
2022-12-02 17:11:30 +00:00
Aaron Hurst 9fef04fee8 ASTField: store String type name instead of either typeRef or enumValue node.
Change-Id: I1542cdd3da3675a04f36c0b0627ea837e2005ac3
2022-12-02 17:11:30 +00:00
Aaron Hurst 62080c69f2 Refactor ASTMethod to support synthetic definitions, and add a synthetic "invoke" method inside triggers.
Change-Id: I21344a36c9795deffd9c62aa0e768eb6f6742796
2022-12-02 05:46:32 +00:00
Aaron Hurst d57d482035 Remove pmd-visualforce Jorje dependency.
Change-Id: Id580cdfa39b4288c239a496ed4a61afb123b0b2f
2022-12-01 21:32:21 +00:00
Aaron Hurst 19225dc2aa Update test with Jorje vs. Summit source location and node count differences.
Re-enable some tests that were disabled due to Jorje limitations.

Change-Id: Id81582231afcc3b2e9f13ac52860ac0de538f41b
2022-12-01 18:53:08 +00:00
Aaron Hurst 6897164462 Upgrade Summit AST dependency to release version 2.0.0.
Update code to remove reference to deleted MODULO operator.

Change-Id: I39d9f7adc0407aafa9af31d3b2253c6c37c735b1
2022-12-01 18:53:08 +00:00
Aaron Hurst 072bb72daf Update test to use getOp replacement for deprecated and now retired getOperator.
Change-Id: I1fdfc314ede7ccfcfe3e169acaef309ba07c17c1
2022-12-01 18:53:08 +00:00
Aaron Hurst 0524d66abc Update TreeDumper regression test with Summit AST output.
Change-Id: I92b456c124c50ceb20416d69b1d88d0b5405dd89
2022-12-01 18:53:08 +00:00
Aaron Hurst ecad8786af Fix test failure due to incorrect case-sensitive identifier comparison.
Change-Id: I232b8e7ad0ffc5f9ac8beab741e48d90b24063d4
2022-12-01 18:53:08 +00:00
Aaron Hurst 914f6a8d0b Fix test failures related to Boolean cognitive complexity due to (unnecessarily) disabled code.
Change-Id: I45fab6872f5a69910452b6ac2429716b677bd93a
2022-12-01 18:53:08 +00:00
Aaron Hurst ff9de702d5 Replicate previous behavior for type names:
* Case normalize primitive types (e.g. Integer)
* Use type-erased names for super classes and interfaces
* Include type arguments for all other uses

Add documentation.

Change-Id: I9edf979c58a5fcf6f251e93013be85fea22a8be1
2022-12-01 18:53:08 +00:00
Aaron Hurst 701fb53550 Comment position fixup
Change-Id: I06a3bc7afce01d2050c46aa2ca674a7a91fc4c5a
2022-12-01 18:53:07 +00:00
Aaron Hurst 581d4d6ac9 Comments!
* ASTFormalComments: represent and build.
* Mark comment containers
* Populate suppression map

This reuses the existing code to the extent possible.

Makes ApexDocTest pass.

Change-Id: I5843ffa9174f7f501aae551e5d493ee973c3dd45
2022-12-01 18:52:52 +00:00
Aaron Hurst 611d7880f7 Rename former ApexTreeBuilder.java to ApexCommentBuilder.java.
Change-Id: I662171da66517235ce30a701ed84b687edfdb3a3
2022-12-01 18:51:08 +00:00
Aaron Hurst fb32ba3ab0 Translate EnumValue node to ASTField.
Change-Id: Iec7c8335b966b243a63243ad631193b82598808b
2022-12-01 18:51:05 +00:00
Aaron Hurst 157558c7c1 Add back ApexTreeBuilder.java.
Change-Id: I6fb29b07e3679f333cae37fe28dfd8b14c8d4a20
2022-12-01 18:50:09 +00:00
Aaron Hurst 4fbe0deb13 Upgrade Summit to 1.1.0 (snapshot).
Make updates related to new VariableDeclarationGroup.

Translate SOQL and SOSL expressions and bindings.

Change-Id: I18995800e292cabe9f61176fa7aefedfc9729def
2022-12-01 18:50:02 +00:00
Edward Klimoshenko 1f438e67ed Fix b/243977405
- Don't build the `exceptionVariable` property of `CatchBlock` nodes.
  Some rules (e.g. `LocalVariableNamingConventionsRule`) expect the
  parent of every `ASTVariableDeclaration` to be an
  `ASTVariableDeclarationStatements`.
- Fix `LocalVariableNamingConventionsRule` crash.
2022-12-01 18:48:22 +00:00
Edward Klimoshenko da9e1ef23f Update TODO comments
Change-Id: I033160534044936ac2ec416428662024b63e8c5f
2022-12-01 18:48:09 +00:00
Edward Klimoshenko c6ad8fbce6 Allow rules with version checks to properly run 2022-12-01 18:47:25 +00:00
Edward Klimoshenko 9e5d4d48a8 Fix b/243747010
Set `ASTMethod.getImage` to name of type for constructors
2022-12-01 18:47:25 +00:00
Edward Klimoshenko 90aec7a9e1 Fix b/243743042
Fix an unexpected `RuntimeException` from
`AbstractApexNodeBase.getBeginColumn` in instances where a `Node` had a
start column of `0`.
2022-12-01 18:47:25 +00:00
Andreas Dangel 894a92d538 Merge pull request #4242 from aaronhurst-google:merge-6.52-into-experimental-apex-parser
Merge 6.52 into experimental-apex-parser #4242
2022-12-01 13:01:49 +01:00
Andreas Dangel e7c1afb33e Merge pull request #4219 from aaronhurst-google:experimental-apex-parser
[apex] Summit-AST Apex module - Part 5 - annotations, triggers, misc. #4219
2022-12-01 13:00:17 +01:00
Andreas Dangel 6403430cd2 Fix some PMD issues 2022-12-01 12:59:37 +01:00
Andreas Dangel 8e1cd67b81 Fix some checkstyle issues 2022-12-01 12:51:57 +01:00
Aaron Hurst dc5be45339 Merge tag 'pmd_releases/6.52.0' into merge-6.52-into-experimental-apex-parser
Change-Id: I81fd2d8fbb88f29ef3a0c03f3abb5cc44fb44835
2022-11-28 22:24:27 +00:00
Aaron Hurst 07c974cab7 Incorporate feedback from previous code review::
* Make ctor package private
  * ASTExpressionStatement should wrap ExpressionStatement not Expression

Change-Id: Iab7db02ea5bcc55b9e21f9fa3193105abb15bc17
2022-11-18 19:13:07 +00:00
Aaron Hurst 395c83e4d2 Merge branch 'part-5' into experimental-apex-parser
Change-Id: Ib198889016e81e4c5b4490879e76d492d9edbf99
2022-11-18 16:35:17 +00:00
Aaron Hurst c54488ed98 ASTAnnotation: case-normalize names for resolved annotations.
Change-Id: I3ffd845161d8c0604fa8aa8baac6996dcca4c93c
2022-11-18 16:34:30 +00:00
Andreas Dangel 299eeacef6 Merge pull request #4206 from aaronhurst-google:experimental-apex-parser
[apex] Summit-AST Apex module - Part 4 - statements #4206
2022-11-18 10:28:53 +01:00
Aaron Hurst aa3df84a8c ASTField initial value expression is Optional.
Change-Id: I5f5d5d6bc822e6367828e75dbaa3c274af9934ec
2022-11-13 17:16:57 +00:00
Aaron Hurst 77720c28f2 Post-merge fixups.
Change-Id: Iec30525f2b7f2bf41432df4153b56339378ccbf7
2022-11-11 21:06:43 +00:00
Edward Klimoshenko 90c183e7de Add documentation for getName 2022-11-11 20:30:42 +00:00
Edward Klimoshenko 130918e45c Add documentation for VALID_ANNOTATION_NAMES 2022-11-11 20:30:42 +00:00
Edward Klimoshenko 9932571135 Refactor expressionToString
- Handle only `LiteralExpression`s; rename to `literalToString`
- Manually discard other `Expression`s at each client
2022-11-11 20:30:42 +00:00
Edward Klimoshenko 495a3da729 Refactor ASTModifierNode
- Use ImmutableMap
2022-11-11 20:30:42 +00:00
Edward Klimoshenko 1833d9e40a Refactor ASTAnnotation
- Sort annotation names
- Make names lowercase
- Use set for names
2022-11-11 20:30:42 +00:00
Edward Klimoshenko 344efcb1dd Implement CPD ApexTokenizer.tokenize 2022-11-11 20:30:42 +00:00
Edward Klimoshenko c0b0809d1b Build trigger variable expressions 2022-11-11 20:30:42 +00:00
Edward Klimoshenko 13b06388a0 Build trigger declarations 2022-11-11 20:30:42 +00:00
Edward Klimoshenko 1d19594a06 Build enum declarations
Change-Id: Idaf68b2641443c73aa9b39d3d801c189ecdf9638
2022-11-11 20:30:39 +00:00
Edward Klimoshenko bb3690ec95 Implement ASTLiteralExpression.getName
Change-Id: If9e6874b0a2d906da161116ba71176049df2a86c
2022-11-11 20:29:51 +00:00
Edward Klimoshenko 46ac530167 Implement ApexQualifiedName.getOperationString 2022-11-11 20:28:23 +00:00
Edward Klimoshenko bc89e527a5 Generate ASTField nodes 2022-11-11 20:28:23 +00:00
Edward Klimoshenko 955a91e9ce Implement ASTUserInterface.getSuperInterfaceName
Change-Id: Ibb474f3704246fce86f6e1dec6f505a817ca8082
2022-11-11 20:28:19 +00:00
Edward Klimoshenko 39db242880 Implement ASTModifierNode methods 2022-11-11 20:27:14 +00:00
Edward Klimoshenko 38af298622 Build annotation modifiers 2022-11-11 20:27:14 +00:00
Edward Klimoshenko 6d61bd3455 Add utility function to print Expression 2022-11-11 20:27:14 +00:00
Edward Klimoshenko c0bef71816 Build parameter declarations 2022-11-11 20:27:14 +00:00
Aaron Hurst 44ac383146 Merge branch 'part-4' into experimental-apex-parser
Change-Id: I5ccb1172fe6605938f7209cff22a6daa366c6dd0
2022-11-10 23:52:29 +00:00
Andreas Dangel e033205657 Merge branch 'master' into experimental-apex-parser 2022-11-10 17:00:19 +01:00
Andreas Dangel b75c7000b3 Merge pull request #4171 from aaronhurst-google:experimental-apex-parser
[apex] Summit-AST Apex module - Part 3 - initializers #4171
2022-11-10 16:59:08 +01:00
Aaron Hurst 828ccd133d Merge branch 'part-3' into experimental-apex-parser
Change-Id: Ibaef3a59307633647129b4971a382ee85a5c0d53
2022-10-20 15:31:24 +00:00
Andreas Dangel 815b7960c5 Merge pull request #4151 from aaronhurst-google:experimental-apex-parser
[apex] Summit-AST Apex module - Part 2 - expression nodes #4151
2022-10-20 16:03:11 +02:00
Aaron Hurst e4a28b70fd Post-merge fixup. Make new AST constructors package-private.
Change-Id: I9b40bb44474894dfa66ef3ee542a2602a9a084ea
2022-10-17 03:36:37 +00:00
Edward Klimoshenko a57fd96982 Build continue statements 2022-10-17 03:36:15 +00:00
Edward Klimoshenko 04732d86d6 Build break statements 2022-10-17 03:36:15 +00:00
Edward Klimoshenko 3acd9aadfb Build try statements 2022-10-17 03:36:15 +00:00
Edward Klimoshenko 298b99815c Build throw statements 2022-10-17 03:36:15 +00:00
Edward Klimoshenko 91ac513015 Build runAs statements 2022-10-17 03:36:14 +00:00
Edward Klimoshenko d0395462e1 Build return statements 2022-10-17 03:36:14 +00:00
Edward Klimoshenko cf054a1427 Build switch statements 2022-10-17 03:36:14 +00:00
Edward Klimoshenko 75690c383b Build for loops
Change-Id: If1bbe27701e190321f53f19be384be10d2885ec5
2022-10-17 03:36:13 +00:00
Edward Klimoshenko de2bc8083a Build while loops 2022-10-17 03:35:47 +00:00
Edward Klimoshenko 6e5fe57a10 Build do-while loops 2022-10-17 03:35:47 +00:00
Edward Klimoshenko 3321997e08 Build for-each loops
Change-Id: Ica6c9ad3f0da89b4522dbae6f2cc5d80399ea72a
2022-10-17 03:35:47 +00:00
Edward Klimoshenko f813961ec5 Build variable declarations 2022-10-17 03:35:47 +00:00
Edward Klimoshenko bd8e47edd1 Build if statements
Change-Id: I4db2d2dfd028ae820c73f9fcb5fff4fa5e6c3ece
2022-10-17 03:35:47 +00:00
Aaron Hurst 72bb311aba Make AST node constructors package-private.
Change-Id: Iafdf7b08b0f8f456b981c797209735a1c27e0b33
2022-10-17 03:35:44 +00:00
Aaron Hurst 96d10a9d8d Post-merge fixups.
Make AST node constructors package-private.
Cleanup imports.
2022-10-17 03:33:07 +00:00
Edward Klimoshenko c9cd6e3597 Fix buildMapEntry 2022-10-17 03:23:19 +00:00
Edward Klimoshenko 543a1117cd Build sized array initializers 2022-10-17 03:23:19 +00:00
Edward Klimoshenko 3b609c5450 Build map initializers 2022-10-17 03:23:18 +00:00
Edward Klimoshenko 34d540f952 Build values initializers 2022-10-17 03:23:18 +00:00
Edward Klimoshenko 989ea03748 Build constructor initializers
Change-Id: I6c4bc34a85e80302da8ef4043a65b7cbec426ee1
2022-10-17 03:23:18 +00:00
Aaron Hurst f2d0aa4a82 Cleanup import statements.
Change-Id: I715bc3729d7c631993cfcfb6c6f503b959ce4340
2022-10-17 03:22:29 +00:00
Aaron Hurst f7a6fc1442 Code review feedback:
* Removed Kotlin compiler version in submodule pom.xml
* Package-private AST node constructors
* Constructor method naming for getImage and getCanonicalName

Change-Id: I4b2cd2ca0437c480e5fc52cf3147be7a2336f6f7
2022-10-16 17:08:33 +00:00
Aaron Hurst 971e8a2757 Post-merge fixups.
Update summit-ast dependency to latest release.

Change-Id: I14cb01fe198c6fc78dcd90b1f23c44e42c573bba
2022-10-11 17:43:07 +00:00
Aaron Hurst 776a1ad8b3 Merge remote-tracking branch 'eklimo/summit' into experimental-apex-parser
Change-Id: If0e9011847b2fa515faaacc631c0876ac0683d2a
2022-10-11 16:55:05 +00:00
Andreas Dangel 6ee361940a Merge branch 'master' into experimental-apex-parser 2022-10-06 09:37:48 +02:00
Andreas Dangel a06340d6d1 Merge pull request #4093 from eklimo:part-1
[apex] Summit-AST Apex module - Part 1 #4093
2022-10-06 09:37:39 +02:00
Aaron Hurst ba9d48f891 Merge remote-tracking branch 'upstream/experimental-apex-parser' into part-1
Change-Id: I254208dd5d1b9dbf5335a59a51372ec1d55f8535
2022-09-13 23:42:11 +00:00
Edward Klimoshenko a5f91348c8 Build expressions (#8)
* Build expression statements
** Build assignment expressions
** Build array expressions
** Build literal expressions
** Build cast expressions
** Build operator expressions
** Build `this`/`super` expressions
** Build type reference expressions
** Build field/variable expressions
** Build method call expressions

* Build ternary expressions
* Refactor `AbstractApexNode`
** Add default implementations for some methods
** Add empty constructor
** Implement `AbstractApexNode.getDefiningType`

* Fix `ASTLiteralExpression.getImage`

* Implement reference types
** Implement `ASTReferenceExpression.isSObjectType`
** Implement `ASTReferenceExpression.hasRealLoc`
** Fix `ASTEmptyReferenceExpression.getDefiningType`

* Implement `ASTMethodCallExpression.getFullMethodName`

* Update `ASTLiteralExpression.getImage`

* Replace `Triple` with `data class`

* Fix `BITWISE_XOR`

* Replace `Identifier.asCodeString` with `getString`

* Fix call expressions
** Only the `receiver` of `CallExpression`s should be flattened

* Fix `referenceTypeOf`
Reference type should only be `STORE` when the variable is the target of
assignment.

* Rename `ASTMethodCallExpression.components`
2022-08-31 13:09:24 -07:00
Edward Klimoshenko f1a09b92c0 Call additional methods in separate pass 2022-08-18 06:39:31 +00:00
Edward Klimoshenko bb70984745 Build class/interface declarations
- Add `buildChildren` function to tree builder
2022-08-18 06:39:31 +00:00
Edward Klimoshenko 88e187586b Build declaration modifiers
- Add `AbstractApexNode.Many`
2022-08-18 06:39:31 +00:00
Edward Klimoshenko 0557c228af Add new ApexTreeBuilder
- Replace `ApexTreeBuilder.java` with `ApexTreeBuilder.kt`
- Set up tree builder foundation
- Build `TypeDeclaration` nodes
2022-08-18 06:39:31 +00:00
Edward Klimoshenko a32f8c2423 Set top-level Apex node to TypeDeclaration
Replace `CompilationUnit` with `TypeDeclaration` as the top-level node
to match the AST produced by Jorje.
2022-08-18 06:39:31 +00:00
Edward Klimoshenko 2c32d5df54 Add Kotlin compilation to Apex module 2022-08-18 06:39:26 +00:00
Edward Klimoshenko 4181043d74 Invoke SummitAST from ApexParser
- Add call to `SummitAST` in `ApexParser`
- Fix NPE involving `suppressMap` to allow `ApexTreeBuilder` to run
- Remove unused `TopLevelVisitor`
2022-08-18 06:23:47 +00:00
Edward Klimoshenko c9a0f98221 Restructure base classes
Remove `node` field from `AbstractApexNode` to remove restriction of
wrapping a single node. Create `AbstractApexNode.Single` subclass that
wraps a single node.

Other subclasses can be created as needed for common cases, or
`AbstractApexNode` can be extended directly in irregular cases.
2022-08-18 06:23:47 +00:00
Edward Klimoshenko 1c01ee0c64 Deprecate ApexNode type parameter
- Replace `ApexNode` type arguments with `Void`
- Remove `ApexNode.getNode`
- Remove `ASTCommentContainer` type parameter
- Deprecate `ASTUserClassOrInterface` type parameter
2022-08-18 06:23:47 +00:00
Edward Klimoshenko 42f4a09af1 Replace Jorje with Summit-AST
- Remove Jorje dependencies
- Add Summit-AST dependency
- Comment out code until compilation succeeds
2022-08-18 06:23:31 +00:00
Edward Klimoshenko be05581da1 Build field declarations 2022-08-15 02:08:24 -07:00
Edward Klimoshenko f9b514f958 Build property declarations 2022-08-15 02:08:24 -07:00
Edward Klimoshenko 54b871c665 Build block statements 2022-08-15 02:08:24 -07:00
Edward Klimoshenko ea359cb7e4 Implement node locations & line numbers 2022-08-15 02:08:24 -07:00
Edward Klimoshenko ac511ead77 Build method declarations 2022-08-15 02:08:24 -07:00
Edward Klimoshenko 11b71825a7 Condense buildModifiers calls 2022-08-15 02:08:24 -07:00
Edward Klimoshenko fc506a42a3 Refactor building primitives
- Split `setParent` call from main `build` function into new
  `buildAndSetParent`
- Remove list-based `build` function to decrease complexity
- Improve documentation
2022-08-15 02:08:24 -07:00
Edward Klimoshenko 098302c6ff Call additional methods in separate pass 2022-08-15 08:46:48 +00:00
Edward Klimoshenko 2bc5fc9905 Build class/interface declarations
- Add `buildChildren` function to tree builder
2022-08-15 08:46:33 +00:00
Edward Klimoshenko 15f649b5cd Build declaration modifiers
- Add `AbstractApexNode.Many`
2022-08-15 08:46:28 +00:00
Edward Klimoshenko 19c4af57dc Add new ApexTreeBuilder
- Replace `ApexTreeBuilder.java` with `ApexTreeBuilder.kt`
- Set up tree builder foundation
- Build `TypeDeclaration` nodes
2022-08-15 08:46:16 +00:00
Edward Klimoshenko 2f256e0069 Set top-level Apex node to TypeDeclaration
Replace `CompilationUnit` with `TypeDeclaration` as the top-level node
to match the AST produced by Jorje.
2022-08-15 08:46:13 +00:00
Edward Klimoshenko 558d9203c3 Add Kotlin compilation to Apex module 2022-08-15 01:29:53 -07:00
Edward Klimoshenko 99416867e9 Invoke SummitAST from ApexParser
- Add call to `SummitAST` in `ApexParser`
- Fix NPE involving `suppressMap` to allow `ApexTreeBuilder` to run
- Remove unused `TopLevelVisitor`
2022-08-15 01:29:53 -07:00
Edward Klimoshenko f5450f1e2f Restructure base classes
Remove `node` field from `AbstractApexNode` to remove restriction of
wrapping a single node. Create `AbstractApexNode.Single` subclass that
wraps a single node.

Other subclasses can be created as needed for common cases, or
`AbstractApexNode` can be extended directly in irregular cases.
2022-08-14 23:41:42 -07:00
Edward Klimoshenko dee926b6d5 Deprecate ApexNode type parameter
- Replace `ApexNode` type arguments with `Void`
- Remove `ApexNode.getNode`
- Remove `ASTCommentContainer` type parameter
- Deprecate `ASTUserClassOrInterface` type parameter
2022-08-14 23:27:41 -07:00
Edward Klimoshenko 36ca2f345c Remove Jorje leaks outside ast package
Operators
- Create operator enums to wrap internal Jorje operators.
- Create getters returning new operator enums in operator-expression
  nodes. Deprecate old getters.
- Refactor metrics classes to use new operator enums.

Tests
- Remove references to internal Jorje nodes.
2022-08-11 11:10:13 +00:00
Edward Klimoshenko e47df1f5df Replace Jorje with Summit-AST
- Remove Jorje dependencies
- Add temporary local jar dependency for Summit-AST
- Comment out code until compilation succeeds
2022-08-11 11:10:13 +00:00
3340 changed files with 109992 additions and 44590 deletions

No files matched your search

+638 -4
View File
File diff suppressed because it is too large. Load diff
+104 -13
View File
@@ -1,106 +1,174 @@
# PMD CI Scripts
This folder contains scripts used for CI, that are PMD specific.
It uses the common scripts from [build-tools](https://github.com/pmd/build-tools).
Added line: 8803
Added line: 397
Added line: 2389
## .ci/files/public-env.gpg
Added line: 2050
This files contains the following environment variables:
Added line: 893
* DANGER_GITHUB_API_TOKEN: Token for danger to add comments to PRs as <https://github.com/pmd-test>.
Added line: 7092
Added line: 1776
Added line: 1458
Added line: 371
The token needs the scope "public_repo". Note: The default GITHUB_TOKEN can't be used, because
danger runs in pull request builds from fork and the default GITHUB_TOKEN has read-only access there
Added line: 2166
and can't write comments. Therefore the personal access token of the bot account "pmd-test" is used.
pmd-test has no commit permissions, but can comment on any public repo, including pmd/pmd.
Added line: 9706
* PMD_CI_CHUNK_TOKEN: Token for uploading reports to chunk.io
Added line: 2997
Added line: 7686
The file is encrypted, so that the tokens are not automatically disabled when github detects them
in clear text.
**Decrypting**:
Added line: 2218
Added line: 5258
gpg --batch --yes --decrypt --passphrase="GnxdjywUEPveyCD1RLiTd7t8CImnefYr" \
Added line: 6105
--output .ci/files/public-env .ci/files/public-env.gpg
Added line: 2860
**Encrypting**:
gpg --batch --symmetric --cipher-algo AES256 \
Added line: 7658
--armor --passphrase="GnxdjywUEPveyCD1RLiTd7t8CImnefYr" \
--output .ci/files/public-env.gpg .ci/files/public-env
## Local tests with docker
Added line: 2256
Added line: 7698
Using the same docker container as described in [build-env @ build-tools](https://github.com/pmd/build-tools).
Added line: 4848
Added line: 8614
### Testing a push build (snapshot)
Added line: 6717
Added line: 6493
Added line: 2139
Added line: 6240
Start docker without binding to local directory, so that we can do a fresh checkout
Added line: 9468
$ docker run \
Added line: 860
--interactive \
Added line: 7791
--tty \
Added line: 7787
--name pmd-build-env_pmd \
Added line: 1200
Added line: 966
Added line: 8897
Added line: 3773
pmd-build-env:latest
Added line: 7538
Added line: 1343
Added line: 2876
```
export LANG=en_US.UTF-8
export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts
export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/main/scripts
export PMD_CI_SECRET_PASSPHRASE="xyz"
export PMD_CI_DEBUG=true
MAIN_BRANCH="master"
MAIN_BRANCH="main"
Added line: 6291
eval $(~/create-gh-actions-env.sh push pmd/pmd $MAIN_BRANCH)
Added line: 7570
cd /workspaces/pmd
rmdir pmd && mkdir pmd
cd pmd
Added line: 4917
Added line: 3164
git init
git remote add origin https://github.com/pmd/pmd
Added line: 1903
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/${MAIN_BRANCH}:refs/remotes/origin/${MAIN_BRANCH}
git checkout --progress --force -B ${MAIN_BRANCH} refs/remotes/origin/${MAIN_BRANCH}
Added line: 5869
Added line: 5152
f=check-environment.sh; \
mkdir -p .ci && \
Added line: 2051
Added line: 1620
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
chmod 755 .ci/$f && \
.ci/$f
.ci/build.sh
Added line: 9212
Added line: 7311
Added line: 1160
```
Added line: 6015
### Testing a pull request
Added line: 9301
Same as the above, but this line changes:
```
eval $(~/create-gh-actions-env.sh pull_request pmd/pmd $MAIN_BRANCH)
Added line: 6346
```
Added line: 8915
Added line: 4922
Maybe update `/workspaces/event.json` to fill in a real pull request number, so that
Added line: 7442
danger can comment the correct PR.
Added line: 5479
And the checkout must be different. Example for PR 3220:
Added line: 7539
Added line: 7078
```
Added line: 4982
PMD_CI_PULL_REQUEST_NUMBER=3220
cd /workspace/pmd
rmdir pmd && mkdir pmd
cd pmd
Added line: 7346
git init
git remote add origin https://github.com/pmd/pmd
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/pull/${PMD_CI_PULL_REQUEST_NUMBER}/merge:refs/remotes/pull/${PMD_CI_PULL_REQUEST_NUMBER}/merge
git checkout --progress --force refs/remotes/pull/${PMD_CI_PULL_REQUEST_NUMBER}/merge
Added line: 6442
Added line: 5540
Added line: 9041
Added line: 4588
```
### Forked build
Added line: 5245
Added line: 5591
A build executing on a forked repository.
Added line: 5218
Added line: 2624
```
Added line: 7960
Added line: 6452
Added line: 997
$(~/create-gh-actions-env.sh push adangel/pmd $MAIN_BRANCH)
Added line: 695
```
@@ -108,39 +176,63 @@ $(~/create-gh-actions-env.sh push adangel/pmd $MAIN_BRANCH)
```
export LANG=en_US.UTF-8
export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts
export PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/main/scripts
export PMD_CI_SECRET_PASSPHRASE="xyz"
Added line: 9624
export PMD_CI_DEBUG=true
Added line: 9218
TAG_NAME=pmd_releases/6.33.0
Added line: 9734
eval $(~/create-gh-actions-env.sh push pmd/pmd refs/tags/$TAG_NAME)
Added line: 455
cd /workspaces/pmd
Added line: 3217
Added line: 157
Added line: 7411
rmdir pmd && mkdir pmd
cd pmd
Added line: 2538
Added line: 6507
git init
Added line: 6832
Added line: 7703
git remote add origin https://github.com/pmd/pmd
Added line: 3659
git fetch --no-tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/tags/$TAG_NAME:refs/tags/$TAG_NAME
git checkout --progress --force refs/tags/$TAG_NAME
Added line: 4641
Added line: 2311
f=check-environment.sh; \
mkdir -p .ci && \
( [ -e .ci/$f ] || curl -sSL "${PMD_CI_SCRIPTS_URL}/$f" > ".ci/$f" ) && \
Added line: 3275
Added line: 5836
chmod 755 .ci/$f && \
.ci/$f
Added line: 3796
Added line: 59
Added line: 7823
Added line: 1286
Added line: 720
Added line: 9688
Added line: 6803
#
# .ci/build.sh
Added line: 9008
Added line: 2611
#
```
Calling `.ci/build.sh` directly would re-release the tag $TAG_NAME - that's why it is commented out.
All the side-effects of a release would be carried out like creating and publishing a release on github,
Added line: 3239
Added line: 9164
Added line: 3855
uploading the release to sourceforge, uploading the docs to docs.pmd-code.org, uploading a
new baseline for the regression tester and so on. While the release should be reproducible and therefore should
produce exactly the same artifacts, re-uploading artifacts is not desired just for testing.
Added line: 8770
Note that maven-central would not be changed, since this is skipped via MAVEN_OPTS:
`MAVEN_OPTS` contains `-DskipRemoteStaging=true`, so that no maven artifacts are deployed
@@ -154,4 +246,3 @@ Make sure to cleanup after the test, e.g. discard the draft github release.
## Workflow git-repo-sync
Synchronizes the github git repository pmd/pmd on every push to sourceforge.
+95 -66
View File
@@ -19,7 +19,7 @@ function build() {
pmd_ci_log_info "Install openjdk17 for integration tests and pmd-regression-tests"
pmd_ci_openjdk_install_adoptium 17
pmd_ci_log_info "Install openjdk21 for integration tests and pmd-regression-tests"
pmd_ci_openjdk_install_adoptium "21-ea"
pmd_ci_openjdk_install_adoptium 21
PMD_MAVEN_EXTRA_OPTS=(
-Djava8.home="${HOME}/openjdk8"
-Djava17.home="${HOME}/openjdk17"
@@ -36,7 +36,7 @@ function build() {
if pmd_ci_utils_is_fork_or_pull_request; then
pmd_ci_log_group_start "Build with mvnw"
./mvnw clean install --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
./mvnw clean install --show-version --errors --batch-mode -Pgenerate-rule-docs "${PMD_MAVEN_EXTRA_OPTS[@]}"
pmd_ci_log_group_end
# Execute danger and dogfood only for pull requests in our own repository
@@ -68,16 +68,44 @@ function build() {
PMD_MAVEN_EXTRA_OPTS+=(-DskipTests=true)
fi
# make sure, BUILD_CLI_DIST_ONLY is set to false by default
pmd_ci_log_info "BUILD_CLI_DIST_ONLY=${BUILD_CLI_DIST_ONLY}"
: "${BUILD_CLI_DIST_ONLY:=false}"
pmd_ci_log_info "BUILD_CLI_DIST_ONLY=${BUILD_CLI_DIST_ONLY}"
if [ "$(pmd_ci_utils_get_os)" != "linux" ]; then
pmd_ci_log_group_start "Build with mvnw"
pmd_ci_log_group_start "Build with mvnw verify on $(pmd_ci_utils_get_os)"
if pmd_ci_maven_isReleaseBuild; then
pmd_ci_log_info "This is a release version build..."
# There are two possible (release) builds:
if [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then
# a) everything without pmd-cli and pmd-dist
./mvnw clean verify -Dskip-cli-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
else
# b) only pmd-cli and pmd-dist
#
# In the first stage build (without pmd-cli and pmd-dist), cyclonedx:makeAggregateBom tries to
# fetch the jars of the to-be-released modules, which don't exist yet. This is recorded in *.lastUpdated
# files in the local repo and might end up in the cache, that is used for this 2nd stage build.
# Trying to delete the files now, if they exist.
# Alternatively, we could run maven with flag "-U" to force update all dependencies...
pmd_ci_log_info "Cleanup local maven repo..."
find ~/.m2/repository -wholename "*/net/sourceforge/pmd/*/${PMD_CI_MAVEN_PROJECT_VERSION}/*.lastUpdated" | xargs rm -v
pmd_ci_log_info "Cleanup local maven repo finished."
./mvnw clean verify -pl pmd-cli,pmd-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
fi
else
# snapshot build - just verify on the different OS
./mvnw clean verify --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
fi
pmd_ci_log_group_end
pmd_ci_log_info "Stopping build here, because os is not linux"
exit 0
fi
# only builds on pmd/pmd continue here
# only builds on pmd/pmd on linux continue here
pmd_ci_log_group_start "Setup environment"
pmd_ci_setup_secrets_private_env
pmd_ci_setup_secrets_gpg_key
@@ -85,18 +113,6 @@ function build() {
pmd_ci_maven_setup_settings
pmd_ci_log_group_end
if [ "${PMD_CI_BRANCH}" = "experimental-apex-parser" ]; then
pmd_ci_log_group_start "Build with mvnw"
./mvnw clean install --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
pmd_ci_log_group_end
pmd_ci_log_group_start "Creating new baseline for regression tester"
regression_tester_setup_ci
regression_tester_uploadBaseline
pmd_ci_log_group_end
exit 0
fi
pmd_ci_log_group_start "Build and Deploy"
pmd_ci_build_run
pmd_ci_deploy_build_artifacts
@@ -107,17 +123,27 @@ function build() {
pmd_ci_log_group_end
# release is published only for the case b) pmd-cli/pmd-dist release
if pmd_ci_maven_isReleaseBuild && [[ "${PMD_CI_TAG}" == *-dist ]]; then
if pmd_ci_maven_isReleaseBuild && [ "${BUILD_CLI_DIST_ONLY}" = "true" ]; then
pmd_ci_log_group_start "Publishing Release"
pmd_ci_gh_releases_publishRelease "$GH_RELEASE"
pmd_ci_sourceforge_selectDefault "${PMD_CI_MAVEN_PROJECT_VERSION}"
# reconstruct the SF_BLOG_URL - the news entry has been created as draft when running the
# first release stage
local news_title
news_title="PMD ${PMD_CI_MAVEN_PROJECT_VERSION} ($(date -u +%d-%B-%Y)) released"
news_title="${news_title// /-}"
news_title="${news_title//\./}"
news_title="${news_title//\(/}"
news_title="${news_title//\)/}"
news_title="${news_title,,}" # convert to lowercase
SF_BLOG_URL="https://sourceforge.net/rest/p/pmd/news/$(date -u +%Y)/$(date -u +%m)/${news_title// /_}"
pmd_ci_sourceforge_publishBlogPost "$SF_BLOG_URL"
pmd_ci_log_group_end
fi
# create a baseline for snapshot builds (when pmd-dist is built)
# or for release builds for case b) when pmd-cli/pmd-dist is released
if pmd_ci_maven_isSnapshotBuild || [[ "${PMD_CI_TAG}" == *-dist ]]; then
if pmd_ci_maven_isSnapshotBuild || [ "${BUILD_CLI_DIST_ONLY}" = "true" ]; then
pmd_ci_log_group_start "Creating new baseline for regression tester"
regression_tester_setup_ci
regression_tester_uploadBaseline
@@ -133,31 +159,38 @@ function build() {
pmd_ci_log_group_end
pmd_ci_log_group_start "Executing build with sonar"
pmd_ci_openjdk_setdefault 17
# Note: Sonar also needs GITHUB_TOKEN (!)
./mvnw \
-Dmaven.javadoc.skip=true \
-Dmaven.source.skip \
-Dcheckstyle.skip \
-Dpmd.skip \
--show-version --errors --batch-mode \
clean package \
sonar:sonar -Dsonar.login="${SONAR_TOKEN}" -Psonar,cli-dist
sonar:sonar -Dsonar.token="${SONAR_TOKEN}" -Psonar,fastSkip
pmd_ci_log_success "New sonar results: https://sonarcloud.io/dashboard?id=net.sourceforge.pmd%3Apmd"
pmd_ci_log_group_end
pmd_ci_log_group_start "Executing build with coveralls"
pmd_ci_openjdk_setdefault 11
export CI_NAME="github actions"
export CI_BUILD_URL="${PMD_CI_JOB_URL}"
export CI_BRANCH="${PMD_CI_BRANCH}"
# first create jacoco report
./mvnw \
-Dmaven.javadoc.skip=true \
-Dmaven.source.skip \
-Dcheckstyle.skip \
-Dpmd.skip \
-DrepoToken="${COVERALLS_REPO_TOKEN}" \
--show-version --errors --batch-mode \
clean package jacoco:report \
coveralls:report -Pcoveralls,cli-dist
clean package \
jacoco:report -Pcoveralls,fastSkip
# workaround, maybe https://github.com/jacoco/jacoco/issues/654
# we use $ as a regex separator, not a shell variable, so no expansion
# shellcheck disable=SC2016
sed -i 's$Comparisons.kt$ApexTreeBuilder.kt$g' pmd-apex/target/site/jacoco/jacoco.xml
# then create and send coveralls report
# note: generate-sources is needed, so that antlr4 generated directories are on the compileSourceRoots
./mvnw \
--show-version --errors --batch-mode \
generate-sources \
coveralls:report -DrepoToken="${COVERALLS_REPO_TOKEN}" -Pcoveralls,fastSkip
pmd_ci_log_success "New coveralls result: https://coveralls.io/github/pmd/pmd"
pmd_ci_log_group_end
fi
@@ -165,11 +198,12 @@ function build() {
#
# Installs bundler, which is needed for doc generation and regression tester
# Bundler should be already installed - it should be included in the ruby distribution.
# Bundler is needed for doc generation and regression tester
#
function pmd_ci_build_setup_bundler() {
pmd_ci_log_info "Installing bundler..."
gem install bundler
pmd_ci_log_info "Checking bundler version..."
bundle --version
}
#
@@ -185,16 +219,16 @@ function pmd_ci_build_run() {
mvn_profiles="${mvn_profiles},pmd-release"
# There are two possible (release) builds:
if [[ "${PMD_CI_TAG}" != *-dist ]]; then
# a) pmd-core and languages modules
./mvnw clean deploy -P"${mvn_profiles}",'!cli-dist' --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
if [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then
# a) everything without pmd-cli and pmd-dist
./mvnw clean deploy -P"${mvn_profiles}" -Dskip-cli-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
else
# b) pmd-cli and pmd-dist
./mvnw clean deploy -pl pmd-cli,pmd-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
# b) only pmd-cli and pmd-dist
./mvnw clean deploy -P"${mvn_profiles}" -pl pmd-cli,pmd-dist --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
fi
else
pmd_ci_log_info "This is a snapshot build"
./mvnw clean deploy -P"${mvn_profiles},cli-dist" --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
./mvnw clean deploy -P"${mvn_profiles}" --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}"
fi
}
@@ -208,27 +242,23 @@ function pmd_ci_deploy_build_artifacts() {
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-bin.zip"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-src.zip"
# Deploy SBOM
cp pmd-dist/target/bom.xml "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml"
cp pmd-dist/target/bom.json "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json"
fi
# release build case a): only pmd-core and language modules released
if pmd_ci_maven_isReleaseBuild && [[ "${PMD_CI_TAG}" != *-dist ]]; then
# release build case a): everything without pmd-cli and pmd-dist is released
if pmd_ci_maven_isReleaseBuild && [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then
# create a draft github release
pmd_ci_gh_releases_createDraftRelease "${PMD_CI_TAG}" "$(git rev-list -n 1 "${PMD_CI_TAG}")"
GH_RELEASE="$RESULT"
fi
# release build case b): pmd-cli and pmd-dist are released
if pmd_ci_maven_isReleaseBuild && [[ "${PMD_CI_TAG}" == *-dist ]]; then
# release build case b): only pmd-cli and pmd-dist are released
if pmd_ci_maven_isReleaseBuild && [ "${BUILD_CLI_DIST_ONLY}" = "true" ]; then
# Deploy to sourceforge files https://sourceforge.net/projects/pmd/files/pmd/
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-bin.zip"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-src.zip"
# Deploy SBOM
cp pmd-dist/target/bom.xml "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml"
cp pmd-dist/target/bom.json "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.xml"
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-${PMD_CI_MAVEN_PROJECT_VERSION}-cyclonedx.json"
@@ -250,20 +280,23 @@ function pmd_ci_deploy_build_artifacts() {
# Renders release notes and uploads them as ReadMe.md to sourceforge
#
function pmd_ci_build_and_upload_doc() {
pmd_doc_generate_jekyll_site
pmd_doc_create_archive
# generate the site only for snapshots from main and for release builds for case a) (everything without cli/dist)
# to avoid building it twice during a release...
if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "main" ] || [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then
pmd_doc_generate_jekyll_site
pmd_doc_create_archive
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
if pmd_ci_maven_isReleaseBuild && [[ "${PMD_CI_TAG}" != *-dist ]]; then
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
fi
pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
# Deploy doc to https://docs.pmd-code.org/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/
pmd_code_uploadDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
# Deploy javadoc to https://docs.pmd-code.org/apidocs/*/${PMD_CI_MAVEN_PROJECT_VERSION}/
pmd_code_uploadJavadoc "${PMD_CI_MAVEN_PROJECT_VERSION}" "$(pwd)"
if pmd_ci_maven_isReleaseBuild; then
pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
fi
# Deploy doc to https://docs.pmd-code.org/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/
pmd_code_uploadDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip"
# Deploy javadoc to https://docs.pmd-code.org/apidocs/*/${PMD_CI_MAVEN_PROJECT_VERSION}/
pmd_code_uploadJavadoc "${PMD_CI_MAVEN_PROJECT_VERSION}" "$(pwd)"
if pmd_ci_maven_isSnapshotBuild || [[ "${PMD_CI_TAG}" != *-dist ]]; then
# render release notes
# updating github release text
rm -f .bundle/config
@@ -279,8 +312,8 @@ function pmd_ci_build_and_upload_doc() {
pmd_ci_sourceforge_uploadReleaseNotes "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "${rendered_release_notes}"
fi
if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "master" ]; then
# only for snapshot builds from branch master: https://docs.pmd-code.org/snapshot -> pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}
if pmd_ci_maven_isSnapshotBuild && [ "${PMD_CI_BRANCH}" = "main" ]; then
# only for snapshot builds from branch main: https://docs.pmd-code.org/snapshot -> pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}
pmd_code_createSymlink "${PMD_CI_MAVEN_PROJECT_VERSION}" "snapshot"
# update github pages https://pmd.github.io/pmd/
@@ -289,7 +322,7 @@ function pmd_ci_build_and_upload_doc() {
pmd_ci_sourceforge_rsyncSnapshotDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "snapshot"
fi
if pmd_ci_maven_isReleaseBuild && [[ "${PMD_CI_TAG}" != *-dist ]]; then
if pmd_ci_maven_isReleaseBuild && [ "${BUILD_CLI_DIST_ONLY}" = "false" ]; then
# documentation is already uploaded to https://docs.pmd-code.org/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}
# we only need to setup symlinks for the released version
pmd_code_createSymlink "${PMD_CI_MAVEN_PROJECT_VERSION}" "latest"
@@ -321,12 +354,8 @@ ${rendered_release_notes}"
#
function pmd_ci_dogfood() {
local mpmdVersion=()
./mvnw versions:set -DnewVersion="${PMD_CI_MAVEN_PROJECT_VERSION}-dogfood" -DgenerateBackupPoms=false
./mvnw versions:set -DnewVersion="${PMD_CI_MAVEN_PROJECT_VERSION%-SNAPSHOT}-dogfood-SNAPSHOT" -DgenerateBackupPoms=false
sed -i 's/<version>[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}.*<\/version>\( *<!-- pmd.dogfood.version -->\)/<version>'"${PMD_CI_MAVEN_PROJECT_VERSION}"'<\/version>\1/' pom.xml
if [ "${PMD_CI_MAVEN_PROJECT_VERSION}" = "7.0.0-SNAPSHOT" ]; then
sed -i 's/pmd-dogfood-config\.xml/pmd-dogfood-config7.xml/' pom.xml
mpmdVersion=(-Denforcer.skip=true -Dpmd.plugin.version=3.21.1-pmd-7.0.0-SNAPSHOT)
fi
./mvnw verify --show-version --errors --batch-mode "${PMD_MAVEN_EXTRA_OPTS[@]}" \
"${mpmdVersion[@]}" \
-DskipTests \
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="All Regression Rules"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
+1 -1
View File
@@ -4,7 +4,7 @@ function fetch_ci_scripts() {
local inc_dir
local inc_url
inc_dir="$(dirname "$0")/inc"
inc_url="${PMD_CI_SCRIPTS_URL:-https://raw.githubusercontent.com/pmd/build-tools/master/scripts}/inc"
inc_url="${PMD_CI_SCRIPTS_URL:-https://raw.githubusercontent.com/pmd/build-tools/main/scripts}/inc"
mkdir -p "${inc_dir}"
+2 -1
View File
@@ -19,8 +19,9 @@ function regression_tester_setup_ci() {
source .ci/files/public-env >/dev/null 2>&1
rm .ci/files/public-env
if hash "bundler" 2>/dev/null; then
if hash "bundle" 2>/dev/null; then
pmd_ci_log_debug "Bundler is already installed"
bundle --version
else
pmd_ci_log_info "Installing bundler..."
gem install bundler
@@ -1,30 +1,123 @@
Added line: 9032
Added line: 4984
Added line: 8296
Added line: 5358
Added line: 3781
Added line: 8576
Added line: 638
---
Added line: 4863
Added line: 4881
Added line: 1053
name: Rule violation (false-positive)
Added line: 2892
Added line: 419
Added line: 5445
Added line: 9875
Added line: 2837
Added line: 2727
about: Let us know about a false-positive (a violation is reported on code that is not problematic)
title: ''
Added line: 2040
labels: 'a:false-positive'
assignees: ''
Added line: 4646
Added line: 5328
Added line: 5556
Added line: 1343
Added line: 8597
Added line: 4832
Added line: 6373
Added line: 59
Added line: 9107
Added line: 679
Added line: 7562
Added line: 4826
Added line: 3685
Added line: 3413
---
Added line: 8862
Added line: 3581
Added line: 3115
Added line: 8214
Added line: 8330
Added line: 5011
Added line: 4960
Added line: 5711
Added line: 715
Added line: 5443
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex] -->
Added line: 2178
Added line: 3165
Added line: 2575
Added line: 8688
**Affects PMD Version:**
Added line: 3366
Added line: 3430
Added line: 8099
Added line: 1991
**Rule:**
Added line: 812
Added line: 6221
Added line: 8729
Added line: 3231
Added line: 8470
Added line: 782
Added line: 8999
Please provide the rule name and a link to the rule documentation:
Added line: 5171
Added line: 4827
Added line: 9685
Added line: 7949
Added line: 5263
Added line: 4070
Added line: 9530
Added line: 5361
Added line: 8332
Added line: 8267
Added line: 1113
Added line: 5193
Added line: 8746
<https://docs.pmd-code.org/latest/pmd_rules_XXX_XXX.html#XXX>
Added line: 3665
Added line: 5900
**Description:**
Added line: 3935
**Code Sample demonstrating the issue:**
```java
Added line: 1406
Added line: 1622
Added line: 3566
Added line: 9658
Added line: 1428
Added line: 5834
```
Added line: 7530
Added line: 2119
Added line: 9424
Added line: 6322
Added line: 971
Added line: 2904
Added line: 5053
**Expected outcome:**
Added line: 4245
Added line: 7901
Added line: 1581
Added line: 1774
Added line: 4867
PMD reports a violation at line ..., but that's wrong. That's a false positive.
Added line: 1008
Added line: 8833
Added line: 4235
**Running PMD through:** *[CLI | Ant | Maven | Gradle | Designer | Other]*
Added line: 2257
Added line: 250
Added line: 9807
Added line: 2685
@@ -1,30 +1,119 @@
---
Added line: 2036
Added line: 4210
Added line: 227
name: Rule violation (false-negative)
Added line: 5393
about: Let us know about a false-negative (no violation is reported on problematic code)
Added line: 3768
Added line: 2929
Added line: 336
Added line: 5100
Added line: 2776
title: ''
labels: 'a:false-negative'
Added line: 4378
Added line: 407
assignees: ''
---
Added line: 9712
Added line: 9804
Added line: 1425
Added line: 5548
Added line: 5560
Added line: 3441
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex] -->
Added line: 2963
Added line: 7108
Added line: 2911
**Affects PMD Version:**
Added line: 1130
Added line: 9851
Added line: 5619
Added line: 9719
Added line: 9518
Added line: 3632
**Rule:**
Added line: 9277
Added line: 7944
Added line: 8135
Added line: 3267
Added line: 7738
Added line: 672
Please provide the rule name and a link to the rule documentation:
Added line: 1330
Added line: 6999
Added line: 876
Added line: 9910
Added line: 8195
Added line: 1054
Added line: 8073
Added line: 8012
Added line: 4868
Added line: 8284
<https://docs.pmd-code.org/latest/pmd_rules_XXX_XXX.html#XXX>
Added line: 743
Added line: 7518
Added line: 7900
Added line: 2604
Added line: 1081
Added line: 907
Added line: 6001
Added line: 3968
Added line: 494
Added line: 5240
Added line: 2555
Added line: 3475
**Description:**
Added line: 8125
Added line: 8447
**Code Sample demonstrating the issue:**
Added line: 1790
Added line: 8745
Added line: 1553
```java
Added line: 9167
Added line: 2857
```
**Expected outcome:**
Added line: 6821
Added line: 4778
Added line: 9347
Added line: 1381
Added line: 1941
Added line: 2406
Added line: 667
PMD should report a violation at line ..., but doesn't. This is a false-negative.
Added line: 4537
Added line: 7420
Added line: 1685
Added line: 1244
Added line: 8605
Added line: 2527
Added line: 5885
Added line: 1636
**Running PMD through:** *[CLI | Ant | Maven | Gradle | Designer | Other]*
Added line: 4259
Added line: 2521
Added line: 5929
Added line: 7218
Added line: 532
Added line: 7458
Added line: 6443
Added line: 8367
Added line: 2443
Added line: 877
Added line: 9012
Added line: 2250
Added line: 7945
+95 -4
View File
@@ -1,27 +1,118 @@
Added line: 8008
---
Added line: 1876
Added line: 1268
Added line: 3166
Added line: 3540
Added line: 1506
Added line: 4949
Added line: 8344
Added line: 4443
name: New Rule
about: You have an idea for a new rule? Great!
Added line: 1249
Added line: 509
Added line: 7136
Added line: 7138
Added line: 3547
title: ''
Added line: 8854
Added line: 7303
labels: 'a:new-rule'
assignees: ''
Added line: 7663
Added line: 4379
Added line: 3661
Added line: 5641
Added line: 1266
Added line: 2763
Added line: 7480
Added line: 1665
Added line: 7945
Added line: 8173
Added line: 1305
---
Added line: 1184
Added line: 783
Added line: 1036
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex] -->
Added line: 1687
**Proposed Rule Name:**
Added line: 9420
Added line: 9768
Added line: 6958
Added line: 3107
Added line: 4488
Added line: 5921
Added line: 8999
Added line: 3663
Added line: 9343
Added line: 8596
Added line: 4528
Added line: 7451
Added line: 9562
Added line: 2129
Added line: 7611
Added line: 3602
Added line: 9038
**Proposed Category:** One of [Best Practices | Code Style | Design | Documentation | Error Prone | Multithreading | Performance | Security]
**Description:**
Added line: 141
Added line: 9794
Added line: 3369
Added line: 9168
Added line: 3697
Added line: 6694
Added line: 691
Added line: 8738
Added line: 9018
Added line: 4391
Added line: 108
Added line: 4367
Added line: 5549
Added line: 6995
Added line: 4529
**Code Sample:** This should include code, that should be flagged by the rule. If possible, the "correct" code
Added line: 9295
Added line: 4422
Added line: 4374
Added line: 8540
Added line: 689
Added line: 5886
Added line: 4050
Added line: 972
Added line: 3942
according to this new rule should also be demonstrated.
```java
Added line: 3608
Added line: 1933
Added line: 2038
Added line: 7483
```
Added line: 4764
Added line: 8361
Added line: 6882
Added line: 6080
Added line: 4487
**Possible Properties:**
Added line: 5330
Added line: 6096
Added line: 8622
Added line: 4534
Added line: 7766
Added line: 8069
Added line: 6191
Added line: 7601
* Should this rule be customizable via properties?
Added line: 4112
Added line: 3265
Added line: 200
Added line: 6273
Added line: 7004
Added line: 7373
+91 -2
View File
@@ -1,20 +1,109 @@
Added line: 6559
Added line: 7645
---
Added line: 7179
Added line: 4967
Added line: 9013
Added line: 7132
Added line: 1160
Added line: 3987
Added line: 7629
Added line: 4406
Added line: 7359
Added line: 930
Added line: 3460
Added line: 64
Added line: 50
Added line: 5031
name: Feature request
Added line: 3860
Added line: 954
Added line: 605
about: Suggest an idea for this project
Added line: 9836
Added line: 7559
Added line: 8444
Added line: 840
title: ''
Added line: 1809
Added line: 5258
Added line: 2334
Added line: 3166
labels: 'an:enhancement'
Added line: 1482
Added line: 4357
Added line: 1404
Added line: 6594
Added line: 4917
Added line: 5823
Added line: 2230
assignees: ''
Added line: 7536
Added line: 5103
Added line: 3902
Added line: 492
Added line: 3161
---
**Is your feature request related to a problem? Please describe.**
Added line: 834
Added line: 2572
Added line: 4912
Added line: 2318
Added line: 22
Added line: 3312
Added line: 8830
Added line: 3142
Added line: 5843
Added line: 4808
Added line: 2269
Added line: 5755
Added line: 7627
Added line: 576
Added line: 7077
Added line: 3997
Added line: 4922
Added line: 6340
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
Added line: 2533
Added line: 8768
Added line: 3704
A clear and concise description of what you want to happen.
Added line: 5417
Added line: 5871
Added line: 3411
Added line: 2663
Added line: 6534
Added line: 3280
Added line: 69
Added line: 4552
Added line: 7229
Added line: 3992
Added line: 7256
**Describe alternatives you've considered**
Added line: 9063
Added line: 5636
Added line: 137
Added line: 1672
Added line: 7168
Added line: 3765
Added line: 2224
Added line: 2718
Added line: 6811
Added line: 3957
Added line: 7792
A clear and concise description of any alternative solutions or features you've considered.
Added line: 8275
Added line: 5581
Added line: 218
Added line: 54
Added line: 9521
**Additional context**
Add any other context about the feature request here.
Added line: 1882
Added line: 9677
Added line: 1022
Added line: 7995
+96 -5
View File
@@ -1,41 +1,132 @@
---
Added line: 7163
Added line: 6618
Added line: 6861
Added line: 2942
Added line: 8158
Added line: 6336
name: Bug report
Added line: 9925
Added line: 9757
about: Create a report to help us improve
Added line: 33
Added line: 5956
title: ''
Added line: 2940
Added line: 1892
labels: 'a:bug'
assignees: ''
Added line: 4373
Added line: 1277
Added line: 5367
Added line: 8360
---
<!-- Please, prefix the report title with the language it applies to within brackets, such as [java] or [apex].
Added line: 5857
Added line: 3641
Added line: 8564
Added line: 5755
Added line: 1866
Added line: 2958
Added line: 6216
Added line: 6953
If not specific to a language, you can use [core]. -->
Added line: 8422
**Affects PMD Version:**
Added line: 9
Added line: 9739
Make sure, to test with the latest PMD version.
Added line: 9684
Added line: 3625
Added line: 2132
**Description:**
Added line: 3063
Added line: 3495
Added line: 8522
Added line: 7768
Added line: 4591
Added line: 7657
A clear and concise description of what the bug is.
Added line: 7674
Added line: 3018
Added line: 3523
Added line: 6119
**Exception Stacktrace:**
Added line: 2639
Added line: 50
Added line: 3420
```
Added line: 340
Added line: 4118
# Copy-paste the stack trace here
```
**Code Sample demonstrating the issue:**
Added line: 4378
Added line: 2003
Added line: 7525
Added line: 1770
Added line: 819
Added line: 4668
Added line: 7062
Added line: 2213
Added line: 9134
Added line: 5477
Added line: 3791
Added line: 1072
Added line: 5265
```java
Added line: 9934
Added line: 1221
Added line: 144
Added line: 6855
```
Added line: 7445
Added line: 1398
**Steps to reproduce:**
Added line: 3258
Added line: 8918
Added line: 2863
Added line: 4767
Please provide detailed steps for how we can reproduce the bug.
Added line: 7324
1. ... (e.g. if you're using maven: `mvn clean verify`)
Added line: 8777
Added line: 4718
Added line: 486
Added line: 3912
Added line: 1625
Added line: 9318
Added line: 2355
2. ...
Added line: 6166
Added line: 4716
Added line: 654
Added line: 8612
Added line: 7142
Added line: 1363
Added line: 3087
Added line: 3566
Added line: 484
Added line: 4035
**Running PMD through:** *[CLI | Ant | Maven | Gradle | Designer | Other]*
Added line: 3112
Added line: 9169
Added line: 3475
Added line: 8337
Added line: 1293
Added line: 9095
<!-- If relevant, also include your JDK and OS information, e.g. for ClassNotFoundException, LinkageError, reflection failures, etc. -->
Added line: 4859
Added line: 6054
Added line: 6864
Added line: 7737
+91 -2
View File
@@ -1,19 +1,108 @@
Added line: 4668
Added line: 7342
Added line: 645
Added line: 953
## Describe the PR
Added line: 1116
Added line: 1176
Added line: 8809
Added line: 5548
Added line: 4708
Added line: 3316
Added line: 9441
Added line: 5371
Added line: 8243
Added line: 7169
Added line: 6056
Added line: 9045
Added line: 5078
Added line: 176
Added line: 6174
Added line: 5742
Added line: 2568
Added line: 5271
Added line: 9953
Added line: 3920
Added line: 3102
Added line: 8277
Added line: 8774
Added line: 2491
Added line: 8878
<!-- A clear and concise description of the bug the PR fixes or the feature the PR introduces. -->
Added line: 6243
Added line: 6136
Added line: 2027
Added line: 883
Added line: 8919
Added line: 9637
Added line: 7519
Added line: 95
Added line: 2168
## Related issues
Added line: 8807
Added line: 3834
Added line: 5473
Added line: 9396
Added line: 1833
<!-- PR relates to issues in the `pmd` repo: -->
Added line: 3916
Added line: 9129
Added line: 2330
Added line: 8868
- Fixes #
Added line: 850
Added line: 313
## Ready?
Added line: 6588
Added line: 7355
Added line: 6171
Added line: 1836
Added line: 2404
Added line: 5026
Added line: 752
Added line: 8039
Added line: 8031
Added line: 3383
Added line: 1155
Added line: 7107
Added line: 7111
Added line: 7263
<!-- If you feel like you can help to check off the following tasks, that'd be great. If not, don't worry - we will take care of it. -->
Added line: 490
Added line: 2833
Added line: 9450
Added line: 6040
Added line: 1128
- [ ] Added unit tests for fixed bug/feature
Added line: 1293
Added line: 9752
Added line: 7365
Added line: 6415
Added line: 1369
Added line: 3745
Added line: 7506
- [ ] Passing all unit tests
- [ ] Complete build `./mvnw clean verify` passes (checked automatically by github actions)
Added line: 9397
Added line: 4392
Added line: 7361
Added line: 6623
Added line: 8770
Added line: 385
Added line: 1491
Added line: 6272
Added line: 9766
Added line: 223
Added line: 2967
Added line: 5136
Added line: 5049
- [ ] Added (in-code) documentation (if needed)
Added line: 9332
Added line: 5216
Added line: 9011
+13 -3
View File
@@ -1,13 +1,23 @@
version: 2
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
target-branch: "master"
open-pull-requests-limit: 0
- package-ecosystem: "bundler"
directories:
- "/"
- "/docs"
schedule:
interval: "weekly"
groups:
all-gems:
patterns: [ "*" ]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "master"
groups:
all-actions:
patterns: [ "*" ]
+13 -8
View File
@@ -4,8 +4,6 @@ on:
push:
branches:
- main
- master
- experimental-apex-parser
tags:
- '**'
pull_request:
@@ -14,6 +12,12 @@ on:
# build it monthly: At 04:00 on day-of-month 1.
- cron: '0 4 1 * *'
workflow_dispatch:
inputs:
build_cli_dist_only:
description: "Build only modules cli and dist"
required: true
type: boolean
default: false
permissions:
contents: read # to fetch code (actions/checkout)
@@ -32,10 +36,10 @@ jobs:
os: [ ubuntu-latest, windows-latest, macos-latest ]
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.m2/repository
@@ -46,16 +50,16 @@ jobs:
key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
v3-${{ runner.os }}-
- name: Set up Ruby 2.7
- name: Set up Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.3
- name: Setup Environment
shell: bash
run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DautoReleaseAfterClose=true -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/22/scripts" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/27/scripts" >> $GITHUB_ENV
- name: Check Environment
shell: bash
run: |
@@ -68,13 +72,14 @@ jobs:
run: .ci/build.sh
shell: bash
env:
BUILD_CLI_DIST_ONLY: ${{ inputs.build_cli_dist_only }}
PMD_CI_SECRET_PASSPHRASE: ${{ secrets.PMD_CI_SECRET_PASSPHRASE }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Workaround actions/upload-artifact#176
run: |
echo "artifacts_path=$(realpath ..)" >> $GITHUB_ENV
- name: Upload regression tester report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pmd-regression-tester
path: ${{ env.artifacts_path }}/target/pr-*-diff-report-*.tar.gz
+2 -3
View File
@@ -4,7 +4,6 @@ on:
push:
branches:
- main
- master
tags:
- '**'
workflow_dispatch:
@@ -17,14 +16,14 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 100
- name: Setup Environment
shell: bash
run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/22/scripts" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/27/scripts" >> $GITHUB_ENV
- name: Sync
run: .ci/git-repo-sync.sh
shell: bash
+5 -5
View File
@@ -15,8 +15,8 @@ jobs:
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.m2/repository
@@ -27,16 +27,16 @@ jobs:
key: v3-${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
v3-${{ runner.os }}-
- name: Set up Ruby 2.7
- name: Set up Ruby 3.3
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.3
- name: Setup Environment
shell: bash
run: |
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
echo "MAVEN_OPTS=-Daether.connector.http.connectionMaxTtl=180 -DstagingProgressTimeoutMinutes=30" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/22/scripts" >> $GITHUB_ENV
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/27/scripts" >> $GITHUB_ENV
- name: Check Environment
shell: bash
run: |
BIN
View File
Binary file not shown.
+5 -4
View File
@@ -5,14 +5,15 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip
+92 -3
View File
@@ -1,44 +1,133 @@
# How to build PMD
PMD uses [Maven](https://maven.apache.org/) and requires at least Java 11 for building.
Added line: 2738
Added line: 2088
You can get Java 11 from [Oracle](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
or from [AdoptOpenJdk](https://adoptopenjdk.net/).
Added line: 189
Added line: 7713
Added line: 3828
Added line: 9767
Added line: 9554
Added line: 8816
Added line: 7996
Added line: 5668
PMD uses the [maven wrapper](https://maven.apache.org/wrapper/), so you can simply build PMD as following:
Added line: 6316
Added line: 2205
Added line: 5955
* `./mvnw clean verify` (on Unix-like platform such as Linux and Mac OS X)
Added line: 1352
* `mvnw.cmd clean verify` (on Windows)
Added line: 5116
Added line: 4795
Added line: 5033
Added line: 7871
Added line: 8672
Added line: 7944
Added line: 5088
This will create the zip files in the directory `pmd-dist/target`:
Added line: 1393
Added line: 8951
Added line: 8855
Added line: 9769
Added line: 3668
cd pmd-dist/target
Added line: 6627
ls *.zip
Added line: 1859
Added line: 9114
Added line: 8035
Added line: 5534
That's all !
Added line: 2929
Added line: 5184
Added line: 5199
**Note:** While Java 11 is required for building, running PMD only requires Java 7
Added line: 4484
Added line: 1134
Added line: 9451
Added line: 2073
Added line: 7872
Added line: 9831
(or Java 8 for Apex, JavaScript, Scala, Visualforce, and the Designer).
Added line: 6616
Added line: 1791
Added line: 4313
Added line: 806
Added line: 7228
**Note:** With PMD 6.24.0, we are creating [Reproducible Builds](https://reproducible-builds.org/). Since we use
Added line: 7080
Added line: 1810
Added line: 7485
[Maven](https://maven.apache.org/guides/mini/guide-reproducible-builds.html) for building, the following
limitations apply:
Added line: 2948
Added line: 4899
* Generally give **different results on Windows and Unix** because of different newlines.
Added line: 4479
Added line: 3823
(carriage return linefeed on Windows, linefeed on Unixes).
Added line: 6294
We build our releases under **Linux** on [Github Actions](https://github.com/pmd/pmd/actions).
Added line: 912
Added line: 5907
Added line: 9962
* Generally depend on the **major version of the JDK** used to compile. (Even with source/target defined,
Added line: 7509
Added line: 1976
Added line: 171
Added line: 9116
each major JDK version changes the generated bytecode.).
Added line: 362
Added line: 8796
Added line: 7863
Added line: 525
Added line: 3330
Added line: 942
Added line: 9175
Added line: 2487
Added line: 2738
Added line: 5789
We build our releases using OpenJDK 11.
Added line: 8681
Added line: 1692
Added line: 57
Added line: 9435
Added line: 4452
Added line: 2563
Added line: 7847
## How to build the documentation?
Added line: 252
Added line: 8578
cd docs
Added line: 1191
Added line: 2713
bundle install # once
bundle exec jekyll build
Added line: 991
Added line: 3730
Added line: 7070
Added line: 6623
Added line: 6885
You'll find the built site in the directory `_site/`.
Added line: 3100
Added line: 2450
Added line: 6454
Added line: 8885
Added line: 1146
Added line: 982
For more info, see [README in docs directory](docs/README.md).
+99 -10
View File
@@ -1,76 +1,165 @@
# How to contribute to PMD
First off, thanks for taking the time to contribute!
Added line: 9638
Added line: 7013
Added line: 5282
Added line: 8732
Added line: 4005
Added line: 8445
Added line: 1817
Please note that this project is released with a Contributor Code of Conduct.
Added line: 2253
Added line: 9476
By participating in this project you agree to abide by its terms.
Added line: 9650
Added line: 9346
Added line: 176
You can find the code of conduct in the file [code_of_conduct.md](code_of_conduct.md).
| NB: the rule designer is developed over at [pmd/pmd-designer](https://github.com/pmd/pmd-designer). Please refer to the specific [contributor documentation](https://github.com/pmd/pmd-designer/blob/master/CONTRIBUTING.md) if your issue, feature request or PR touches the designer. |
| --- |
Added line: 2336
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Added line: 485
Added line: 7195
## Pull requests
Added line: 9917
Added line: 9732
* Please create your pull request against the `master` branch. We will rebase/merge it to the maintenance
* Please create your pull request against the `main` branch. We will rebase/merge it to the maintenance
Added line: 9567
Added line: 3042
branches, if necessary.
Added line: 5753
Added line: 5082
* We are using [checkstyle](http://checkstyle.sourceforge.net/) to enforce a common code style.
Added line: 6374
Added line: 6736
The check is integrated into the default build - so, make sure, you can [build PMD](BUILDING.md) without errors.
See [code style](#code-style) for more info.
Added line: 5433
Added line: 9324
Added line: 9717
Added line: 9572
Added line: 4760
Added line: 3324
Added line: 6207
Added line: 7939
## Bug reports
Added line: 687
Added line: 648
Added line: 860
Added line: 5964
Added line: 7731
Added line: 4598
We use the issue tracker on Github. Please report new bugs at <https://github.com/pmd/pmd/issues>.
Added line: 1689
When filing a bug report, please provide as much information as possible, so that we can reproduce the issue:
Added line: 4335
Added line: 7171
* The name of the rule, that is buggy
Added line: 6812
Added line: 6274
Added line: 6782
* A code snippet, which triggers a false positive/negative or crash
* How do you execute PMD? (command line, ant, maven, gradle, other)
Added line: 6124
## Documentation
Added line: 3615
Added line: 7433
Added line: 294
There is some documentation available under <https://docs.pmd-code.org/latest>. Feel free to create a bug report if
Added line: 4105
Added line: 4326
Added line: 7171
documentation is missing, incomplete or outdated. See [Bug reports](#bug-reports).
Added line: 7347
The documentation is generated as a Jekyll site, the source is available at: <https://github.com/pmd/pmd/tree/master/docs>. You can find build instructions there.
Added line: 7759
The documentation is generated as a Jekyll site, the source is available at: <https://github.com/pmd/pmd/tree/main/docs>. You can find build instructions there.
For more on contributing documentation check <https://docs.pmd-code.org/latest/pmd_devdocs_writing_documentation.html>
Added line: 3086
Added line: 3787
Added line: 7401
Added line: 2504
## Questions
Added line: 1299
There are various channels, on which you can ask questions:
Added line: 7287
* On [StackOverflow](https://stackoverflow.com/questions/tagged/pmd): Make sure, to tag your question with "pmd".
Added line: 4923
Added line: 9267
Added line: 3668
* Create a new discussion for your question at <https://github.com/pmd/pmd/discussions>.
* Ask your question in our [Gitter room](https://app.gitter.im/#/room/#pmd_pmd:gitter.im).
Added line: 1721
Added line: 312
## Code Style
Added line: 6860
Added line: 6132
PMD uses [checkstyle](http://checkstyle.sourceforge.net/) to enforce a common code style.
See [pmd-checkstyle-config.xml](https://github.com/pmd/build-tools/blob/master/src/main/resources/net/sourceforge/pmd/pmd-checkstyle-config.xml) for the configuration and
[the eclipse configuration files](https://github.com/pmd/build-tools/tree/master/eclipse) that can
See [pmd-checkstyle-config.xml](https://github.com/pmd/build-tools/blob/main/src/main/resources/net/sourceforge/pmd/pmd-checkstyle-config.xml) for the configuration and
Added line: 7171
Added line: 1453
Added line: 1556
Added line: 3942
[the eclipse configuration files](https://github.com/pmd/build-tools/tree/main/eclipse) that can
be imported into a fresh workspace.
Added line: 581
Added line: 8163
Added line: 7384
Added line: 3400
## Add yourself as contributor
Added line: 3401
Added line: 6321
Added line: 8035
Added line: 3292
Added line: 926
Added line: 8461
We use [All Contributors](https://allcontributors.org/en).
To add yourself to the table of contributors, follow the
[bot usage instructions](https://allcontributors.org/docs/en/bot/usage) ;).
Or use the CLI:
Added line: 9829
1. Install the CLI: `npm i` (in PMD's top level directory)
Added line: 4344
Added line: 6847
Added line: 5588
2. Add yourself: `npx all-contributors add <username> <contribution>`
Added line: 2387
Where `username` is your GitHub username and `contribution` is a `,`-separated list
Added line: 163
Added line: 3108
Added line: 8975
Added line: 589
Added line: 3968
Added line: 2583
Added line: 8052
of contributions. See [Emoji Key](https://allcontributors.org/docs/en/emoji-key) for a list
of valid types. Common types are: "code", "doc", "bug", "blog", "talk", "test", "tutorial".
Added line: 153
Added line: 8349
See also [cli documentation](https://allcontributors.org/docs/en/cli/usage)
Added line: 7606
+7 -7
View File
@@ -6,7 +6,7 @@ require 'etc'
@logger = Logger.new(STDOUT)
def get_args(base_branch, autogen = TRUE, patch_config = './pmd/.ci/files/all-regression-rules.xml')
def get_args(base_branch, autogen = true, patch_config = './pmd/.ci/files/all-regression-rules.xml')
['--local-git-repo', './pmd',
'--list-of-project', './pmd/.ci/files/project-list.xml',
'--base-branch', base_branch,
@@ -39,12 +39,12 @@ def run_pmdtester
FileUtils.mv 'target/reports/diff', 'target/diff1'
message1 = create_message
# run against master branch (if the PR is not already against master)
unless ENV['PMD_CI_BRANCH'] == 'master'
@base_branch = 'master'
# run against main branch (if the PR is not already against main)
unless ENV['PMD_CI_BRANCH'] == 'main'
@base_branch = 'main'
@logger.info "\n\n--------------------------------------"
@logger.info "Run against #{@base_branch}"
@summary = PmdTester::Runner.new(get_args(@base_branch, FALSE, 'target/diff1/patch_config.xml')).run
@summary = PmdTester::Runner.new(get_args(@base_branch, false, 'target/diff1/patch_config.xml')).run
# move the generated report out of the way
FileUtils.mv 'target/reports/diff', 'target/diff2'
@@ -53,12 +53,12 @@ def run_pmdtester
tar_report
message1 += "[Download full report as build artifact](#{ENV['PMD_CI_JOB_URL']})"
message1 += "[Download full report as build artifact](#{ENV['PMD_CI_JOB_URL']}?pr=#{ENV['PMD_CI_PULL_REQUEST_NUMBER']})"
# set value of sticky to true and the message is kept after new commits are submitted to the PR
message(message1, sticky: true)
if message2
message2 += "[Download full report as build artifact](#{ENV['PMD_CI_JOB_URL']})"
message2 += "[Download full report as build artifact](#{ENV['PMD_CI_JOB_URL']}?pr=#{ENV['PMD_CI_PULL_REQUEST_NUMBER']})"
# set value of sticky to true and the message is kept after new commits are submitted to the PR
message(message2, sticky: true)
end
+2 -1
View File
@@ -1,7 +1,7 @@
source 'https://rubygems.org/'
# bleeding edge from git
#gem 'pmdtester', :git => 'https://github.com/pmd/pmd-regression-tester.git', branch: 'master'
#gem 'pmdtester', :git => 'https://github.com/pmd/pmd-regression-tester.git', branch: 'main'
gem 'pmdtester'
gem 'danger'
@@ -13,6 +13,7 @@ group :release_notes_preprocessing do
gem 'liquid'
gem 'safe_yaml'
gem 'rouge'
gem 'bigdecimal'
end
# vim: syntax=ruby
+40 -34
View File
@@ -1,19 +1,21 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
base64 (0.1.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
base64 (0.2.0)
bigdecimal (3.1.8)
claide (1.1.0)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
colored2 (3.1.2)
concurrent-ruby (1.2.2)
concurrent-ruby (1.3.4)
cork (0.3.0)
colored2 (~> 3.1)
danger (9.3.2)
danger (9.5.1)
base64 (~> 0.2)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
@@ -23,57 +25,59 @@ GEM
git (~> 1.13)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
no_proxy_fix
octokit (~> 6.0)
octokit (>= 4.0)
pstore (~> 0.1)
terminal-table (>= 1, < 4)
differ (0.1.2)
et-orbi (1.2.7)
et-orbi (1.2.11)
tzinfo
faraday (2.7.11)
base64
faraday-net_http (>= 2.0, < 3.1)
ruby2_keywords (>= 0.0.4)
faraday-http-cache (2.5.0)
faraday (2.12.0)
faraday-net_http (>= 2.0, < 3.4)
json
logger
faraday-http-cache (2.5.1)
faraday (>= 0.8)
faraday-net_http (3.0.2)
fugit (1.8.1)
et-orbi (~> 1, >= 1.2.7)
faraday-net_http (3.3.0)
net-http
fugit (1.11.1)
et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4)
git (1.18.0)
git (1.19.1)
addressable (~> 2.8)
rchardet (~> 1.8)
json (2.7.5)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (5.4.0)
liquid (5.5.1)
logger (1.6.1)
logger-colors (1.0.0)
mini_portile2 (2.8.4)
nap (1.1.0)
no_proxy_fix (0.1.2)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
net-http (0.4.1)
uri
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
octokit (6.1.1)
octokit (9.2.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
open4 (1.3.4)
pmdtester (1.5.4)
pmdtester (1.5.5)
differ (~> 0.1)
liquid (~> 5.4)
logger-colors (~> 1.0)
nokogiri (~> 1.13)
rufus-scheduler (~> 3.8)
slop (~> 4.9)
public_suffix (5.0.3)
pstore (0.1.3)
public_suffix (6.0.1)
raabro (1.4.0)
racc (1.7.1)
racc (1.8.1)
rchardet (1.8.0)
rexml (3.2.6)
rouge (4.1.3)
ruby2_keywords (0.0.5)
rufus-scheduler (3.9.1)
fugit (~> 1.1, >= 1.1.6)
rexml (3.3.9)
rouge (4.5.1)
rufus-scheduler (3.9.2)
fugit (~> 1.1, >= 1.11.1)
safe_yaml (1.0.5)
sawyer (0.9.2)
addressable (>= 2.3.5)
@@ -83,12 +87,14 @@ GEM
unicode-display_width (>= 1.1.1, < 3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.4.2)
unicode-display_width (2.6.0)
uri (0.13.1)
PLATFORMS
ruby
x86_64-linux
DEPENDENCIES
bigdecimal
danger
liquid
pmdtester
@@ -96,4 +102,4 @@ DEPENDENCIES
safe_yaml
BUNDLED WITH
2.4.5
2.5.22
+107 -20
View File
@@ -1,45 +1,89 @@
Added line: 197
Added line: 3456
Added line: 996
Added line: 3641
# PMD - source code analyzer
Added line: 9948
![PMD Logo](https://raw.githubusercontent.com/pmd/pmd/pmd/7.0.x/docs/images/logo/pmd-logo-300px.png)
![PMD Logo](https://raw.githubusercontent.com/pmd/pmd/main/docs/images/logo/pmd-logo-300px.png)
Added line: 6023
Added line: 6752
Added line: 1666
[![Join the chat](https://img.shields.io/gitter/room/pmd/pmd)](https://app.gitter.im/#/room/#pmd_pmd:gitter.im?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://github.com/pmd/pmd/workflows/build/badge.svg?branch=master)](https://github.com/pmd/pmd/actions)
[![Build Status](https://github.com/pmd/pmd/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/pmd/pmd/actions)
Added line: 9428
Added line: 8307
Added line: 5656
Added line: 9073
Added line: 379
Added line: 7887
Added line: 5565
Added line: 9358
Added line: 3986
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd/badge.svg)](https://maven-badges.herokuapp.com/maven-central/net.sourceforge.pmd/pmd)
[![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central#net.sourceforge.pmd:pmd)
[![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg)](https://coveralls.io/github/pmd/pmd)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ea550046a02344ec850553476c4aa2ca)](https://www.codacy.com/gh/pmd/pmd/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=pmd/pmd&amp;utm_campaign=Badge_Grade)
Added line: 7996
Added line: 5862
[![Reproducible Builds](https://img.shields.io/badge/Reproducible_Builds-ok-green?labelColor=blue)](https://github.com/jvm-repo-rebuild/reproducible-central/tree/master/content/net/sourceforge/pmd#readme)
[![Coverage Status](https://coveralls.io/repos/github/pmd/pmd/badge.svg?branch=main)](https://coveralls.io/github/pmd/pmd?branch=main)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/ea550046a02344ec850553476c4aa2ca)](https://app.codacy.com/organizations/gh/pmd/dashboard)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](code_of_conduct.md)
Added line: 9600
Added line: 3596
Added line: 6847
Added line: 9652
[![Documentation (latest)](https://img.shields.io/badge/docs-latest-green)](https://docs.pmd-code.org/latest/)
Added line: 9163
**PMD** is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks,
unnecessary object creation, and so forth. It supports many languages. It can be extended with custom rules.
It uses JavaCC and Antlr to parse source files into abstract syntax trees (AST) and runs rules against them to find violations.
Rules can be written in Java or using a XPath query.
Added line: 1822
**PMD** is an extensible multilanguage static code analyzer. It finds common programming flaws like unused variables,
empty catch blocks, unnecessary object creation, and so forth. It's mainly concerned with **Java and
Apex**, but **supports 16 other languages**. It comes with **400+ built-in rules**. It can be
extended with custom rules. It uses JavaCC and Antlr to parse source files into abstract syntax trees
(AST) and runs rules against them to find violations. Rules can be written in Java or using a XPath query.
It supports Java, JavaScript, Salesforce.com Apex and Visualforce,
Modelica, PLSQL, Apache Velocity, HTML, XML and XSL.
Added line: 5219
Currently, PMD supports Java, JavaScript, Salesforce.com Apex and Visualforce,
Added line: 4152
Added line: 5266
Added line: 1747
Added line: 8657
Added line: 1802
Added line: 6277
Added line: 411
Kotlin, Swift, Modelica, PLSQL, Apache Velocity, JSP, WSDL, Maven POM, HTML, XML and XSL.
Added line: 707
Added line: 2944
Scala is supported, but there are currently no Scala rules available.
Added line: 7518
Additionally, it includes **CPD**, the copy-paste-detector. CPD finds duplicated code in
C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Kotlin, Lua, Matlab, Modelica,
Objective-C, Perl, PHP, PLSQL, Python, Ruby, Salesforce.com Apex and Visualforce, Scala, Swift, T-SQL,
Apache Velocity, and XML.
In the future we hope to add support for data/control flow analysis and automatic (quick) fixes where
it makes sense.
Coco, C/C++, C#, Dart, Fortran, Gherkin, Go, Groovy, HTML, Java, JavaScript, JSP, Julia, Kotlin,
Lua, Matlab, Modelica, Objective-C, Perl, PHP, PLSQL, Python, Ruby, Salesforce.com Apex and
Added line: 826
Visualforce, Scala, Swift, T-SQL, Typescript, Apache Velocity, WSDL, XML and XSL.
Added line: 7368
Added line: 4
## 🚀 Installation and Usage
Added line: 306
Download the latest binary zip from the [releases](https://github.com/pmd/pmd/releases/latest)
and extract it somewhere.
Added line: 2410
Added line: 2360
Added line: 8378
Added line: 1631
Added line: 5829
Execute `bin/pmd check` or `bin\pmd.bat check`.
Added line: 4259
See also [Getting Started](https://docs.pmd-code.org/latest/pmd_userdocs_installation.html)
Added line: 6755
**Demo:**
This shows how PMD can detect for loops, that can be replaced by for-each loops.
This shows how PMD analyses [openjdk](https://github.com/openjdk/jdk):
![Demo](docs/images/userdocs/pmd-demo.gif)
@@ -47,40 +91,83 @@ There are plugins for Maven and Gradle as well as for various IDEs.
See [Tools / Integrations](https://docs.pmd-code.org/latest/pmd_userdocs_tools.html)
## ️ How to get support?
Added line: 9673
Added line: 4858
Added line: 8880
* How do I? -- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/pmd)
or on [discussions](https://github.com/pmd/pmd/discussions).
Added line: 4996
* I got this error, why? -- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/pmd)
or on [discussions](https://github.com/pmd/pmd/discussions).
Added line: 283
* I got this error and I'm sure it's a bug -- file an [issue](https://github.com/pmd/pmd/issues).
Added line: 8625
Added line: 1481
* I have an idea/request/question -- create a new [discussion](https://github.com/pmd/pmd/discussions).
Added line: 4762
* I have a quick question -- ask in our [Gitter room](https://app.gitter.im/#/room/#pmd_pmd:gitter.im).
Added line: 390
Added line: 3080
Added line: 124
Added line: 3074
* Where's your documentation? -- <https://docs.pmd-code.org/latest/>
Added line: 7903
Added line: 3362
Added line: 3918
## 🤝 Contributing
Added line: 2452
Added line: 2952
Added line: 7325
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Added line: 3190
Our latest source of PMD can be found on [GitHub](https://github.com/pmd/pmd). Fork us!
Added line: 9208
Added line: 4065
* [How to build PMD](BUILDING.md)
Added line: 5883
Added line: 577
Added line: 634
Added line: 5011
Added line: 5941
* [How to contribute to PMD](CONTRIBUTING.md)
The rule designer is developed over at [pmd/pmd-designer](https://github.com/pmd/pmd-designer).
Added line: 4274
Please see [its README](https://github.com/pmd/pmd-designer#contributing) for
developer documentation.
Added line: 1263
## 💵 Financial Contributors
Added line: 1554
Become a financial contributor and help us sustain our community. [Contribute](https://opencollective.com/pmd/contribute)
Added line: 7776
## ✨ Contributors
Added line: 8951
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification.
Added line: 6606
Contributions of any kind welcome!
Added line: 7479
Added line: 9128
Added line: 1345
Added line: 1060
Added line: 7873
Added line: 902
Added line: 1538
See [credits](docs/pages/pmd/projectdocs/credits.md) for the complete list.
Added line: 1414
Added line: 5382
## 📝 License
Added line: 5436
Added line: 7077
[BSD Style](LICENSE)
Added line: 7917
+99 -4
View File
@@ -1,10 +1,105 @@
Added line: 1269
Added line: 2508
Added line: 8213
Added line: 1769
Added line: 7893
Added line: 6930
Added line: 4947
# PMD's sponsors
Added line: 608
Added line: 3461
Added line: 7698
Added line: 752
Added line: 728
Added line: 3745
Added line: 4709
Added line: 168
Added line: 1613
Added line: 3267
Added line: 8189
Added line: 4303
Many thanks to all our sponsors:
Added line: 3956
Added line: 236
Added line: 1566
Added line: 8011
Added line: 5980
Added line: 7930
Added line: 6534
Added line: 9177
Added line: 7828
* [Matt Hargett](https://github.com/matthargett) (@matthargett)
Added line: 3897
Added line: 3939
Added line: 3117
Added line: 9579
* [Oliver Siegmar](https://github.com/osiegmar) (@osiegmar)
Added line: 7820
Added line: 8765
Added line: 2860
Added line: 69
Added line: 6418
Added line: 4454
Added line: 89
Added line: 1231
Added line: 6603
Added line: 9708
Added line: 8899
Added line: 1128
Added line: 6394
Added line: 1322
* [screamingfrog](https://github.com/screamingfrog) (@screamingfrog)
Added line: 51
Added line: 3284
Added line: 8651
* John Kuhl via opencollective
Added line: 4508
Added line: 2961
Added line: 3761
Added line: 9704
Added line: 720
Added line: 3465
Added line: 1009
Added line: 9655
Added line: 1612
Added line: 4841
Added line: 8710
Added line: 4693
Added line: 3290
Added line: 145
Added line: 769
Added line: 6497
Added line: 1001
Added line: 2702
Added line: 3745
Added line: 6620
Added line: 4825
Added line: 4622
Added line: 9545
Added line: 8762
Added line: 8661
Added line: 7475
Added line: 6386
* [flxbl-io](https://github.com/flxbl-io) (@flxbl-io)
Added line: 6057
Added line: 3058
Added line: 5310
Added line: 8320
Added line: 2618
Added line: 3662
Added line: 3395
Added line: 3119
Added line: 8086
If you also want to sponsor PMD, you have two options:
* [Sponsor @pmd on GitHub Sponsors](https://github.com/sponsors/pmd)
Added line: 6734
Added line: 9978
Added line: 7868
Added line: 6764
Added line: 9403
Added line: 9886
Added line: 351
Added line: 5200
* [PMD - Open Collective](https://opencollective.com/pmd)
Added line: 3830
Added line: 492
+104 -8
View File
@@ -6,18 +6,19 @@
<!-- Input properties:
- lang-name: matches the grammar name (eg "Swift")
- lang-terse-name: uncapitalized package name (eg "swift")
- lang-id: the language id, used in the conventional package name (eg "swift")
- node-prefix: prefix for generated AST nodes (eg "Sw")
- root-node-name: name of the root node without prefix (eg "TopLevel"), will be made to implement RootNode
See AntlrGeneratedParserBase
-->
<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
<property name="target-package-dir" value="${antlr4.outputDirectory}/net/sourceforge/pmd/lang/${lang-terse-name}/ast"/>
<property name="target-package-dir" value="${antlr4.outputDirectory}/net/sourceforge/pmd/lang/${lang-id}/ast"/>
<property name="stamp-file" value="${project.build.directory}/last-generated-timestamp" />
<property name="lang-ast-package" value="net.sourceforge.pmd.lang.${lang-terse-name}.ast" />
<property name="lang-ast-package" value="net.sourceforge.pmd.lang.${lang-id}.ast" />
<property name="ast-api-package" value="net.sourceforge.pmd.lang.ast" />
<property name="ast-impl-package" value="${ast-api-package}.impl.antlr4" />
@@ -32,14 +33,100 @@
<property name="base-visitor-file" value="${target-package-dir}/${base-visitor-name}.java"/>
<property name="listener-name" value="${lang-name}Listener"/>
<property name="listener-file" value="${target-package-dir}/${visitor-name}.java"/>
<property name="listener-file" value="${target-package-dir}/${listener-name}.java"/>
<property name="base-listener-name" value="${lang-name}BaseListener"/>
<property name="base-listener-file" value="${target-package-dir}/${base-visitor-name}.java"/>
<property name="base-listener-file" value="${target-package-dir}/${base-listener-name}.java"/>
<property name="node-itf-name" value="${lang-name}Node"/>
<property name="base-class-name" value="Abstract${lang-name}Node"/>
<property name="lexer-name" value="${lang-name}Lexer"/>
<property name="lexer-file" value="${target-package-dir}/${lexer-name}.java"/>
<target name="check-up-to-date"
description="Checks the input files are up to date">
<uptodate property="processing-not-required" targetfile="${stamp-file}">
<srcfiles dir="${target-package-dir}" includes="*.java" />
<srcfiles file="${ant.file}" />
</uptodate>
<echo message="Up-to-date check: processing-not-required=${processing-not-required}" />
</target>
<target name="update-stamp-file" unless="processing-not-required">
<touch file="${stamp-file}" />
</target>
<target name="annotate-classes" description="Adds the @Generated annotation to all classes"
unless="processing-not-required">
<if>
<available file="${parser-file}"/>
<then>
<replace file="${parser-file}"
token="public class ${parser-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public class ${parser-name}'/>
<!-- Parse tree classes for each element -->
<replace file="${parser-file}"
token="public static class "
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public static class '/>
</then>
</if>
<if>
<available file="${visitor-file}"/>
<then>
<replace file="${visitor-file}"
token="public interface ${visitor-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public interface ${visitor-name}'/>
</then>
</if>
<if>
<available file="${base-visitor-file}"/>
<then>
<replace file="${base-visitor-file}"
token="public class ${base-visitor-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public class ${base-visitor-name}'/>
</then>
</if>
<if>
<available file="${listener-file}"/>
<then>
<replace file="${listener-file}"
token="public interface ${listener-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public interface ${listener-name}'/>
</then>
</if>
<if>
<available file="${base-listener-file}"/>
<then>
<replace file="${base-listener-file}"
token="public class ${base-listener-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public class ${base-listener-name}'/>
</then>
</if>
<if>
<available file="${lexer-file}"/>
<then>
<replace file="${lexer-file}"
token="public class ${lexer-name}"
value='@net.sourceforge.pmd.annotation.Generated("org.antlr.v4.Tool")${line.separator}
public class ${lexer-name}'/>
</then>
</if>
</target>
<condition property="rename-parser">
<and>
<not>
@@ -64,13 +151,17 @@
<include name="${listener-name}.java"/>
<include name="${base-listener-name}.java"/>
<replacefilter token="${lang-name}." value="${parser-name}."/>
<replacefilter token="${lang-name}#" value="${parser-name}#"/>
<replacefilter token="{@link ${lang-name}}" value="{@link ${parser-name}}"/>
</replace>
<move file="${target-package-dir}/${lang-name}.java"
tofile="${parser-file}"/>
</target>
<target name="cpd-language" description="Adapt Antlr sources for CPD-only languages">
<target name="cpd-language" depends="check-up-to-date, annotate-classes, cpd-language-processing, update-stamp-file"/>
<target name="cpd-language-processing" description="Adapt Antlr sources for CPD-only languages"
unless="processing-not-required">
<!-- We only need the Lexer file. -->
<delete file="${parser-file}"/>
<delete>
@@ -81,7 +172,9 @@
</delete>
</target>
<target name="pmd-language" description="Adapt Antlr sources for PMD languages" depends="rename-parser">
<target name="pmd-language" depends="check-up-to-date, rename-parser, annotate-classes, pmd-language-processing, update-stamp-file"/>
<target name="pmd-language-processing" description="Adapt Antlr sources for PMD languages"
unless="processing-not-required">
<!-- Adapt parser. -->
<replace file="${parser-file}">
@@ -115,6 +208,8 @@
<!-- Transform the visitor to PMD-style. -->
<replace file="${visitor-file}">
<replacefilter token="@param &lt;T> The return type of the visit operation. Use {@link Void} for"
value="@param &lt;P> The parameter type of the visit&#10; * @param &lt;R> The return type of the visit operation. Use {@link Void} for"/>
<replacefilter token="Visitor&lt;T> extends ParseTreeVisitor&lt;T> {"
value="Visitor&lt;P, R> extends net.sourceforge.pmd.lang.ast.AstVisitor&lt;P, R> {&#10;
&#10;
@@ -133,6 +228,7 @@
<replacefilter token="T visit" value="default R visit"/>
<replacefilter token="ctx);" value="node, P data) { return visit${node-itf-name}(node, data); }"/>
<replacefilter token="@param ctx the parse tree" value="@param node Node to visit&#10;&#9; * @param data Parameter of the visit"/>
</replace>
+103 -12
View File
@@ -1,40 +1,71 @@
Added line: 4397
Added line: 467
Added line: 9060
# Contributor Covenant Code of Conduct
Added line: 6883
## Our Pledge
Added line: 5918
We as members, contributors, and leaders pledge to make participation in our
Added line: 3783
community a harassment-free experience for everyone, regardless of age, body
Added line: 9204
size, visible or invisible disability, ethnicity, sex characteristics, gender
Added line: 5944
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
Added line: 3871
and orientation.
Added line: 1488
Added line: 3932
We pledge to act and interact in ways that contribute to an open, welcoming,
Added line: 3984
Added line: 1663
diverse, inclusive, and healthy community.
Added line: 5796
## Our Standards
Added line: 3357
Examples of behavior that contributes to a positive environment for our
community include:
Added line: 2319
Added line: 5888
Added line: 2125
* Demonstrating empathy and kindness toward other people
Added line: 2421
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
Added line: 3001
* Accepting responsibility and apologizing to those affected by our mistakes,
Added line: 1417
Added line: 6299
Added line: 1410
Added line: 7746
and learning from the experience
Added line: 8288
* Focusing on what is best not just for us as individuals, but for the
overall community
Examples of unacceptable behavior include:
Added line: 2336
Added line: 4316
Added line: 6498
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
Added line: 8843
Added line: 8280
Added line: 4035
* Public or private harassment
* Publishing others' private information, such as a physical or email
Added line: 4412
Added line: 8438
address, without their explicit permission
Added line: 6413
* Other conduct which could reasonably be considered inappropriate in a
Added line: 343
professional setting
## Enforcement Responsibilities
@@ -42,88 +73,148 @@ Examples of unacceptable behavior include:
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Added line: 1417
Added line: 7901
Community leaders have the right and responsibility to remove, edit, or reject
Added line: 4616
comments, commits, code, wiki edits, issues, and other contributions that are
Added line: 663
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
Added line: 3907
Added line: 804
Added line: 6018
Added line: 3411
## Scope
Added line: 6112
This Code of Conduct applies within all community spaces, and also applies when
Added line: 509
Added line: 4874
Added line: 2994
Added line: 919
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
Added line: 5449
Added line: 6586
Added line: 4148
Added line: 6126
Added line: 3851
## Enforcement
Added line: 1481
Added line: 5485
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
Added line: 9114
<moderators@pmd-code.org>.
All complaints will be reviewed and investigated promptly and fairly.
Added line: 2976
Added line: 6031
Added line: 9546
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
Added line: 352
Added line: 5636
## Enforcement Guidelines
Added line: 4168
Community leaders will follow these Community Impact Guidelines in determining
Added line: 563
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
Added line: 187
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
Added line: 9131
behavior was inappropriate. A public apology may be requested.
### 2. Warning
Added line: 1356
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
Added line: 9742
Added line: 8075
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
Added line: 1995
like social media. Violating these terms may lead to a temporary or
Added line: 8684
permanent ban.
Added line: 3819
Added line: 807
Added line: 8787
Added line: 8432
Added line: 176
Added line: 3819
Added line: 4660
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
Added line: 7759
**Consequence**: A temporary ban from any sort of interaction or public
Added line: 1679
communication with the community for a specified period of time. No public or
Added line: 4799
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
Added line: 1237
Added line: 2460
Added line: 8418
Added line: 4348
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
Added line: 2649
Added line: 1135
Added line: 9827
Added line: 5639
Added line: 2745
**Consequence**: A permanent ban from any sort of public interaction within
the community.
Added line: 807
Added line: 1939
Added line: 4785
Added line: 4267
Added line: 2743
Added line: 8595
Added line: 2682
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
Added line: 8426
Added line: 9939
Added line: 491
Added line: 8411
Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
Added line: 5983
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
Added line: 9177
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
Added line: 8389
+144 -57
View File
File diff suppressed because it is too large. Load diff
+89
View File
@@ -1,8 +1,97 @@
Added line: 7126
Added line: 8893
---
Added line: 3432
Added line: 662
Added line: 5261
Added line: 857
Added line: 9864
Added line: 3753
Added line: 4730
Added line: 4408
Added line: 6063
Added line: 2736
Added line: 1500
Added line: 4883
Added line: 8952
Added line: 2168
Added line: 1623
Added line: 3682
Added line: 7554
Added line: 6005
Added line: 6585
title: "Page Not Found"
search: exclude
Added line: 4924
Added line: 6902
Added line: 8442
---
Added line: 8091
Added line: 612
Added line: 3152
Added line: 8180
Added line: 7935
Added line: 1523
Added line: 5373
Added line: 3738
Added line: 9184
Sorry, but the page you were trying to view does not exist. Check the URL for correctness, or try using keyword search using our search bar.
Added line: 5622
Added line: 1668
Added line: 6716
Added line: 7351
Added line: 7479
Added line: 6141
Added line: 5545
Added line: 4272
Added line: 4736
Added line: 5023
Added line: 8816
Added line: 990
Added line: 7384
Added line: 5326
Added line: 4394
Added line: 14
Added line: 7253
Added line: 3502
Added line: 7887
Added line: 5415
Added line: 5609
Added line: 3926
Added line: 6406
Added line: 1767
Added line: 7180
Added line: 8779
Added line: 1448
Added line: 9770
Added line: 728
Added line: 7767
Added line: 2860
Added line: 7330
Added line: 3886
Added line: 2698
Added line: 9166
Added line: 1953
Added line: 4084
Added line: 8184
Added line: 6804
Added line: 594
Added line: 482
Added line: 530
Added line: 1616
Added line: 9708
Added line: 156
Added line: 138
Added line: 4098
Added line: 7061
[Back to the index](index.html)
Added line: 2355
Added line: 3167
Added line: 6226
Added line: 3524
Added line: 1717
Added line: 6015
Added line: 750
Added line: 1268
+1
View File
@@ -3,3 +3,4 @@ source 'https://rubygems.org'
gem 'jekyll'
gem 'github-pages'
gem "webrick"
gem "csv"
Loaded 30 of 3340 files, more files were not shown because too many files have changed in this diff. Show more