mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-09 20:42:52 +07:00
completion: infer Throwable for thrown bounds in completion so more candidates would be applicable (IDEA-162710)
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
import java.io.IOException;
|
||||
import java.util.function.Function;
|
||||
|
||||
class LocalDateTime {}
|
||||
class Launcher {
|
||||
public static final Function<LocalDateTime, IOException> TO_STRING = (message) -> new IOException(message.toString());
|
||||
|
||||
public static void main(String[] args) throws Throwable{
|
||||
throwException(new LocalDateTime(), TO_STRING);
|
||||
}
|
||||
|
||||
public static <Ex extends Throwable> void throwException(LocalDateTime str, Function<LocalDateTime, Ex> exceptionBuilder) throws Ex {
|
||||
throw exceptionBuilder.apply(str);
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import java.io.IOException;
|
||||
import java.util.function.Function;
|
||||
|
||||
class LocalDateTime {}
|
||||
class Launcher {
|
||||
public static final Function<LocalDateTime, IOException> TO_STRING = (message) -> new IOException(message.toString());
|
||||
|
||||
public static void main(String[] args) throws Throwable{
|
||||
throwException(new LocalDateTime(), TO<caret>);
|
||||
}
|
||||
|
||||
public static <Ex extends Throwable> void throwException(LocalDateTime str, Function<LocalDateTime, Ex> exceptionBuilder) throws Ex {
|
||||
throw exceptionBuilder.apply(str);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user