mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
redundant cast: special checks for throwable cases (IDEA-111511)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<problems>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>7</line>
|
||||
<description>Casting <code>e</code> to <code>Ex</code> is redundant</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>Test.java</file>
|
||||
<line>3</line>
|
||||
<description>Casting <code>e</code> to <code>FileNotFoundEx</code> is redundant</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
public class RedundantCast{
|
||||
void m(IOEx e) throws IOEx {
|
||||
throw (FileNotFoundEx)e;
|
||||
}
|
||||
|
||||
void foo(RuntimeException e) {
|
||||
throw (Ex)e;
|
||||
}
|
||||
|
||||
static class Ex extends RuntimeException {}
|
||||
static class IOEx extends Exception {}
|
||||
static class FileNotFoundEx extends Exception {}
|
||||
}
|
||||
Reference in New Issue
Block a user