Commit Graph

2816 Commits

Author SHA1 Message Date
7b5e9703ec [java] AvoidLiteralsInIfCondition: add property ignoreExpressions
The property ignoreExpressions is set to true in order to keep
the rule backwards compatible.
2019-12-16 11:17:25 +01:00
1cfd14ec7c [java] AvoidLiteralsInIfCondition: add additional check for expressions 2019-12-16 11:17:21 +01:00
c0d0fd3fbe [java] AvoidLiteralsInIfCondition: report Literal rather than IfCondition
If the IfCondition spans multiple lines, it easier to spot the
literal, if the violation is reported on the correct line where
the literal is located.
2019-12-16 11:17:21 +01:00
ed253183aa [java] AvoidLiteralsInIfCondition: false negative for expressions
Fixes #2140
2019-12-16 11:17:17 +01:00
76d33ea3dd Fix checkstyle 2019-12-16 11:06:33 +01:00
eddff1449e Deprecate TypeKind and related 2019-12-16 00:26:05 +01:00
da194bf427 Merge branch 'pr-2148'
[java] Fix false negative for StringInstantion with array access
2019-12-13 20:14:52 +01:00
2b1e21bf11 Merge branch 'pr-2151'
[java] Fix false-positive in JUnitAssertionsShouldIncludeMessage
2019-12-13 20:10:50 +01:00
1f0caf5034 Merge branch 'master' into deprecate-rvf-impls 2019-12-09 01:09:27 +01:00
c5b332d7fd Also deprecate JavaDataFlowHandler 2019-12-08 14:17:56 +01:00
5545927bd9 Do the same for Java language handlers 2019-12-08 14:17:19 +01:00
088f077407 Deprecate AbstractJavaParser
Internalize JavaLanguageParser
2019-12-08 14:15:59 +01:00
71bf676225 Remove unnecessary CDATA in JUnitAssertionsShouldIncludeMessage.xml 2019-12-08 12:15:03 +01:00
9502cae042 [java] JUnitAssertionsShouldIncludeMessage - False positive with assertEquals and JUnit5
Fixes #2149
2019-12-08 12:10:32 +01:00
b7d61fca94 [java] StringInstantiation: fix false negative with multi-dim arr access 2019-12-06 12:21:11 +01:00
9616312de2 [java] Support type resolution for array access expressions 2019-12-06 12:21:06 +01:00
3b6fcf4b7a [java] StringInstatiation: False negative with String-array access
Fixes #2141
2019-12-06 11:18:27 +01:00
b1fc3110de [java] StringInstatiation tests - remove unnecessary CDATA 2019-12-06 10:52:43 +01:00
b1ba962ddf Deprecate RuleViolation impls 2019-12-05 15:26:03 +01:00
eb6ceef085 Add comments and update release notes 2019-12-05 15:23:07 +01:00
bb7478cd0a Deprecate RuleViolationFactory impls
Internal APIs
2019-12-05 15:18:35 +01:00
00392cefc2 [maven-release-plugin] prepare for next development iteration 2019-11-29 19:46:14 +01:00
78da370fb8 [maven-release-plugin] prepare release pmd_releases/6.20.0 2019-11-29 19:46:05 +01:00
c5d79a0db4 Merge branch 'pr-2138'
[java] Preserve possible type of the target reference for method invocations
2019-11-29 18:41:20 +01:00
3a2791007e Fix checkstyle 2019-11-29 10:39:51 +01:00
a85638a0e0 [java] Preserve possible type of the target reference for method invocations
We already resolved the result type of a method invocation,
but in some cases, we also need the type of the target reference
for static method calls.

Reverts the previously introduced fix in UnusedImportsRule.

Fixes #2016
2019-11-29 10:27:19 +01:00
e106e7ac12 [java] ImmutableField: False positive when variable is updated in conditional loop
Fixes #2125
2019-11-24 10:20:21 +01:00
f013497b1c fix import 2019-11-22 15:10:55 +01:00
dd391ab78e [java] UnusedImports: False positive if wildcard is used and only static methods
Added workaround for wrong typeresolution
(method result vs. class of method)

Refs #2016
2019-11-22 15:04:17 +01:00
e485396b3a Merge branch 'pr-2121'
[java] Predicates treated like booleans
2019-11-21 20:23:06 +01:00
f5dc2fe80f [java] LinguisticNaming: Add test case for method returning predicate 2019-11-21 20:20:21 +01:00
f8bf862d43 Merge branch 'pr-2113'
[java] UnnecessaryFullyQualifiedName false-positive for non-static
nested classes
2019-11-21 20:09:15 +01:00
9cf0083bce Merge branch 'pr-2112'
[java] ImmutableField false positive with inner class
2019-11-21 20:06:46 +01:00
c25049a24b Merge branch 'pr-2111'
[java] False positive MissingStaticMethodInNonInstantiatableClass ...
when inheritors are instantiable
2019-11-21 20:05:20 +01:00
b1b3b37095 Merge branch 'pr-2099'
[java] UnnecessaryFullyQualifiedName: regression / false positive
2019-11-21 20:00:49 +01:00
533b32a992 Slight adjustments in the test cases 2019-11-19 21:13:58 +01:00
6306809a8d Corrected naming 2019-11-19 20:50:34 +01:00
c41dc3f5ab Fixed the test and added a second one 2019-11-19 20:25:50 +01:00
ef476a6e9e isBoolean method also returns true for Predicates
Tests are commented out. They only work if the java version is increased to 8 on the pom.xml.
2019-11-18 22:40:44 +01:00
461977b8f6 [java] UnnecessaryFullyQualifiedName false-positive for non-static nested classes
Fixes #2029
2019-11-15 13:06:31 +01:00
9dbbfba420 [java] ImmutableField false positive with inner class
Fixes #2075
2019-11-15 10:17:59 +01:00
f93bea624c [java] False positive MissingStaticMethodInNonInstantiatableClass when inheritors are instantiable
Fixes #2102
2019-11-15 09:52:55 +01:00
60f11fcb7d fix reporting of innerclass classnames 2019-11-12 14:33:33 +01:00
206ae6ef96 [java] UnnecessaryFullyQualifiedName: Fix false-neg with nested exceptions 2019-11-08 18:05:24 +01:00
bb8fbb8c1d [java] UnnecessaryFullyQualifiedName: Fix false-neg with nested classes 2019-11-08 15:12:15 +01:00
f3c4ec9ad9 [java] UnnecessaryFullyQualifiedName: regression / false positive
Fixes #2098
2019-11-08 11:36:26 +01:00
33b5263035 [java] Support more language version aliases
javac understands for --source both "1.5" and "5" and also "1.9" and
"1.10". Tested with openjdk13.
javac understands for --release "7" and higher. javac 10 had
support for "6".
This means, not all variants work in all constellations, but PMD
should understand now the correct version regardless how it is
specified.
2019-11-08 10:19:15 +01:00
b2a34c104d Add more version shortcuts for older java
Newer java compiler (java 9+) support the `--release` option to choose
for which version of the JRE to compile. This parameter only takes
simple values as documented by `javac --help`:

```
--release <release>
        Compile for a specific VM version. Supported targets: 6, 7, 8, 9, 10, 11
```

adding these versions to pmd allows the use of the same versions (6, 7
and 8) with PMD as with the compiler, thus removing the need to juggle
between single digit versions for the compiler and 1.<x> for PMD.
2019-11-08 09:10:49 +01:00
deec9c44b2 [maven-release-plugin] prepare for next development iteration 2019-10-31 18:36:51 +01:00
2881b6f585 [maven-release-plugin] prepare release pmd_releases/6.19.0 2019-10-31 18:36:42 +01:00