diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index 372162e0fc..82550f49ff 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -22,7 +22,7 @@ This is a {{ site.pmd.release_type }} release. the type inference in Java has been improved. In order to avoid false positives when checking Java7 only code, the rule has the new property - `java7compatibility`, which is disabled by default. Settings this to "true" retains + `java7Compatibility`, which is disabled by default. Settings this to "true" retains the old rule behaviour. ### Fixed Issues diff --git a/pmd-java/src/main/resources/category/java/codestyle.xml b/pmd-java/src/main/resources/category/java/codestyle.xml index 80109ed66f..63cd7d11d7 100644 --- a/pmd-java/src/main/resources/category/java/codestyle.xml +++ b/pmd-java/src/main/resources/category/java/codestyle.xml @@ -1995,7 +1995,7 @@ which makes the code also more readable. The diamond operator has been introduced with java 7. However, type inference has been improved further with java8, rendering more type parameters unnecessary. This is only possible with java8 and the resulting -code won't compile with java7. If you use java7, make sure to enable `java7compatibility` for this rule to avoid +code won't compile with java7. If you use java7, make sure to enable `java7Compatibility` for this rule to avoid false positives. 3 @@ -2009,17 +2009,17 @@ false positives. | //StatementExpression[AssignmentOperator and PrimaryExpression/PrimaryPrefix[not(Expression)]] ) -/(Expression | Expression[$java7compatibility = false()]/ConditionalExpression | Expression[$java7compatibility = false()]/ConditionalExpression/Expression) +/(Expression | Expression[$java7Compatibility = false()]/ConditionalExpression | Expression[$java7compatibility = false()]/ConditionalExpression/Expression) /PrimaryExpression[not(PrimarySuffix) and not(ancestor::ArgumentList)] /PrimaryPrefix /AllocationExpression [@AnonymousClass=false()] - [ClassOrInterfaceType/TypeArguments[@Diamond=false() and not($java7compatibility = true() and .//TypeArgument[@Wildcard=true()])]] + [ClassOrInterfaceType/TypeArguments[@Diamond=false() and not($java7Compatibility = true() and .//TypeArgument[@Wildcard=true()])]] [not(ArrayDimsAndInits)] ]]> - + (J7) Version sensitive tests - avoid possible false positives on Java7 - true + true 0 False negative for nested type parameters (#2545) - true + true 3 7,8,17