Compare commits

..

328 Commits

Author SHA1 Message Date
Andreas Dangel 2881b6f585 [maven-release-plugin] prepare release pmd_releases/6.19.0 2019-10-31 18:36:42 +01:00
Andreas Dangel 433f8c06a2 Prepare pmd release 6.19.0 2019-10-31 18:27:57 +01:00
Andreas Dangel 73e48edaaa Merge branch 'pr-2054'
[java] Rename rule InvalidSlf4jLoggingFormat to InvalidLogMessageFormat
2019-10-30 19:30:44 +01:00
Andreas Dangel 39e07f6fbc Merge branch 'pr-2084'
[core] Deprecate Parser#getSuppressMap
2019-10-30 19:25:59 +01:00
Andreas Dangel 79fa9d2137 Merge branch 'pr-2083'
[core] Enable type resolution by default for XPath rules
2019-10-29 19:42:58 +01:00
Andreas Dangel 6e92282e24 Merge branch 'pr-2086'
[core] Improve logging of deprecated/renamed rules and non-existing excluded rules
2019-10-29 19:40:17 +01:00
Clément Fournier 34455b3051 Merge branch 'pr-2066' 2019-10-29 16:38:42 +01:00
Andreas Dangel fc8f9b1c6e [doc] Clarify note about deprecated rules when referencing a complete ruleset 2019-10-28 21:46:39 +01:00
Andreas Dangel fda81bd7bc [core] Don't enable deprecated rules if whole ruleset is imported
This restores the previous behavior.
2019-10-28 21:44:46 +01:00
Andreas Dangel f9d7b0891b Merge branch 'pr-2027'
[doc,ci] Rework doc generation and release notes
2019-10-28 19:39:39 +01:00
Andreas Dangel 0a94dec8f0 Merge branch 'pr-2044'
[core] Wrong deprecation warnings for unused XPath attributes
2019-10-28 19:27:52 +01:00
Andreas Dangel 2d4b01dca2 Upgrade embedded pmd-designer to 6.19.0
Also fix integration test with the additional
language "text".
2019-10-27 19:02:03 +01:00
Andreas Dangel 078863e36e [core] Only log if a language doesn't provide categories.properties
The new pmd-designer 6.19.0 adds the language module "text" (PlainText).
It is used as a fallback, if no other language modules are on the
classpath.

With this change PMD only logs a warning
if the file categories.properties couldn't be found for a language
instead of throwing RuleSetNotFoundException.
2019-10-27 19:01:42 +01:00
Andreas Dangel 95bbf56aea Use released pmd-build-tools version 5 2019-10-27 12:05:13 +01:00
Andreas Dangel 7e19b97e15 [doc] Update release notes, fixes #1978, fixes #2082 2019-10-27 11:40:37 +01:00
Andreas Dangel b1adf5c97c [doc] Add note for referencing a complete category or ruleset 2019-10-27 11:28:13 +01:00
Andreas Dangel 3c32f229f6 [core] Don't fail hard anymore if excluded rule doesn't exist
Fixes #1978
2019-10-27 10:16:17 +01:00
Andreas Dangel 9019f15cab [core] Improve logging of deprecated rule usages
Refs #2082

Not all cases are solved yet. It works, if a rule has been renamed
within the same category. If a rule is moved between categories,
then we might get multiple deprecation warnings.

There is also one important change when referencing a complete ruleset:
Previously we skipped all rules, that were deprecated without
distinguishing between rule definitions and rule references.
Now we only skip deprecated rule references but we still use
deprecated rule definitions. This affects any user, that simply uses
a "bulk-import" of category rulesets, because now, they'll also
use deprecated rules and get a warning. They'd need to exclude these
rules explicitly (or import just the rules they want to use).
2019-10-27 09:58:43 +01:00
Andreas Dangel d61d53092e [core] Deprecate Parser#getSuppressMap
Refs #2055
2019-10-26 17:27:11 +02:00
Andreas Dangel 92b8af8477 [core] Enable type resolution by default for XPath rules
Fixes #2048

All XPath rules will have now type resolution enabled by default.
While this change is in core, it actually only affects Java, since
this is the only language which has a type resolution facade
registered in its language handler.
2019-10-26 16:58:07 +02:00
Andreas Dangel 752e5f8ad5 [java] Deprecate AbstractJavaRule#getDeclaringType(Node)
Refs #2034
2019-10-26 12:17:43 +02:00
Andreas Dangel 7f31ad186b [ci] Prevent doc build from deploying the binary distribution
The documentation build should only deploy the pmd-doc*.zip
artefacts and not more.
2019-10-26 12:00:41 +02:00
Andreas Dangel 6e6adb9710 [ci] Generate the rule documentation also for pull requests
This will execute the DeadLinksChecker and RuleTagChecker
after the rule documentation has been generated.
2019-10-26 11:56:06 +02:00
Andreas Dangel dd87fcb968 gitignore docs/pages/pmd/rules 2019-10-26 11:52:20 +02:00
Andreas Dangel c134f23d7c Move all doc checks into the profile "generate-rule-docs" 2019-10-26 11:52:20 +02:00
Andreas Dangel 4ee8e65417 Upload release notes with the "docs" build.
The github release is first created as a draft, when we edit
the release notes, we publish it (draft=false), so that the
release notification mail contains the full release notes.
2019-10-26 11:52:20 +02:00
Andreas Dangel 7ae9247518 Generate rule docs only with maven profile "generate-rule-docs"
For travis build, PMD needs to be built now before jekyll can
generate the documentation.
In the main build, rule docs are not committed anymore.
2019-10-26 11:51:33 +02:00
Andreas Dangel 37aaa675db Remove the generated rule documentation from repository 2019-10-26 11:51:32 +02:00
Andreas Dangel f10b631d76 [ci] Only execute deployment provider under linux
Previously it had also been executed under the macosx build,
see https://travis-ci.org/pmd/pmd/jobs/585148459#L6700
2019-10-26 11:39:16 +02:00
Andreas Dangel f343932a4f [ci] Allow the windows job to fail for now
There seems to be some problem when the deploy phase is executed,
which happens only on pushes - for PRs the deploy is not executed
at all.
Although the deploy is skipped (since this is not a tagged build),
the windows job hangs after that.

Maybe we need to deploy to github releases manually, as we do
for the release notes already. That way, we wouldn't use the
deployment mechanism of travis.
2019-10-26 11:35:29 +02:00
Juan Martín Sotuyo Dodero c5145994ac Merge pull request #2077 from adangel/travis-windows
[ci] Add travis build on windows
2019-10-25 17:05:54 -03:00
Juan Martín Sotuyo Dodero d6f0192857 Merge branch 'master' into travis-windows 2019-10-25 17:05:45 -03:00
Andreas Dangel 6f4ccfb979 Add rule integration tests for all other supported languages 2019-10-25 19:50:48 +02:00
Andreas Dangel c7f143534a [doc] Update generated rule doc 2019-10-25 18:42:50 +02:00
Andreas Dangel c1f36d9d70 [java] Rename InvalidSlf4jMessageFormat to InvalidLogMessageFormat
Follow-up on #2012
2019-10-25 18:42:50 +02:00
Andreas Dangel 5c2bff403d Merge branch 'pr-2068' 2019-10-25 18:20:06 +02:00
Andreas Dangel c2b484bbc0 [doc] Update release notes, refs #2068 2019-10-25 18:18:16 +02:00
Andreas Dangel 2bc67ea719 [java] Add deprecation javadoc 2019-10-25 18:18:05 +02:00
Andreas Dangel 63395684c4 Merge branch 'pr-2076' 2019-10-25 15:01:58 +02:00
Andreas Dangel e8a4b5f77e [doc] Update release notes, refs #2076 2019-10-25 15:01:04 +02:00
Andreas Dangel ecc4e7558f [java] Use full name for CLASS_FAN_OUT metric for operations as well 2019-10-25 14:44:45 +02:00
Andreas Dangel 2b66fb76cb Merge branch 'master' into travis-windows 2019-10-25 14:27:17 +02:00
Andreas Dangel 72d31b2b30 [ci] Update to openjdk 11.0.5+10 2019-10-25 14:27:02 +02:00
Andreas Dangel 1209b162a9 [ci] Explicitly configure known_hosts for web.sourceforge.net 2019-10-24 20:29:16 +02:00
Juan Martín Sotuyo Dodero 9a2314ab5d Merge pull request #2079 from adangel/issue-1531-unusedprivatemethod
[java] UnusedPrivateMethod false-positive with method result
2019-10-23 19:46:48 -03:00
andi e2877ab95c use full name instead of abbreviation for classfanout & fix spelling 2019-10-22 20:22:20 +02:00
Chen Yang 48fab8cd64 Missing a ; 2019-10-22 21:24:13 +09:00
Chen Yang 80c293e82b Reuse the constructor 2019-10-22 21:13:02 +09:00
Andreas Dangel abc048ce41 [doc] Update generated rule documentation 2019-10-21 20:41:10 +02:00
Andreas Dangel 7bdb2a03d1 Merge branch 'pr-2078' 2019-10-21 20:32:26 +02:00
Andreas Dangel c7786d9438 [doc] Update release notes, fixes #1627, refs #2078 2019-10-21 20:32:03 +02:00
Andreas Dangel 50f748e191 [java] UnusedPrivateMethod false-positive with method result
Fixes #1531

In case we determined, that the method argument is a method call,
then we skip now completly trying to determine the correct argument
type. It was half-way fixed before for the first if condition, but
we still evaluated e.g. the allocation expression in

    print(new Integer(1).toString());

and wrongly assumed, the argument type would be an integer,
without taking into account the `toString()` method call.

The same happened with

    privateBooleanMethod(s, "true".equals(s));

where we took the 2nd argument as a literal and assumed
it is a "String", while the method call result actually
is a boolean.

With this change now, the false positive is fixed.

However, since we don't determine the argument type at all, the
method is matched solely on argument count. This will obviously
lead to wrong matches if method overloading is used.
2019-10-20 15:54:10 +02:00
Chen Yang 3abcbaa5a0 Move the resource loader to constructor 2019-10-20 11:26:52 +09:00
andi 7e48b4dcd3 fix documentation 2019-10-19 22:05:29 +02:00
Michael Clay b32c7ad6a8 [java] DoNotUseThreads should not warn on Runnable #1627 2019-10-19 20:55:49 +02:00
Andreas Dangel dde5d096d2 [doc] Update release notes, fixes #2071 2019-10-18 19:51:35 +02:00
Andreas Dangel ce05b1bbb6 [ci] Remove explicit ruby version, use the default 2019-10-18 19:48:14 +02:00
Andreas Dangel c3409c4aa7 [ci] Download openjdk from https://pmd-code.org/openjdk/
* Note: Download is only possible from travis
* Make openjdk version configurable in .travis.yml
* Skip download, if already downloaded
2019-10-18 19:47:18 +02:00
Andreas Dangel 23109d7b69 [ci] Add travis build on windows
* New parallel build for windows
* New before_install.sh script that prepares java, maven, ruby
2019-10-18 19:47:13 +02:00
Michael Clay 5739041b16 [java] DoNotUseThreads should not warn on Runnable on java8+ #1627 2019-10-18 17:43:33 +02:00
Andreas Dangel a1781422ca Merge branch 'pr-2073' 2019-10-17 21:05:43 +02:00
Andreas Dangel dde5cb530a [doc] Update release notes, refs #2073, fixes #2072 2019-10-17 21:05:14 +02:00
Andreas Dangel b76feef44e Merge branch 'pr-2070' 2019-10-17 20:34:00 +02:00
Andreas Dangel a91803f157 [doc] Update release notes, refs #2070, fixes #2067 2019-10-17 20:32:59 +02:00
andi 1515209a48 add classfanoutcomplexity metric 2019-10-17 13:05:36 +02:00
snuyanzin de632e6193 [PMD-2072] Add expected and actual line of numbers to message wording 2019-10-15 22:08:18 +02:00
Saladoc 66b52ee38f Fix typo in AbstractRendererTest class name 2019-10-15 20:21:19 +02:00
Saladoc 05b39e3419 Streamline renderer tests.
Remove platform-dependent contents from the file names to prevent tests
breaking on Windows systems.
2019-10-15 20:08:36 +02:00
Chen Yang 5c36ee1eba Rule loader should use the same resources loader to load the Rule sets 2019-10-15 11:44:05 +09:00
Andreas Dangel 52341d9d67 [java] Fix deprecated attributes in XPath rules 2019-10-14 19:50:52 +02:00
Andreas Dangel 507f543a73 Bump commons-compress from 1.18 to 1.19 in pmd-dist
This fixes CVE-2019-12402
2019-10-14 19:40:54 +02:00
Andreas Dangel e4e4c7ceae Merge branch 'pr-2060' 2019-10-14 19:36:45 +02:00
Clément Fournier ecf9be0c52 Finish release notes 2019-10-13 20:09:11 +02:00
Travis CI (pmd-bot) bf2bece085 Update documentation
TRAVIS_JOB_NUMBER=4328.1
TRAVIS_COMMIT_RANGE=e39a77812103...dff6f4d7ab98
2019-10-13 14:09:08 +00:00
Andreas Dangel 0ff97e5959 fix:[core] Wrong deprecation warnings for unused XPath attributes
* Improve integration tests in pmd-dist to detect
  warnings about deprecated attributes.
* Wrap the attribute value in a singleton list, to be able to distinguish
  between no value (null in the list) and value not determined yet
  (list is null).
* Add integration test for apex.
* Updated release notes

fixes #2020
2019-10-13 15:55:27 +02:00
Andreas Dangel dff6f4d7ab Merge branch 'pr-2065' 2019-10-13 15:44:59 +02:00
Andreas Dangel d45682faab [doc] Update release notes, refs #2065, fixes #1636 2019-10-13 15:44:45 +02:00
Carlos Macasaet a8dbc91b5e Make comment consistent with expected failures
Three of the problems were UR anomalies.

Addresses: #1636
2019-10-12 21:45:15 -07:00
Carlos Macasaet e41b8d992c Stop checking UR anomalies (Java)
This commit stops checking for UR anomalies in the
DataflowAnomalyAnalysis rule in Java. Note, I retained the UR anomaly
test, but changed the expected number of errors to zero.

Addresses: #1636
2019-10-12 19:01:30 -07:00
Clément Fournier ced97bb70b Fix compilation 2019-10-10 17:37:08 +02:00
Clément Fournier 2fd9d39825 Fix charset 2019-10-10 17:33:09 +02:00
Clément Fournier 9c77d027a3 Apply suggestions from code review
Co-Authored-By: Juan Martín Sotuyo Dodero <juansotuyo@gmail.com>
2019-10-10 17:27:03 +02:00
Clément Fournier 1c799a3507 Update release notes 2019-10-09 22:57:46 +02:00
Clément Fournier 6abbfb5920 Fix source incompatible change
(had added throws IOException)
2019-10-09 22:52:49 +02:00
Clément Fournier a9d14ac441 Deprecate other helpers 2019-10-09 22:48:41 +02:00
Clément Fournier c289ed49c5 Deprecate ant stuff 2019-10-09 22:40:41 +02:00
Clément Fournier 7911d733d4 Deprecate various utility classes 2019-10-09 22:38:52 +02:00
Clément Fournier ee41f610da Deprecate Filters
Will be replace with Predicate
2019-10-09 22:30:18 +02:00
Clément Fournier e39a778121 Fix #2058 2019-10-09 22:12:59 +02:00
Andreas Dangel cfb4fbec0f Merge branch 'pr-2026' 2019-10-07 18:50:34 +02:00
Juan Martín Sotuyo Dodero bb7db78108 Update changelog, refs #2025 2019-10-06 17:40:16 -03:00
Juan Martín Sotuyo Dodero b22808a65b Fix NPE in ImportWrapper.equals 2019-10-06 17:39:11 -03:00
Juan Martín Sotuyo Dodero a61835fe1e [java] Fix regexp to properly parse references 2019-10-06 17:38:50 -03:00
Juan Martín Sotuyo Dodero 92f393f32c [java] Add failing tests for #2025 2019-10-06 17:38:50 -03:00
Andreas Dangel 5c21dd7933 Merge branch 'pr-1955' 2019-10-05 18:49:23 +02:00
Andreas Dangel 5156e8922e Merge branch 'pr-2010' 2019-10-05 18:28:48 +02:00
Andreas Dangel 06add3a5a7 [doc] Update release notes, refs #2010 2019-10-05 18:27:56 +02:00
Clément Fournier 7f936e3c38 Fix CLI switches documented with a default value
Switches take no argument
2019-10-05 17:47:31 +02:00
Andreas Dangel 9c8cab088e Merge remote-tracking branch 'origin/master' 2019-10-05 15:06:24 +02:00
Andreas Dangel 18557a72c1 [doc] Update generated documentation 2019-10-05 15:05:00 +02:00
Travis CI (pmd-bot) 407cebcba9 Update documentation
TRAVIS_JOB_NUMBER=4279.1
TRAVIS_COMMIT_RANGE=63e2454ed25f...04e5619fa884
2019-10-05 13:00:12 +00:00
Andreas Dangel f4d590a3b2 Merge branch 'pr-2012' 2019-10-05 14:55:25 +02:00
Andreas Dangel 3093e0bf02 [doc] Update release notes, refs #2012, fixes #336 2019-10-05 14:53:43 +02:00
Andreas Dangel 744fea7366 [doc] Update rule descriptions for supported logging frameworks 2019-10-05 14:53:24 +02:00
Andreas Dangel 0d9419ef3e Remove unnecessary CDATA for test descriptions 2019-10-05 14:50:50 +02:00
Clément Fournier 04e5619fa8 Deprecations for #2034
Also, replace deprecated method usages
2019-10-05 13:55:18 +02:00
Clément Fournier 63e2454ed2 Deprecate Parser#canParse
Refs #2035
2019-10-05 13:16:01 +02:00
Andreas Dangel 3e59c40850 Merge branch 'pr-2032' 2019-10-04 20:31:12 +02:00
Andreas Dangel 4b8de80c01 [doc] Update release notes, refs #2032, fixes #2014 2019-10-04 20:30:20 +02:00
Andreas Dangel 2628b169b2 [core] Add @Experimental for CPD#add(SourceCode) 2019-10-04 20:27:57 +02:00
Andreas Dangel 459b430916 [doc] Update gems, fix rubyzip security alert
Upgrades rubyzip to 2.0.0, which fixes CVE-2019-16892
2019-10-03 19:42:58 +02:00
Andreas Dangel b1083555e5 doc:fix jdoc links in release notes 2019-10-03 19:13:40 +02:00
Andreas Dangel 1dc75e6694 Merge branch 'pr-2037' 2019-10-03 19:12:28 +02:00
Andreas Dangel e7bb587b2b doc:Update release notes, refs #2037, fixes #2036, add deprecations 2019-10-03 19:11:26 +02:00
Andreas Dangel 6ace28fdca Merge branch 'pr-2047' 2019-10-03 18:48:49 +02:00
Andreas Dangel 98bd5cb57f doc:Update release notes, refs #2047, fixes #1912 2019-10-03 18:48:38 +02:00
Clément Fournier df4ed60971 Use Pattern everywhere instead of String 2019-10-01 17:42:55 +02:00
Clément Fournier acbb57da72 Deprecate LanguageRegistry methods
Refs #2035
2019-10-01 16:35:04 +02:00
Clément Fournier 69a1fb7c31 Merge pull request #2045 from adangel/issue-2040
fix:[ci] Danger is failing builds
2019-10-01 11:35:42 +02:00
Juan Martín Sotuyo Dodero 9fe501d1a0 Merge pull request #2043 from adangel/fix-2042
[java] PMD crashes with ClassFormatError: Absent Code attribute
2019-09-30 00:37:22 -03:00
Andreas Dangel 6c4b6b1649 fix:[ci] Danger is failing builds
Add Gemfile.lock to pin down the current versions

fixes #2040
2019-09-29 21:24:34 +02:00
Andreas Dangel 83a8a58f04 Revert "[ci] Danger is failing builds"
This reverts commit 8299e7d231.
2019-09-29 21:22:06 +02:00
Andreas Dangel 8299e7d231 [ci] Danger is failing builds
Temporarily pin down faraday to <0.16.0.
Refs #2040
2019-09-28 20:16:27 +02:00
Andreas Dangel 8e28fb35dc fix: [java] PMD crashes with ClassFormatError: Absent Code attribute...
Retrieving the enclosing class might result in a LinkageError or
ClassFormatError.
For now this error is just logged as a warning and ignored.

fixes #2042
2019-09-28 19:54:56 +02:00
Clément Fournier bda77805d3 Deprecate DCD
Refs #2038
2019-09-28 12:40:38 +02:00
andi ea6174ebed Fix computation of metrics with annotations 2019-09-28 12:32:31 +02:00
Clément Fournier 7c475d64a1 Document 2019-09-27 19:19:16 +02:00
Clément Fournier f5b02ef2b0 Log wrong include/exclude patterns 2019-09-27 18:58:07 +02:00
Nathan Braun 9e2105dcb3 [pmd-core] Allow adding SourceCode directly into CPD #2014. 2019-09-26 12:49:13 -07:00
Juan Martín Sotuyo Dodero b7f0e8d26e Merge pull request #2031 from oowekyala/deprecate-canSuppressWarnings
[java,apex] Deprecate CanSuppressWarnings
2019-09-25 18:00:25 -03:00
Clément Fournier 54b7679329 Same for apex 2019-09-25 01:11:46 +02:00
Clément Fournier bcb7774795 [pmd-java] Deprecate CanSuppressWarnings following #1927 2019-09-25 01:08:19 +02:00
Andreas Dangel a7e767e6f1 Merge branch 'pr-2024' 2019-09-20 08:28:04 +02:00
markhall1982 ab434f3747 changes in response to feedback
Remove wrapping HashMap
Add log4j2 to test descriptions
2019-09-19 21:04:01 +01:00
Juan Martín Sotuyo Dodero 9ee73f5399 Update changelog, refs #2017 2019-09-19 16:14:06 -03:00
Juan Martín Sotuyo Dodero 494a5bc3f8 Fix #2017 2019-09-19 16:12:08 -03:00
Juan Martín Sotuyo Dodero 8d5cb1968d Add failing test for UnnecessaryFullyQualifiedName
- Tests for #2017
2019-09-19 16:11:35 -03:00
Juan Martín Sotuyo Dodero 691f01d254 Merge pull request #2021 from oowekyala/scala-cleanups
[scala] Fix scala text bounds
2019-09-17 17:53:49 -03:00
Andreas Dangel 07ea0b0f79 [core] DataSource is now closable, add default impl as abstract class 2019-09-17 19:58:19 +02:00
Clément Fournier 4b4e6a247d Remove useless test 2019-09-17 19:30:31 +02:00
Clément Fournier e09ea8ce1a Setting line numbers is unsupported 2019-09-17 19:20:27 +02:00
Clément Fournier 734fc53aba Fix java tests not executing 2019-09-17 19:16:45 +02:00
Clément Fournier 591cfc0a51 Remove old test 2019-09-17 04:33:39 +02:00
Clément Fournier 95d6ea3f37 Fix scala text bounds 2019-09-17 04:21:05 +02:00
Clément Fournier ed428dd852 Cleanup scala tree builder 2019-09-17 03:30:30 +02:00
Andreas Dangel 8d08016a94 Update PMD to 6.18.0, remove unnecessary suppressions 2019-09-16 20:42:01 +02:00
Andreas Dangel 395e3453cb dogfood: Upgrade to PMD 6.17.0 and fix CloseResource issues 2019-09-16 20:03:12 +02:00
Clément Fournier e4ce2faf78 Fix spurious warning about deprecated attributes
Because we were evaluating all attributes eagerly,
deprecated attributes were reported even without
being used. Possibly, performance also took a hit.
2019-09-16 13:23:11 +02:00
Andreas Dangel b0e458d813 Prepare next development version 2019-09-15 10:15:20 +02:00
Andreas Dangel e536ca1947 [maven-release-plugin] prepare for next development iteration 2019-09-15 10:14:14 +02:00
Andreas Dangel 3f42cca200 [maven-release-plugin] prepare release pmd_releases/6.18.0 2019-09-15 10:14:05 +02:00
Andreas Dangel be90279d83 Prepare pmd release 6.18.0 2019-09-15 10:04:40 +02:00
Andreas Dangel 4672ccf2e3 Update generated rule documentation 2019-09-15 09:57:04 +02:00
Andreas Dangel 8f3abf9349 Merge branch 'pr-2015' 2019-09-15 09:47:04 +02:00
Andreas Dangel 6d8f7c12df Update release notes, refs #2015, #fixes #1227 2019-09-15 09:46:20 +02:00
Andreas Dangel eeb147e594 formatting 2019-09-15 09:46:07 +02:00
Amish Shah 73006a420e Update doc for unused formal parameter 2019-09-14 14:17:06 -05:00
Andreas Dangel e0b0e6330d [core] XPath 1.0: filter out list attributes
While XPath 2.0 queries support now list attributes as
sequences, XPath 1.0 won't. It would only be supported as
single string which makes the two xpath versions completely
incompatible. In order to make it easier for the transitioning
from xpath 1.0 to xpath 2.0, list attribute will only be
supported for xpath 2.0.

See also https://github.com/pmd/pmd/pull/1959#discussion_r322027876
2019-09-14 18:20:03 +02:00
Andreas Dangel 9eaffbd3e6 Update generated rule documentation 2019-09-14 17:24:26 +02:00
Andreas Dangel 8821434604 Merge branch 'pr-1943' 2019-09-14 17:11:34 +02:00
Andreas Dangel 5f30951a8b Update release notes, refs #1943, fixes #1942 2019-09-14 17:09:00 +02:00
Andreas Dangel 4d6b3215d5 Add new rule DebugsShouldUseLoggingLevel to quickstart 2019-09-14 17:08:37 +02:00
Clément Fournier 8ac3a10020 Bump kotlin test version 2019-09-14 15:04:38 +02:00
Clément Fournier 9ae5342eb5 Normalise line terminators in tests
Comparison was failing because the test file was checked
out with CRLF and the expected result is written with LF.

Maybe we should normalise consistently across tests. Using
PMD.EOL in tests is just code obfuscation.
2019-09-14 02:06:39 +02:00
Clément Fournier c7b83fc0bc Merge branch 'adangel-java13' 2019-09-14 01:08:20 +02:00
Andreas Dangel dd294d3813 Consider lower-case, use parameter strictMode 2019-09-13 15:57:14 +02:00
Andreas Dangel c8fdd5f0c0 Merge branch 'pr-2013' 2019-09-13 15:22:51 +02:00
Robert Sösemann 5f1b2781e6 Update news.md 2019-09-12 20:58:09 +02:00
Andreas Dangel 76bf20a0c7 Analyze only src/main/java and not src anymore, since mixing
java12 preview and java13 preview is now not possible anymore

see
src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java12
src/test/resources/net/sourceforge/pmd/lang/java/ast/jdkversiontests/java13
2019-09-12 20:35:36 +02:00
Andreas Dangel eba98b3898 Fixes from review, refs #1973 2019-09-12 20:22:45 +02:00
Clément Fournier f9f7062a65 Mark typeres implementation as internal API 2019-09-12 18:43:22 +02:00
markhall82 96449c2ae5 Ensure pom formatting remains same as master 2019-09-11 20:45:42 +01:00
markhall82 16f7f9385b Correct previous error in doc re: placeholders
Revert IntelliJ added tags from pom.xml
2019-09-11 20:43:37 +01:00
markhall82 a660f2cfcb Fix for issue #336, introduce log4j 2 support as it can use the same rules as slf4j.
Note, one of the rules remains InvalidSlf4jMessageFormatRule, to make the rule more generic it would require a documentation change on sourceforge site.
2019-09-11 20:36:34 +01:00
Andreas Dangel a2df7e2d29 Merge branch 'master' into java13 2019-09-11 20:41:00 +02:00
Andreas Dangel 970c86f557 [java] Introduce language version 12-preview and 13-preview 2019-09-11 20:36:29 +02:00
Gregor Riegler f5c8be8f52 [java] LawOfDemeter to support inner builder pattern 2019-09-10 21:55:03 +02:00
Clément Fournier 36d63429b4 Merge branch 'cleanup-scala' 2019-09-08 22:47:49 +02:00
Clément Fournier 35aef685fa Fix typo in release notes 2019-09-08 22:46:55 +02:00
Clément Fournier 68cd5549b9 Cleanup some pmd-scala methods
* Remove ScalaNode#childrenAccept: this only makes stack traces longer.
Besides, the node doesn't know how to accumulate values, so it's useless.
* Specialize return type of some methods of the interface.
2019-09-08 22:44:39 +02:00
Juan Martín Sotuyo Dodero 36cd3d5a84 Merge pull request #1959 from adangel/apex-supertype
[apex] Expose supertype name of UserClass
2019-09-08 17:29:48 -03:00
Andreas Dangel e29401b45e Fixes from PR #1959 Review 2019-09-08 21:35:14 +02:00
Clément Fournier 22e5538e14 Fix test files 2019-09-08 18:53:32 +02:00
Renato Oliveira 9b00cb3ceb Change expression to the one suggested by @rsoesemann. 2019-09-08 12:41:15 -03:00
Renato Oliveira 75d3e565f0 Update comment and "since" version 2019-09-08 12:37:42 -03:00
Clément Fournier be7d439134 Checkstyle 2019-09-08 16:10:45 +02:00
Clément Fournier 0b52f6427a Add regression test for MissingOverride
Refs #2007
2019-09-08 16:07:05 +02:00
Andreas Dangel a24e85488e Merge branch 'pr-1986' 2019-09-08 15:39:49 +02:00
Andreas Dangel 00f0cc3e3d Update release notes, refs #1986, fixes #1933, fixes #1936 2019-09-08 15:38:36 +02:00
Andreas Dangel 26600e68c7 Merge branch 'pr-1977' 2019-09-08 15:24:35 +02:00
Andreas Dangel 47d2b9b57b Update release notes, refs #1977, fixes #1953 2019-09-08 15:22:19 +02:00
Andreas Dangel 20d34103ce [plsql] Add basic support for with clause 2019-09-08 15:20:00 +02:00
Andreas Dangel dea41f1b6f Merge branch 'pr-1976' 2019-09-08 12:03:54 +02:00
Andreas Dangel 4d9070cf16 Update release notes, refs #1976 2019-09-08 12:03:24 +02:00
Andreas Dangel 854cd4c700 Merge branch 'pr-1975' 2019-09-08 12:00:19 +02:00
Andreas Dangel 6e878e95bb Update release notes, refs #1975, fixes #1946 2019-09-08 11:59:27 +02:00
Andreas Dangel aee182b0b8 Merge branch 'pr-1974' 2019-09-08 11:47:49 +02:00
Andreas Dangel 8124a0498b Update release notes, refs #1974
Fixes #1935
Fixes #1948
Fixes #1950
2019-09-08 11:46:44 +02:00
Andreas Dangel 2388f75891 Merge branch 'pr-1972' 2019-09-08 11:21:05 +02:00
Andreas Dangel 949a03acde Update release notes, fixes #1947, refs #1972 2019-09-08 11:20:03 +02:00
Andreas Dangel f283a663a3 [plsql] New node ForUpdateClause 2019-09-08 11:16:46 +02:00
Andreas Dangel de21a9008f [plsql] Remove extra tokens, remove reserved words as identifiers 2019-09-08 11:12:51 +02:00
Andreas Dangel e2a28b4d43 [apex] Expose InterfaceNames and TriggerUsages as Lists 2019-09-07 20:28:21 +02:00
Andreas Dangel 4d285c0ac9 [core] Add support for List attributes for XPath 2.0 2019-09-07 20:26:52 +02:00
Andreas Dangel 5ba724d221 Fix reference to StatisticalRule 2019-09-07 17:11:10 +02:00
Andreas Dangel a818557b6b Merge branch 'pr-1965' 2019-09-07 16:55:35 +02:00
Andreas Dangel 539b7a1672 [doc] Add scala rule index placeholder 2019-09-07 16:43:48 +02:00
Andreas Dangel c3f376478e whitespaces 2019-09-07 16:40:57 +02:00
Andreas Dangel 55e3b64f5d Fix unit tests 2019-09-07 16:35:52 +02:00
Andreas Dangel e225821272 Merge branch 'master' into pr-1965 2019-09-07 16:21:11 +02:00
Andreas Dangel 6eeb5fcef5 Update release notes, refs #1965 2019-09-07 16:19:47 +02:00
Andreas Dangel 1e33b634e0 [doc] Add scala as supported language 2019-09-07 16:19:24 +02:00
Andreas Dangel c8d6e7f00b Update license info
Since we don't rely anymore on org.sonar.plugins.scala
we can remove the LGPL-3 reference.
2019-09-07 16:09:33 +02:00
Andreas Dangel 24d030cc69 [scala] Move AST nodes to n.s.p.lang.scala.ast
* Also make ScalaTreeBuilder and AbstractScalaNode
  package private
2019-09-07 16:03:55 +02:00
Andreas Dangel 20c7d7f421 [test] fix language version tests to check registered rulesets
Now categories.properties are tested. rulesets.properties
is only tested, if it exists.
2019-09-07 15:50:17 +02:00
Andreas Dangel 4bb116125e [scala] Small improvements
* The system property to select the language version for
  the tokenizer used by CPD is called now
  "net.sourceforge.pmd.scala.version"
* The node ASTSource is marked as RootNode
* Removed (deprecated) DumpFacade solution
* Removed old rulesets.properties
2019-09-07 15:16:43 +02:00
Andreas Dangel ada5bdc072 [scala] Remove checkstyle exceptions 2019-09-07 15:10:02 +02:00
Andreas Dangel 298b436fb8 Merge branch 'master' into apex-supertype 2019-09-07 11:09:06 +02:00
Andreas Dangel 41304c3031 [apex] Introduce own PMD enum for TriggerUsage 2019-09-07 11:04:15 +02:00
Andreas Dangel dbb711b0f5 [apex] Fix ASTUserInterfaceTest examples 2019-09-07 10:50:09 +02:00
Andreas Dangel 13cf82362e Update release notes, clarify java12 preview language support
Support for java12 extended break statement will be removed
with next PMD version.
To do so, simply revert 09a1837.
2019-09-07 10:17:33 +02:00
Andreas Dangel 09a183702c Revert "[java] Remove java12 break-with-expression support"
This reverts commit 2ba1422747.
2019-09-07 10:13:02 +02:00
Clément Fournier f449cc72e3 Deprecate Report::hasMetrics and Report::metrics 2019-09-06 17:37:09 +02:00
Andreas Dangel 580549a07e Merge branch 'master' into java13 2019-09-06 15:23:51 +02:00
Andreas Dangel f3e4a77105 [java] Adjust grammar for text blocks
Refs #1973
2019-09-06 15:21:08 +02:00
Juan Martín Sotuyo Dodero bb0379ef4f Merge pull request #1982 from adangel/issue-1923
[core] Use real file name in ruleContext during analysis
2019-09-05 20:04:21 -03:00
Juan Martín Sotuyo Dodero 5458958749 Merge pull request #2000 from adangel/analysis-result
[core] analysis cache: Use always different checksum
2019-09-05 19:43:49 -03:00
Juan Martín Sotuyo Dodero 46ea77427c Merge pull request #1958 from adangel/issue-1952
[java] Compare ignored annotations by fully qualified names only
2019-09-04 00:58:55 -03:00
Andreas Dangel 5db5c62bb2 [core] analysis cache: Use always different checksum
If the checksum couldn't be determined, then we use now
System.currentTimeMillis. This should result in a different
checksum everytime the same file is analyzed, so that it
appears dirty. In that case, the cached results won't be used.
2019-09-03 20:21:23 +02:00
Andreas Dangel d905c8d7ed Fix release notes jdoc tag 2019-09-03 20:17:48 +02:00
Andreas Dangel 1d6148f06b Fix release notes jdoc links 2019-09-03 20:12:00 +02:00
Andreas Dangel ddd07e517a Merge branch 'master' into issue-1923 2019-09-03 19:43:27 +02:00
Andreas Dangel 3771320c47 Move logic to new ShortFilenameUtil 2019-09-03 19:42:21 +02:00
Andreas Dangel 6602d9e697 Fixes from PR review 2019-09-03 19:33:55 +02:00
Andreas Dangel 338cf1e1b7 Update pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractRenderer.java
Co-Authored-By: Juan Martín Sotuyo Dodero <juansotuyo@gmail.com>
2019-09-03 19:21:56 +02:00
Andreas Dangel 11e8c33e44 Update pmd-core/src/main/java/net/sourceforge/pmd/renderers/AbstractRenderer.java
Co-Authored-By: Juan Martín Sotuyo Dodero <juansotuyo@gmail.com>
2019-09-03 19:20:11 +02:00
Juan Martín Sotuyo Dodero 282f29f781 Add more missing imports 2019-09-02 17:51:33 -03:00
Juan Martín Sotuyo Dodero e72a92d2fb Merge branch 'master' into issue-1952 2019-09-02 17:46:20 -03:00
Juan Martín Sotuyo Dodero de13f7a0ae Add missing imports to fix tests 2019-09-02 17:40:33 -03:00
Juan Martín Sotuyo Dodero 3a7f747c05 Improve TypeHelper.isA to better handle edge cases 2019-09-02 17:40:03 -03:00
Juan Martín Sotuyo Dodero 42197f68b2 Merge pull request #1996 from pmd/dependabot/bundler/docs/nokogiri-1.10.4
Bump nokogiri from 1.8.5 to 1.10.4 in /docs
2019-09-02 16:27:20 -03:00
Juan Martín Sotuyo Dodero 89443f5373 Merge branch 'pr-1994' 2019-09-02 14:44:51 -03:00
Juan Martín Sotuyo Dodero e93ec2bcc2 Update changelog, refs #1994 2019-09-02 14:44:35 -03:00
dependabot[bot] 1192ca5051 Bump nokogiri from 1.8.5 to 1.10.4 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.8.5 to 1.10.4.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.8.5...v1.10.4)

Signed-off-by: dependabot[bot] <support@github.com>
2019-09-02 17:41:26 +00:00
Clément Fournier 3755d5d7d4 Tag n.s.pmd.cache as internal API,
update release notes
2019-08-29 22:18:01 +02:00
Clément Fournier 6cd8ae38ff Merge branch 'Monits-issue-1990' 2019-08-29 22:09:48 +02:00
Juan Martín Sotuyo Dodero 29921f03e5 Fix breaking tests 2019-08-29 12:53:22 -03:00
Amish Shah 230af90386 [core] Resolve pmd-report failure when java folder in filepath - refs 1465 2019-08-29 08:00:07 -05:00
Juan Martín Sotuyo Dodero bf2ad56799 Update changelog, refs #1990 2019-08-27 11:03:37 -03:00
Juan Martín Sotuyo Dodero b85d71f632 [core] Resolve cached rule instances by more than class name
- Fixes #1990
2019-08-27 11:02:27 -03:00
Chris Smith 6dbab9ba35 Fix for PMD finding that this class doesn't have the right override method. 2019-08-23 16:39:57 -04:00
Chris Smith d0cf7fb56d Genericized the Scala Visitor's input and output types, correctly placed node accept methods, handle bad code tokenization problems. Added more rules to check for bad source tokenization, and rules can visit particular nodes correctly 2019-08-22 12:24:37 -04:00
Piotr Szymanski 5a444276f8 simplified lookahead for blocks and proc/func 2019-08-20 21:22:42 +02:00
Chris Smith 7e7b36d35c Added ASTNodes for all Scala AST Nodes to do direct translation. 2019-08-20 13:59:43 -04:00
Chris Smith 39b51aac47 code review fixes:
re-enable javadocs
ScalaTokenizer keeps nodes in scala for performance gain
Change AST{name}Node designation to {name}
2019-08-19 12:27:44 -04:00
Travis CI (pmd-bot) 056b0f73a8 Update documentation
TRAVIS_JOB_NUMBER=4118.1
TRAVIS_COMMIT_RANGE=febf512e9c77...780edaa5f5af
2019-08-18 04:55:24 +00:00
Juan Martín Sotuyo Dodero 780edaa5f5 Merge branch 'pr-1970' 2019-08-18 01:37:02 -03:00
Juan Martín Sotuyo Dodero f5b9f6be23 Update changelog, refs #1970 2019-08-18 01:36:19 -03:00
Juan Martín Sotuyo Dodero febf512e9c Merge branch 'pr-1968' 2019-08-18 01:28:07 -03:00
Andreas Dangel 882d5c67d2 Merge branch 'pr-1983' 2019-08-17 16:42:57 +02:00
Andreas Dangel 5dd890c1bb Update release notes, refs #1983 2019-08-17 16:42:21 +02:00
Andreas Dangel 29ea6834a5 Merge branch 'pr-1971' 2019-08-17 16:30:28 +02:00
Andreas Dangel c8034b7d30 Update release notes, fixes #1862, refs #1971 2019-08-17 16:30:10 +02:00
Juan Martín Sotuyo Dodero 8e9b992338 Improve assertion 2019-08-16 14:22:23 -03:00
Andreas Dangel bdd0f2c525 [core] Use real file name in ruleContext during analysis
* This is needed to fix #1923
* RuleContext, RuleViolations all use the real name
* The shortname is only applied by the renderers now
  at the end of the processing
* Error logging and reporting also uses the real, full name
  of the file being analysed
2019-08-16 11:22:48 +02:00
Juan Martín Sotuyo Dodero 660c018511 Fix failing test 2019-08-15 14:34:05 -03:00
Juan Martín Sotuyo Dodero 032acbd65d Add failing test for non-existing entries in classpath 2019-08-15 14:33:35 -03:00
Piotr Szymanski 9adc3079b6 fixed formatting 2019-08-14 14:30:10 +02:00
Piotr Szymanski dbe3840db1 fix for skipping sql starting with WITH 2019-08-14 14:28:13 +02:00
Piotr Szymanski a953433f5c lookahead in MultiplicativeExpression 2019-08-14 13:45:02 +02:00
Piotr Szymanski 8c669f5a47 formated plsql code 2019-08-14 12:28:32 +02:00
Piotr Szymanski 28b67091f0 fix for trim function with record type variable 2019-08-14 11:51:12 +02:00
Piotr Szymanski 182ba549ba fixes for referencing record type variables 2019-08-14 10:53:56 +02:00
Anton Kot 9796dc1431 docs_and_kotlin_version_rollback 2019-08-14 09:52:13 +02:00
Andreas Dangel 604ef548c9 Update release notes, fixes #1930 2019-08-13 20:48:06 +02:00
Andreas Dangel 2ba1422747 [java] Remove java12 break-with-expression support
This preview language feature has been replaced with
the yield statement in java 13.
2019-08-13 20:48:06 +02:00
Andreas Dangel ac4a0daff9 [java] Add Java 13 support
Fix type resolution of switch with yields
2019-08-13 20:48:01 +02:00
Andreas Dangel b110186ed7 [java] Add Java 13 support
* Add text block literal
2019-08-13 20:00:40 +02:00
Andreas Dangel 969972214c [java] Add Java 13 support
* Java 13 is the new default
* New yield statement
2019-08-13 18:42:40 +02:00
Piotr Szymanski f9ec14c309 issue-1947 added ForUpdateClause 2019-08-13 18:33:14 +02:00
Piotr Szymanski 363ceadeaa issue-1947 added ForUpdateClause 2019-08-13 18:15:26 +02:00
Anton Kot e581bba71e review_changes 2019-08-13 17:48:25 +02:00
Andreas Dangel 4ef5079f74 Fix unit tests when building with java13
Java13 has fixed https://bugs.openjdk.java.net/browse/JDK-8206132
which means, that setExpandEntityReferences==false is now honored
and works. The entities are no longer expanded.
2019-08-13 17:40:51 +02:00
Anton Kot ce4b2c6041 Issue_1862_No_Message_Digest_class_field 2019-08-12 13:02:26 +02:00
Tobias Weimer f8bb126c6c [java] DoubleBraceInitialization:
* Updated documentation to make the example compile (there is no varargs version of addAll(..))
2019-08-11 11:16:33 +02:00
Andreas Dangel fac5604d63 Merge branch 'pr-1956' 2019-08-10 22:21:22 +02:00
Andreas Dangel fc9a3cd5a0 Update release notes - add rule designer documentation 2019-08-10 22:21:06 +02:00
Andreas Dangel 331a9f941d (doc) Improve css for displaying details/summary tag 2019-08-10 22:14:27 +02:00
Andreas Dangel e3db6241f6 [apex] Sort trigger usages 2019-08-10 21:49:01 +02:00
Andreas Dangel efe8f9349d Merge branch 'master' into apex-supertype 2019-08-10 21:15:28 +02:00
Andreas Dangel 281ef3441b [apex] Expose more info on UserClass, UserInterface, UserTrigger
* Renamed ASTUserClass::getSuperTypeName to getSuperClassName
* Expose ASTUserClass::getInterfaceNames - comma separated
* Expose ASTUserInterface::getSuperInterfaceName
* Expose ASTUserTrigger::getTargetName and getUsages
2019-08-10 20:43:38 +02:00
Andreas Dangel 7f7213b8e7 [java] CloseResource: Fix NPE if type of method parameter is not known 2019-08-10 19:04:08 +02:00
Andreas Dangel 27164804f1 [java] CloseResource: fix false-negative when byte array is passed in 2019-08-10 18:11:28 +02:00
Andreas Dangel c87af46d3f Update release notes
* Reference fixed issues in test cases for CloseResources
* Fixes #1922
* Fixes #1966
* Fixes #1967
2019-08-10 12:25:42 +02:00
Andreas Dangel cb63f5f8c4 [java] CloseResource: add test case for #1076
The problem is not reproducible.
2019-08-10 12:03:17 +02:00
Andreas Dangel 377275edae [java] CloseResource: possible false positive with Streams
By default `java.util.stream.Stream` is now ignored.
Fixes #1922
2019-08-10 12:03:09 +02:00
Andreas Dangel e0535f4bce [java] CloseResource: add additional test case 2019-08-10 12:03:09 +02:00
Andreas Dangel ef8ed08ee0 [java] CloseResource: fix false positive with assignments before try 2019-08-10 12:03:09 +02:00
Andreas Dangel 619172560b [java] CloseResource: consider method parameters in general 2019-08-10 12:03:09 +02:00
Andreas Dangel 5b63d787c7 [java] CloseResource: ignore variables that are initialized from parameters
If a closable local variable is initialized from a method/constructor
parameter, then it is ignored. In that case, the resource is not created
in this method, but somewhere else. Therefore the resources should
be closed there.
2019-08-10 12:03:03 +02:00
Andreas Dangel 4a2943510c Fix excludes when creating src dist zip
The biggest part was the "vendor/**" stuff from ruby.
This is created during the build and should not be
part of the source distribution.

Also added a test to assert that some sensitive data
from .travis/ doesn't accidentally leak.
2019-08-09 21:46:03 +02:00
Chris Smith 9f923b5b6b Minor changes to work better with the PMD Designer 2019-08-09 10:54:09 -04:00
Chris Smith 0f7d5f1ec0 Added Scala AST Parser 2019-08-08 18:45:26 -04:00
Andreas Dangel 1a5486dc30 Merge branch 'pr-1954' 2019-08-04 11:22:56 +02:00
Andreas Dangel bf18d5dc87 (doc) apex bestpractices: Create a clickable link 2019-08-04 11:15:35 +02:00
Andreas Dangel 190dee7c59 [apex] Expose supertype name of UserClass
Fixes #1901
2019-08-04 11:07:58 +02:00
Andreas Dangel 1b7d0f8576 Update release notes, fixes #1951 2019-08-04 10:40:46 +02:00
Andreas Dangel f9d8898f7a [java] Fix FP for UnnecessaryFQNRule with sub packages 2019-08-04 10:39:56 +02:00
Andreas Dangel 8fdea448e4 [java] Compare ignored annotations by fully qualified names only
Fixes #1952
2019-08-03 12:31:28 +02:00
Clément Fournier 46a8d87fb7 Try to fix confused image reference
Build of #1956 is failing but just on macosx...
See https://travis-ci.org/pmd/pmd/jobs/566211322

Idk what's the problem, maybe it's because '(?!)' looks
like a negative lookahead
2019-08-01 01:37:32 +02:00
Clément Fournier 959c98c906 Fix dead link detection for image links 2019-08-01 01:00:25 +02:00
Clément Fournier 79b2de8549 Put designer wiki doc on the website
Fix absolute links

Add css for details tag

Add installation doc
2019-07-31 19:01:11 +02:00
Clément Fournier 225430953b Checkstyle 2019-07-30 19:43:49 +02:00
Andreas Dangel 091ce3d40e [java] Deprecate ASTImportDeclaration#getImportedNameNode() as well
Refs #1888
2019-07-30 19:30:19 +02:00
Clément Fournier 493e0014b0 Also fix a false negative 2019-07-30 16:47:21 +02:00
Clément Fournier fd3eac3c9d Fix #1951 - false positive for UnnecessaryFQCN 2019-07-30 16:28:16 +02:00
Andreas Dangel d935db0a6d Cleanup developers list in pom.xml. The contributors can easily be
retrieved at https://github.com/pmd/pmd/graphs/contributors
2019-07-29 19:50:26 +02:00
Andreas Dangel 295759456d [java] Deprecate ASTImportDeclaration#getPackage(), refs #1888 2019-07-28 18:35:12 +02:00
Andreas Dangel a651514e56 Prepare next development version 2019-07-28 10:28:43 +02:00
Andreas Dangel 7a7971f64d [maven-release-plugin] prepare for next development iteration 2019-07-28 10:24:51 +02:00
Renato Oliveira 6a3f4162bc Fixes strings on the tests' messages. 2019-07-27 12:32:52 -03:00
Renato Oliveira 2650b38db9 Removes "DebugsShouldSpecifyLoggingLevelRule" Java files and replaces it with an XPath rule and its test. 2019-07-27 12:28:39 -03:00
Renato Oliveira 698013fc0c Add automatically generated docs for Apex. 2019-07-26 00:26:22 -03:00
Renato Oliveira bc468b4f21 Fixes style by adding newlines and converting tabs to spaces. 2019-07-26 00:25:59 -03:00
Renato Oliveira 47583eea24 Fixes wrong rule name in best practices xml rule descriptor. 2019-07-25 23:38:02 -03:00
Renato Oliveira 6e67528a7c Add rule file and test case. 2019-07-25 23:14:53 -03:00
Renato Oliveira 75f20ba7f5 Fixes the name of the rule in the best practices category file. 2019-07-25 23:14:12 -03:00
Renato Oliveira 58582dd306 Add the "system.debug should use logging level" rule. 2019-07-25 21:59:01 -03:00
617 changed files with 14229 additions and 21204 deletions
+3
View File
@@ -13,3 +13,6 @@ bin/
pmd-core/dependency-reduced-pom.xml
.bundle
vendor
# rule docs are generated
docs/pages/pmd/rules
+11 -13
View File
@@ -1,7 +1,3 @@
addons:
ssh_known_hosts:
- web.sourceforge.net
language: java
env:
@@ -17,6 +13,8 @@ env:
matrix:
fast_finish: true
allow_failures:
- os: windows
include:
- name: "linux - mvn deploy"
os: linux
@@ -37,16 +35,15 @@ matrix:
- name: "macosx - mvn verify"
os: osx
env: BUILD=deploy
- name: "windows - mvn verify"
os: windows
env: BUILD=deploy
language: shell
before_install:
- bash .travis/setup-secrets.sh
- bash .travis/configure-maven.sh
- rvm install 2.4.1
- rvm use 2.4.1
install:
- . .travis/install-openjdk.sh
- gem install bundler
- bundle install --with=release_notes_preprocessing --path=vendor/bundle
- bash .travis/before_install.sh "11.0.5+10"
- source ${HOME}/java.env
install: true
before_script: true
script: source .travis/build-$BUILD.sh
after_success: true
@@ -61,10 +58,11 @@ deploy:
- pmd-dist/target/pmd-*.zip
- docs/pmd-doc-*.zip
skip_cleanup: true
draft: true
on:
tags: true
repo: pmd/pmd
condition: "${TRAVIS_SECURE_ENV_VARS} = true && ${BUILD} != sonar && ${BUILD} != coveralls"
condition: "${TRAVIS_SECURE_ENV_VARS} = true && ${BUILD} != sonar && ${BUILD} != coveralls && ${TRAVIS_OS_NAME} = linux"
after_deploy: bash .travis/release.sh
notifications:
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
set -e
source .travis/logger.sh
source .travis/common-functions.sh
travis_debug
OPENJDK_VERSION=$1
bash .travis/setup-secrets.sh
bash .travis/configure-maven.sh
bash .travis/install-openjdk.sh $OPENJDK_VERSION
if travis_isLinux; then
gem install bundler
bundle install --with=release_notes_preprocessing --path=vendor/bundle
else
log_info "Not setting up ruby for ${TRAVIS_OS_NAME}."
exit 0
fi
+5 -24
View File
@@ -4,29 +4,6 @@ set -e
source .travis/logger.sh
source .travis/common-functions.sh
function push_docs() {
if git diff --quiet docs; then
log_info "No changes in docs..."
else
log_info "Found changes in docs..."
if [ "$TRAVIS_BRANCH" == "master" ]; then
git config user.name "Travis CI (pmd-bot)"
git config user.email "andreas.dangel+pmd-bot@adangel.org"
git add -A docs
MSG="Update documentation
TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER}
TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}"
git commit -m "$MSG"
git push git@github.com:pmd/pmd.git HEAD:master
log_success "Successfully pushed docs update"
else
log_info "Not on master branch, won't commit+push"
fi
fi
}
function upload_baseline() {
log_info "Generating and uploading baseline for pmdtester..."
cd ..
@@ -55,6 +32,11 @@ if travis_isOSX; then
log_info "The build is running on OSX"
./mvnw verify $MVN_BUILD_FLAGS
elif travis_isWindows; then
log_info "The build is running on Windows"
./mvnw verify $MVN_BUILD_FLAGS
elif travis_isPullRequest; then
log_info "This is a pull-request build"
@@ -80,7 +62,6 @@ elif travis_isPush; then
elif [[ "${VERSION}" == *-SNAPSHOT ]]; then
log_info "This is a snapshot build"
./mvnw deploy -Possrh,sign $MVN_BUILD_FLAGS
push_docs
else
# other build. Can happen during release: the commit with a non snapshot version is built, but not from the tag.
log_info "This is some other build, probably during release: commit with a non-snapshot version on branch master..."
+17 -1
View File
@@ -7,11 +7,27 @@ source .travis/common-functions.sh
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
log_info "Building PMD Documentation ${VERSION} on branch ${TRAVIS_BRANCH}"
#
# First step: build pmd with profile "generate-rule-docs"
# The docs should appear under "docs/pages/rules/..." for each language
#
./mvnw clean verify -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -P generate-rule-docs
# in order to prevent that this documentation job is deploying the binary distributions to github releases
# we delete it here
rm -f pmd-dist/target/pmd-*.zip
if ! travis_isPush; then
log_info "Not building site, since this is not a push!"
log_info "Not publishing site, since this is not a push!"
exit 0
fi
pushd docs
# run jekyll
+28 -9
View File
@@ -2,15 +2,17 @@
set -e
echo "TRAVIS_REPO_SLUG: ${TRAVIS_REPO_SLUG}"
echo "TRAVIS_PULL_REQUEST_SLUG: ${TRAVIS_PULL_REQUEST_SLUG}"
echo "TRAVIS_PULL_REQUEST_BRANCH: ${TRAVIS_PULL_REQUEST_BRANCH}"
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"
echo "TRAVIS_SECURE_ENV_VARS: ${TRAVIS_SECURE_ENV_VARS}"
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
echo "TRAVIS_TAG: ${TRAVIS_TAG}"
echo "TRAVIS_ALLOW_FAILURE: ${TRAVIS_ALLOW_FAILURE}"
echo "TRAVIS_OS_NAME: ${TRAVIS_OS_NAME}"
function travis_debug() {
echo "TRAVIS_REPO_SLUG: ${TRAVIS_REPO_SLUG}"
echo "TRAVIS_PULL_REQUEST_SLUG: ${TRAVIS_PULL_REQUEST_SLUG}"
echo "TRAVIS_PULL_REQUEST_BRANCH: ${TRAVIS_PULL_REQUEST_BRANCH}"
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"
echo "TRAVIS_SECURE_ENV_VARS: ${TRAVIS_SECURE_ENV_VARS}"
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
echo "TRAVIS_TAG: ${TRAVIS_TAG}"
echo "TRAVIS_ALLOW_FAILURE: ${TRAVIS_ALLOW_FAILURE}"
echo "TRAVIS_OS_NAME: ${TRAVIS_OS_NAME}"
}
function travis_isPullRequest() {
if [ "${TRAVIS_REPO_SLUG}" != "pmd/pmd" ] || [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
@@ -36,6 +38,23 @@ function travis_isOSX() {
fi
}
function travis_isLinux() {
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
return 0
else
return 1
fi
}
function travis_isWindows() {
if [[ $TRAVIS_OS_NAME == 'windows' ]]; then
return 0
else
return 1
fi
}
function has_docs_change() {
if [[ $(git diff --name-only ${TRAVIS_COMMIT_RANGE}) = *"docs/"* ]]; then
log_info "Checking for changes in docs/ (TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}): changes found"
+43 -8
View File
@@ -1,27 +1,62 @@
#!/bin/bash
set -e
#
# AdoptOpenJDK Builds from:
# https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/tag/jdk-11.0.4%2B11
#
if [[ "$OSTYPE" == "darwin"* ]]; then
DOWNLOAD_URL=https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_x64_mac_hotspot_11.0.4_11.tar.gz
source .travis/logger.sh
source .travis/common-functions.sh
# VERSION_TAG e.g. "11.0.4+11" or "13+33"
VERSION_TAG=$1
OPENJDK_MAJOR=${VERSION_TAG/.*/}
OPENJDK_MAJOR=${OPENJDK_MAJOR/+*/}
#BASE_URL=https://github.com/AdoptOpenJDK/openjdk${OPENJDK_MAJOR}-binaries/releases/download
BASE_URL=https://pmd-code.org/openjdk
log_info "Installing OpenJDK${OPENJDK_MAJOR}U ${VERSION_TAG} for ${TRAVIS_OS_NAME}"
if travis_isOSX; then
DOWNLOAD_URL=${BASE_URL}/jdk-${VERSION_TAG/+/%2B}/OpenJDK${OPENJDK_MAJOR}U-jdk_x64_mac_hotspot_${VERSION_TAG/+/_}.tar.gz
COMPONENTS_TO_STRIP=3 # e.g. jdk-11.0.3+7/Contents/Home/bin/java
elif travis_isWindows; then
DOWNLOAD_URL=${BASE_URL}/jdk-${VERSION_TAG/+/%2B}/OpenJDK${OPENJDK_MAJOR}U-jdk_x64_windows_hotspot_${VERSION_TAG/+/_}.zip
else
DOWNLOAD_URL=https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_x64_linux_hotspot_11.0.4_11.tar.gz
DOWNLOAD_URL=${BASE_URL}/jdk-${VERSION_TAG/+/%2B}/OpenJDK${OPENJDK_MAJOR}U-jdk_x64_linux_hotspot_${VERSION_TAG/+/_}.tar.gz
COMPONENTS_TO_STRIP=1 # e.g. openjdk-11.0.3+7/bin/java
fi
OPENJDK_ARCHIVE=$(basename $DOWNLOAD_URL)
LOCAL_DIR=${HOME}/.cache/openjdk
TARGET_DIR=${HOME}/openjdk11
TARGET_DIR=${HOME}/openjdk${OPENJDK_MAJOR}
mkdir -p ${LOCAL_DIR}
mkdir -p ${TARGET_DIR}
wget --quiet --directory-prefix ${LOCAL_DIR} --timestamping --continue ${DOWNLOAD_URL}
tar --extract --file ${LOCAL_DIR}/${OPENJDK_ARCHIVE} -C ${TARGET_DIR} --strip-components=${COMPONENTS_TO_STRIP}
if [ ! -e ${LOCAL_DIR}/${OPENJDK_ARCHIVE} ]; then
log_info "Downloading from ${DOWNLOAD_URL} to ${LOCAL_DIR}"
wget --directory-prefix ${LOCAL_DIR} --timestamping --continue ${DOWNLOAD_URL}
else
log_info "Skipped download, file ${LOCAL_DIR}/${OPENJDK_ARCHIVE} already exists"
fi
export JAVA_HOME=${TARGET_DIR}
export PATH=${JAVA_HOME}/bin:$PATH
log_info "Extracting to ${TARGET_DIR}"
if travis_isWindows; then
7z x ${LOCAL_DIR}/${OPENJDK_ARCHIVE} -o${TARGET_DIR}
mv ${TARGET_DIR}/*/* ${TARGET_DIR}/
else
tar --extract --file ${LOCAL_DIR}/${OPENJDK_ARCHIVE} -C ${TARGET_DIR} --strip-components=${COMPONENTS_TO_STRIP}
fi
cat > ${HOME}/java.env <<EOF
export JAVA_HOME="${TARGET_DIR}"
export PATH="${TARGET_DIR}/bin:${PATH}"
java -version
EOF
log_info "OpenJDK can be used via ${HOME}/java.env"
cat ${HOME}/java.env
source ${HOME}/java.env
+34 -32
View File
@@ -28,38 +28,6 @@ if [ "${BUILD}" = "deploy" ]; then
true
)
# renders, and skips the first 6 lines - the Jekyll front-matter
RENDERED_RELEASE_NOTES=$(bundle exec .travis/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)
# Assumes, the release has already been created by travis github releases provider
RELEASE_ID=$(curl -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" https://api.github.com/repos/pmd/pmd/releases/tags/pmd_releases/${RELEASE_VERSION}|jq ".id")
RELEASE_NAME="PMD ${RELEASE_VERSION} ($(date -u +%d-%B-%Y))"
RELEASE_BODY="$RENDERED_RELEASE_NOTES"
RELEASE_BODY="${RELEASE_BODY//'\'/\\\\}"
RELEASE_BODY="${RELEASE_BODY//$'\r'/}"
RELEASE_BODY="${RELEASE_BODY//$'\n'/\\r\\n}"
RELEASE_BODY="${RELEASE_BODY//'"'/\\\"}"
cat > release-edit-request.json <<EOF
{
"name": "$RELEASE_NAME",
"body": "$RELEASE_BODY"
}
EOF
log_info "Updating release at https://api.github.com/repos/pmd/pmd/releases/${RELEASE_ID}..."
RESPONSE=$(curl -i -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" -H "Content-Type: application/json" --data "@release-edit-request.json" -X PATCH https://api.github.com/repos/pmd/pmd/releases/${RELEASE_ID})
if [[ "$RESPONSE" != *"HTTP/1.1 200"* ]]; then
log_error "Github Request failed!"
echo "Request:"
cat release-edit-request.json
echo
echo "Response:"
echo "$RESPONSE"
else
log_success "Update OK"
fi
fi
@@ -107,6 +75,40 @@ mkdir pmd.github.io
git push origin master
)
# renders, and skips the first 6 lines - the Jekyll front-matter
RENDERED_RELEASE_NOTES=$(bundle exec .travis/render_release_notes.rb docs/pages/release_notes.md | tail -n +6)
# Assumes, the release has already been created by travis github releases provider
RELEASE_ID=$(curl -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" https://api.github.com/repos/pmd/pmd/releases/tags/pmd_releases/${RELEASE_VERSION}|jq ".id")
RELEASE_NAME="PMD ${RELEASE_VERSION} ($(date -u +%d-%B-%Y))"
RELEASE_BODY="$RENDERED_RELEASE_NOTES"
RELEASE_BODY="${RELEASE_BODY//'\'/\\\\}"
RELEASE_BODY="${RELEASE_BODY//$'\r'/}"
RELEASE_BODY="${RELEASE_BODY//$'\n'/\\r\\n}"
RELEASE_BODY="${RELEASE_BODY//'"'/\\\"}"
cat > release-edit-request.json <<EOF
{
"name": "$RELEASE_NAME",
"body": "$RELEASE_BODY",
"draft": false
}
EOF
echo -e "\n\n"
log_info "Updating and publishing release at https://api.github.com/repos/pmd/pmd/releases/${RELEASE_ID}..."
RESPONSE=$(curl -i -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" -H "Content-Type: application/json" --data "@release-edit-request.json" -X PATCH https://api.github.com/repos/pmd/pmd/releases/${RELEASE_ID})
if [[ "$RESPONSE" != *"HTTP/1.1 200"* ]]; then
log_error "Github Request failed!"
echo "Request:"
cat release-edit-request.json
echo
echo "Response:"
echo "$RESPONSE"
else
log_success "Update OK"
fi
(
+23
View File
@@ -22,3 +22,26 @@ mkdir -p "$HOME/.gpg"
gpg --batch --import .travis/release-signing-key-82DE7BE82166E84E.gpg
rm .travis/secrets.tar
rm .travis/release-signing-key-82DE7BE82166E84E.gpg
echo "Setting up .ssh/known_hosts..."
#
# https://sourceforge.net/p/forge/documentation/SSH%20Key%20Fingerprints/
#
# run locally:
# ssh-keyscan web.sourceforge.net | tee -a known_hosts
#
# verify fingerprints:
# ssh-keygen -F web.sourceforge.net -l -f known_hosts
# # Host web.sourceforge.net found: line 1
# web.sourceforge.net RSA SHA256:xB2rnn0NUjZ/E0IXQp4gyPqc7U7gjcw7G26RhkDyk90
# # Host web.sourceforge.net found: line 2
# web.sourceforge.net ECDSA SHA256:QAAxYkf0iI/tc9oGa0xSsVOAzJBZstcO8HqGKfjpxcY
# # Host web.sourceforge.net found: line 3
# web.sourceforge.net ED25519 SHA256:209BDmH3jsRyO9UeGPPgLWPSegKmYCBIya0nR/AWWCY
#
# then add output of `ssh-keygen -F web.sourceforge.net -f known_hosts`
#
echo 'web.sourceforge.net ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2uifHZbNexw6cXbyg1JnzDitL5VhYs0E65Hk/tLAPmcmm5GuiGeUoI/B0eUSNFsbqzwgwrttjnzKMKiGLN5CWVmlN1IXGGAfLYsQwK6wAu7kYFzkqP4jcwc5Jr9UPRpJdYIK733tSEmzab4qc5Oq8izKQKIaxXNe7FgmL15HjSpatFt9w/ot/CHS78FUAr3j3RwekHCm/jhPeqhlMAgC+jUgNJbFt3DlhDaRMa0NYamVzmX8D47rtmBbEDU3ld6AezWBPUR5Lh7ODOwlfVI58NAf/aYNlmvl2TZiauBCTa7OPYSyXJnIPbQXg6YQlDknNCr0K769EjeIlAfY87Z4tw==' >> "$HOME/.ssh/known_hosts"
echo 'web.sourceforge.net ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCwsY6sZT4MTTkHfpRzYjxG7mnXrGL74RCT2cO/NFvRrZVNB5XNwKNn7G5fHbYLdJ6UzpURDRae1eMg92JG0+yo=' >> "$HOME/.ssh/known_hosts"
echo 'web.sourceforge.net ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOQD35Ujalhh+JJkPvMckDlhu4dS7WH6NsOJ15iGCJLC' >> "$HOME/.ssh/known_hosts"
+86
View File
@@ -0,0 +1,86 @@
GIT
remote: https://github.com/pmd/pmd-regression-tester.git
revision: 8e652477b3547d6c843864a2641389a4c61c383e
specs:
pmdtester (1.0.0.pre.SNAPSHOT)
differ
nokogiri (~> 1.8.2)
rufus-scheduler (~> 3.5, >= 3.5)
slop (~> 4.6.2)
GEM
remote: https://rubygems.org/
specs:
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
claide (1.0.3)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
colored2 (3.1.2)
concurrent-ruby (1.1.5)
cork (0.3.0)
colored2 (~> 3.1)
danger (5.16.1)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
cork (~> 0.1)
faraday (~> 0.9)
faraday-http-cache (~> 1.0)
git (~> 1.5)
kramdown (~> 1.5)
no_proxy_fix
octokit (~> 4.7)
terminal-table (~> 1)
differ (0.1.2)
et-orbi (1.2.2)
tzinfo
faraday (0.16.2)
multipart-post (>= 1.2, < 3)
faraday-http-cache (1.3.1)
faraday (~> 0.8)
fugit (1.3.3)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.1)
git (1.5.0)
kramdown (1.17.0)
liquid (4.0.3)
mini_portile2 (2.3.0)
multipart-post (2.1.1)
nap (1.1.0)
no_proxy_fix (0.1.2)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
octokit (4.14.0)
sawyer (~> 0.8.0, >= 0.5.3)
open4 (1.3.4)
public_suffix (4.0.1)
raabro (1.1.6)
rouge (3.11.0)
rufus-scheduler (3.6.0)
fugit (~> 1.1, >= 1.1.6)
safe_yaml (1.0.5)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
slop (4.6.2)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tzinfo (2.0.0)
concurrent-ruby (~> 1.0)
unicode-display_width (1.6.0)
PLATFORMS
ruby
DEPENDENCIES
danger (~> 5.6, >= 5.6)
liquid (>= 4.0.0)
pmdtester!
rouge (>= 1.7, < 4)
safe_yaml (>= 1.0)
BUNDLED WITH
2.0.1
-168
View File
@@ -235,171 +235,3 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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.
---------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
-4
View File
@@ -6,7 +6,3 @@ for more info see http://pmd.sourceforge.net/license.html or LICENSE
Part of this product (mostly the package net.sourceforge.pmd.lang.vm)
is licensed under the Apache License, Version 2.0;
for more info see http://www.apache.org/licenses/LICENSE-2.0 or LICENSE
Part of this product (part of pmd-scala)
is licensed under the GNU Lesser General Public License, Version 3 or later
for more info see http://www.gnu.org/licenses/lgpl.txt or LICENSE
+2 -2
View File
@@ -8,8 +8,8 @@
## About
**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 Java, JavaScript, Salesforce.com Apex and Visualforce, PLSQL, Apache Velocity,
XML, XSL.
unnecessary object creation, and so forth. It supports Java, JavaScript, Salesforce.com Apex and Visualforce,
PLSQL, Apache Velocity, XML, XSL, Scala.
Additionally it includes **CPD**, the copy-paste-detector. CPD finds duplicated code in
C/C++, C#, Dart, Fortran, Go, Groovy, Java, JavaScript, JSP, Kotlin, Lua, Matlab,
+5 -3
View File
@@ -112,11 +112,13 @@ fi
git commit -a -m "Prepare pmd release ${RELEASE_VERSION}"
(
echo "Committing current changes (pmd.github.io)"
cd ../pmd.github.io
git add ${RELEASE_NOTES_POST}
git commit -a -m "Prepare pmd release ${RELEASE_VERSION}"
git push
changes=$(git status --porcelain 2>/dev/null| egrep "^[AMDRC]" | wc -l)
if [ $changes -gt 0 ]; then
echo "Committing current changes (pmd.github.io)"
git commit -a -m "Prepare pmd release ${RELEASE_VERSION}" && git push
fi
)
./mvnw -B release:clean release:prepare \
+48 -47
View File
@@ -1,13 +1,13 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.10)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
coffee-script (2.4.1)
coffee-script-source
execjs
@@ -15,39 +15,39 @@ GEM
colorator (1.1.0)
commonmarker (0.17.13)
ruby-enum (~> 0.5)
concurrent-ruby (1.1.3)
dnsruby (1.61.2)
concurrent-ruby (1.1.5)
dnsruby (1.61.3)
addressable (~> 2.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
ethon (0.11.0)
ethon (0.12.0)
ffi (>= 1.3.0)
eventmachine (1.2.7)
execjs (2.7.0)
faraday (0.15.3)
faraday (0.16.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.25)
ffi (1.11.1)
forwardable-extended (2.6.0)
gemoji (3.0.0)
github-pages (193)
activesupport (= 4.2.10)
github-pages-health-check (= 1.8.1)
jekyll (= 3.7.4)
gemoji (3.0.1)
github-pages (200)
activesupport (= 4.2.11.1)
github-pages-health-check (= 1.16.1)
jekyll (= 3.8.5)
jekyll-avatar (= 0.6.0)
jekyll-coffeescript (= 1.1.1)
jekyll-commonmark-ghpages (= 0.1.5)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.11.0)
jekyll-gist (= 1.5.0)
jekyll-github-metadata (= 2.9.4)
jekyll-github-metadata (= 2.12.1)
jekyll-mentions (= 1.4.1)
jekyll-optional-front-matter (= 0.3.0)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.2.0)
jekyll-redirect-from (= 0.14.0)
jekyll-relative-links (= 0.5.3)
jekyll-remote-theme (= 0.3.1)
jekyll-relative-links (= 0.6.0)
jekyll-remote-theme (= 0.4.0)
jekyll-sass-converter (= 1.5.2)
jekyll-seo-tag (= 2.5.0)
jekyll-sitemap (= 1.2.0)
@@ -66,28 +66,28 @@ GEM
jekyll-theme-tactile (= 0.1.1)
jekyll-theme-time-machine (= 0.1.1)
jekyll-titles-from-headings (= 0.5.1)
jemoji (= 0.10.1)
jemoji (= 0.10.2)
kramdown (= 1.17.0)
liquid (= 4.0.0)
listen (= 3.1.5)
mercenary (~> 0.3)
minima (= 2.5.0)
nokogiri (>= 1.8.2, < 2.0)
nokogiri (>= 1.10.4, < 2.0)
rouge (= 2.2.1)
terminal-table (~> 1.4)
github-pages-health-check (1.8.1)
github-pages-health-check (1.16.1)
addressable (~> 2.3)
dnsruby (~> 1.60)
octokit (~> 4.0)
public_suffix (~> 2.0)
public_suffix (~> 3.0)
typhoeus (~> 1.3)
html-pipeline (2.9.1)
html-pipeline (2.12.0)
activesupport (>= 2)
nokogiri (>= 1.4)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.7.4)
jekyll (3.8.5)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
@@ -105,9 +105,9 @@ GEM
jekyll-coffeescript (1.1.1)
coffee-script (~> 2.2)
coffee-script-source (~> 1.11.1)
jekyll-commonmark (1.2.0)
jekyll-commonmark (1.3.1)
commonmarker (~> 0.14)
jekyll (>= 3.0, < 4.0)
jekyll (>= 3.7, < 5.0)
jekyll-commonmark-ghpages (0.1.5)
commonmarker (~> 0.17.6)
jekyll-commonmark (~> 1)
@@ -118,8 +118,8 @@ GEM
jekyll (~> 3.3)
jekyll-gist (1.5.0)
octokit (~> 4.2)
jekyll-github-metadata (2.9.4)
jekyll (~> 3.1)
jekyll-github-metadata (2.12.1)
jekyll (~> 3.4)
octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.4.1)
html-pipeline (~> 2.3)
@@ -131,9 +131,10 @@ GEM
jekyll (~> 3.0)
jekyll-redirect-from (0.14.0)
jekyll (~> 3.3)
jekyll-relative-links (0.5.3)
jekyll-relative-links (0.6.0)
jekyll (~> 3.3)
jekyll-remote-theme (0.3.1)
jekyll-remote-theme (0.4.0)
addressable (~> 2.0)
jekyll (~> 3.5)
rubyzip (>= 1.2.1, < 3.0)
jekyll-sass-converter (1.5.2)
@@ -185,9 +186,9 @@ GEM
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.5.1)
jekyll (~> 3.3)
jekyll-watch (2.1.2)
jekyll-watch (2.2.1)
listen (~> 3.0)
jemoji (0.10.1)
jemoji (0.10.2)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (~> 3.0)
@@ -198,37 +199,37 @@ GEM
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
mini_portile2 (2.3.0)
mini_portile2 (2.4.0)
minima (2.5.0)
jekyll (~> 3.5)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.11.3)
multipart-post (2.0.0)
nokogiri (1.8.5)
mini_portile2 (~> 2.3.0)
octokit (4.13.0)
minitest (5.12.2)
multipart-post (2.1.1)
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
octokit (4.14.0)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (2.0.5)
public_suffix (3.1.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rb-inotify (0.10.0)
ffi (~> 1.0)
rouge (2.2.1)
ruby-enum (0.7.2)
i18n
ruby_dep (1.5.0)
rubyzip (1.2.2)
safe_yaml (1.0.4)
sass (3.7.2)
rubyzip (2.0.0)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
@@ -236,7 +237,7 @@ GEM
ethon (>= 0.9.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.4.0)
unicode-display_width (1.6.0)
PLATFORMS
ruby
@@ -246,4 +247,4 @@ DEPENDENCIES
jekyll
BUNDLED WITH
1.16.2
1.17.3
+3 -3
View File
@@ -1,9 +1,9 @@
repository: pmd/pmd
pmd:
version: 6.17.0
previous_version: 6.16.0
date: 28-July-2019
version: 6.19.0
previous_version: 6.18.0
date: 31-October-2019
release_type: minor
# release types: major, minor, bugfix
+3
View File
@@ -67,6 +67,9 @@ entries:
- title: Writing XPath rules
url: /pmd_userdocs_extending_writing_xpath_rules.html
output: web, pdf
- title: Rule designer reference
url: /pmd_userdocs_extending_designer_reference.html
output: web, pdf
- title: Defining rule properties
url: /pmd_userdocs_extending_defining_properties.html
output: web, pdf
+22
View File
@@ -0,0 +1,22 @@
# Mimics an HTML <details> element
# Courtesy of https://github.com/towbi (https://gist.github.com/towbi/a67fda47e075d2b7fa4764bb42605063)
class DetailsTag < Liquid::Block
def initialize(tag_name, markup, tokens)
super
@caption = markup
end
def render(context)
site = context.registers[:site]
converter = site.find_converter_instance(::Jekyll::Converters::Markdown)
# below Jekyll 3.x use this:
# converter = site.getConverterImpl(::Jekyll::Converters::Markdown)
caption = converter.convert(@caption).gsub(/<\/?p[^>]*>/, '').chomp
body = converter.convert(super(context))
"<details><summary>#{caption}</summary>#{body}</details>"
end
end
Liquid::Template.register_tag('details', DetailsTag)
+33 -1
View File
@@ -19,4 +19,36 @@
top: 50px; /* height of the nav bar */
bottom: 0px;
width: 100%;
}
}
details {
border-radius: 3px;
background: #EEE;
margin-left: 10px;
}
details p {
padding: 5px 10px 5px;
background: white;
}
details summary {
font-size: 11pt;
vertical-align: top;
background: #d2d2d2;
color: black;
border-radius: 3px;
padding: 5px 10px;
outline: none;
cursor: pointer;
display: list-item;
}
details summary::after {
content: "...";
}
details[open] summary {
background-color: #347DBE;
color: white;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Some files were not shown because too many files have changed in this diff Show More