highlight only method name on unhandled exception (IDEA-190912)

This commit is contained in:
Anna.Kozlova
2018-04-25 21:11:38 +02:00
parent 40af21eaeb
commit 51a2d549b2
25 changed files with 42 additions and 41 deletions
@@ -4,7 +4,7 @@ class MyTest<T> {
public MyTest() throws IOException {}
void m() {
MyTest<String> test = <error descr="Unhandled exception: java.io.IOException">new MyTest<>()</error>;
MyTest<String> test = new <error descr="Unhandled exception: java.io.IOException">MyTest<></error>();
}
{
@@ -6,6 +6,6 @@ class Test {
{
foo((t)->{});
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo((ClassNotFoundException t)->{});</error>
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo</error>((ClassNotFoundException t)->{});
}
}
@@ -16,7 +16,7 @@ class Test {
foo(this::m1);
foo(this::m2);
<error descr="Unhandled exception: java.io.IOException">foo(this::m3);</error>
<error descr="Unhandled exception: java.io.IOException">foo</error>(this::m3);
}
}
@@ -5,6 +5,6 @@ class Test {
<K extends ClassNotFoundException> void foo(F<K> f) throws K { }
{
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo(() -> {});</error>
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo</error>(() -> {});
}
}
@@ -12,18 +12,18 @@ class Test {
<K extends ClassNotFoundException> void foo2(F<K> f) throws K { }
{
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2(()->{});</error>
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2(()->{ throw new ClassNotFoundException(); });</error>
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2</error>(()->{});
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2</error>(()->{ throw new ClassNotFoundException(); });
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2(this::m1);</error>
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2(this::m2);</error>
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2</error>(this::m1);
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo2</error>(this::m2);
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo1(()->{ throw new ClassNotFoundException(); });</error>
<error descr="Unhandled exception: java.lang.Exception">foo1(()->{ throw new Exception(); });</error>
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo1</error>(()->{ throw new ClassNotFoundException(); });
<error descr="Unhandled exception: java.lang.Exception">foo1</error>(()->{ throw new Exception(); });
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo1(this::m2);</error>
<error descr="Unhandled exception: java.lang.Exception">foo1(this::m3);</error>
<error descr="Unhandled exception: java.lang.ClassNotFoundException">foo1</error>(this::m2);
<error descr="Unhandled exception: java.lang.Exception">foo1</error>(this::m3);
}
}
@@ -17,7 +17,7 @@ class Thing<T> {
public <X extends Throwable> void exceptionMethod(Supplier<X> xSupplier) throws X { }
void m(final Thing<Integer> integer){
integer.flatMap(s -> new Thing(s)).<error descr="Unhandled exception: java.lang.Throwable">exceptionMethod(IllegalStateException::new);</error>
integer.flatMap(s -> new Thing(s)).<error descr="Unhandled exception: java.lang.Throwable">exceptionMethod</error>(IllegalStateException::new);
integer.flatMap(Thing::new).exceptionMethod(IllegalStateException::new);
}
}
@@ -4,7 +4,7 @@ public class ExTest {
}
{
Block<String> b = (t) -> ExTest.<error descr="Unhandled exception: ExTest.Ex">maybeThrow(t)</error>;
Block<String> b = (t) -> ExTest.<error descr="Unhandled exception: ExTest.Ex">maybeThrow</error>(t);
}
@@ -5,7 +5,7 @@ import java.util.function.Consumer;
class Test {
public static void main(String[] args) {
Iterable<Consumer<Reader>> i = Arrays.asList((r) -> r.<error descr="Unhandled exception: java.io.IOException">read()</error>);
Iterable<Consumer<Reader>> i1 = Arrays.<Consumer<Reader>>asList((r) -> r.<error descr="Unhandled exception: java.io.IOException">read()</error>);
Iterable<Consumer<Reader>> i = Arrays.asList((r) -> r.<error descr="Unhandled exception: java.io.IOException">read</error>());
Iterable<Consumer<Reader>> i1 = Arrays.<Consumer<Reader>>asList((r) -> r.<error descr="Unhandled exception: java.io.IOException">read</error>());
}
}
@@ -32,7 +32,7 @@ class Test1 {
}
{
bar(l -> <error descr="Unhandled exception: Test1.MyEx">baz(l)</error>);
bar(l -> <error descr="Unhandled exception: Test1.MyEx">baz</error>(l));
bar(<error descr="Unhandled exception: Test1.MyEx">this::baz</error>);
}
}
@@ -1,7 +1,7 @@
class Test {
Test() {
foo(<error descr="Unhandled exception: java.lang.Exception">this::fs</error>);
foo((s) -> <error descr="Unhandled exception: java.lang.Exception">fs(s)</error>);
foo((s) -> <error descr="Unhandled exception: java.lang.Exception">fs</error>(s));
}
void foo(I<String, String> iss) {}