Merge branch 'pr-1289'

This commit is contained in:
Andreas Dangel
2018-08-07 19:54:18 +02:00
3 changed files with 19 additions and 0 deletions

View File

@ -34,6 +34,7 @@ This is a minor release.
* [#1267](https://github.com/pmd/pmd/pull/1267): \[java] MissingOverrideRule: Avoid NoClassDefFoundError with incomplete classpath
* java-codestyle
* [#1255](https://github.com/pmd/pmd/issues/1255): \[java] UnnecessaryFullyQualifiedName false positive: static method on shadowed implicitly imported class
* [#1258](https://github.com/pmd/pmd/issues/1285): \[java] False positive "UselessParentheses" for parentheses that contain assignment
* java-errorprone
* [#1078](https://github.com/pmd/pmd/issues/1078): \[java] MissingSerialVersionUID rule does not seem to catch inherited classes
* jsp
@ -52,3 +53,4 @@ This is a minor release.
* [#1277](https://github.com/pmd/pmd/pull/1277): \[jsp] #1276 add support for jspf and tag extensions - [Jordi Llach](https://github.com/jordillachmrf)
* [#1275](https://github.com/pmd/pmd/pull/1275): \[jsp] Issue #1274 - Support EL in tag attributes - [Jordi Llach](https://github.com/jordillachmrf)
* [#1278](https://github.com/pmd/pmd/pull/1278): \[ci] \[GSoC] Use pmdtester 1.0.0.pre.beta3 - [BBG](https://github.com/djydewang)
* [#1289](https://github.com/pmd/pmd/pull/1289): \[java] UselessParentheses: Fix false positive with assignments - [cobratbq](https://github.com/cobratbq)

View File

@ -1769,6 +1769,7 @@ public class Foo {
[not(./CastExpression)]
[not(./ConditionalExpression)]
[not(./AdditiveExpression)]
[not(./AssignmentOperator)]
|
//Expression[not(parent::PrimaryPrefix)]/PrimaryExpression[count(*)=1]
/PrimaryPrefix/Expression

View File

@ -483,6 +483,22 @@ public class Test {
return (Character.toUpperCase(str1.charAt(0))
+ str1.substring(1)).replace('_', ' ');
}
}
]]></code>
</test-code>
<test-code>
<description>[java] False positive "UselessParentheses" for parentheses that contain assignment #1285</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Test {
public void test() {
Pattern p;
Matcher m;
if ((m = p.matcher("hello world")).matches()) {
System.out.println("Hello world");
}
}
}
]]></code>
</test-code>