) element)::compareTo;
+
+ Bean bean = new Bean();
+ assertEquals(1, ((int[]) bean.array)[0]);
+
+ // violation below 'Unnecessary parentheses around expression.'
+ float rest = ((float) (50 - System.currentTimeMillis())) / 1000;
+ float stop = (float) (50 - System.currentTimeMillis()) / 1000;
+ }
+ static class T {}
+ public class Bean {
+ public Object array;
+ public Bean() {
+ this.array = new int[]{1,2,3};
+ }
+ }
+}
diff --git a/src/xdocs/checks/coding/unnecessaryparentheses.xml b/src/xdocs/checks/coding/unnecessaryparentheses.xml
index c380ee723a4..df1df3f31b0 100644
--- a/src/xdocs/checks/coding/unnecessaryparentheses.xml
+++ b/src/xdocs/checks/coding/unnecessaryparentheses.xml
@@ -179,6 +179,8 @@ if ((++f) > g && a) { // violation, unnecessary paren
BAND
,
QUESTION
+ ,
+ TYPECAST
.
@@ -264,6 +266,8 @@ if ((++f) > g && a) { // violation, unnecessary paren
POST_INC
,
POST_DEC
+ ,
+ TYPECAST
.
|
3.4 |