mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-17 21:43:33 +07:00
java redundant cast: cleanup: extract foreach, instanceof, throws statements
GitOrigin-RevId: ac04ea8db453518f4c15d3e37e33d9a25a22ce35
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c6f03bad18
commit
1c35803b4a
+16
@@ -0,0 +1,16 @@
|
||||
interface SAM<T, R extends Throwable> {
|
||||
void m(T t) throws R;
|
||||
}
|
||||
|
||||
class MyTest {
|
||||
void f(E1 e1) {
|
||||
SAM<String, E1> s1 = s -> {
|
||||
if (s.length() > 0) throw (<warning descr="Casting '(E2)e1' to 'E1' is redundant">E1</warning>) (<warning descr="Casting 'e1' to 'E2' is redundant">E2</warning>) e1;
|
||||
throw (<warning descr="Casting '(E1)e1' to 'E2' is redundant">E2</warning>) (<warning descr="Casting 'e1' to 'E1' is redundant">E1</warning>)e1;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
static class E1 extends Exception {}
|
||||
static class E2 extends E1 {}
|
||||
}
|
||||
Reference in New Issue
Block a user