mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
redundant casts: skip casts in conditional branches of calls when resulted call would resolve to another method (IDEA-15720)
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>A.java</file>
|
||||
<line>4</line>
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant type cast</problem_class>
|
||||
<description>Casting <code>param</code> to <code>Object</code> is redundant</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class A {
|
||||
void add(Object o, String param) {
|
||||
add(o, o != null ? null : (Object) param);
|
||||
add(o, o == null ? new Object() : (Object) param);
|
||||
}
|
||||
|
||||
void add(Object o, Object param) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user