mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
redundant cast: mark raw cast as redundant when raw is expected (IDEA-162022)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import java.util.Map;
|
||||
|
||||
class Main {
|
||||
private final Map<String, BreakpointState<?,?,?>> myBreakpointsDefaults = null;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public BreakpointState<String, String, String> foo1(String type, BreakpointState<?, ?, ?> defaults) {
|
||||
return (BreakpointState) myBreakpointsDefaults.computeIfAbsent(type, k -> defaults);
|
||||
}
|
||||
|
||||
public BreakpointState foo2(String type, BreakpointState<?, ?, ?> defaults) {
|
||||
return (<warning descr="Casting 'myBreakpointsDefaults.computeIfAbsent(type, k -> defaults)' to 'BreakpointState' is redundant">BreakpointState</warning>) myBreakpointsDefaults.computeIfAbsent(type, k -> defaults);
|
||||
}
|
||||
|
||||
private static class BreakpointState<A, B, C> {}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user