mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-03 11:47:50 +07:00
[java] More tests for preview; minor fixes
GitOrigin-RevId: 7f72c5f68ab821e728eb0d5152f0910f48035046
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7a1f179f41
commit
9c6aeba5b4
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
static class E1 extends Exception { }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
static class E1 extends Exception { }
|
||||
static class E2 extends Exception { }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
interface I {
|
||||
void a() throws InterruptedException;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
interface I {
|
||||
void a() throws InterruptedException;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
|
||||
class C {
|
||||
interface I { }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
public static void main(String[] args){
|
||||
I i = C::foo;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
import java.io.*;
|
||||
|
||||
class C {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class Test {
|
||||
|
||||
interface I<E extends Exception> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
|
||||
class C {
|
||||
interface ExceptionThrower2 {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
static class E1 extends Exception { }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
static class E1 extends Exception { }
|
||||
static class E2 extends Exception { }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
interface I {
|
||||
void a();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
interface I {
|
||||
void a();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
|
||||
class C {
|
||||
interface I { }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
public static void main(String[] args){
|
||||
I i = C::f<caret>oo;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
import java.io.*;
|
||||
|
||||
class C {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class Test {
|
||||
|
||||
interface I<E extends Exception> {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Add exception to method signature" "true"
|
||||
// "Add exception to method signature" "true-preview"
|
||||
|
||||
class C {
|
||||
interface ExceptionThrower2 {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Add exception to method signature" "true-preview"
|
||||
class C {
|
||||
interface I {
|
||||
void a();
|
||||
}
|
||||
|
||||
{
|
||||
Callable<I> i = () -> {
|
||||
return new I() {
|
||||
public void a() throws InterruptedException {
|
||||
Thread.sleep(2000);
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// "Add exception to method signature" "true-preview"
|
||||
|
||||
class C {
|
||||
interface ExceptionThrower2 {
|
||||
|
||||
<TException extends Exception>
|
||||
TException
|
||||
throwChainedException(Class<TException> exceptionClass, Throwable cause, String format, Object... argArr) throws TException;
|
||||
}
|
||||
|
||||
public interface IExample {
|
||||
void foo();
|
||||
}
|
||||
|
||||
public static final class Example implements IExample {
|
||||
|
||||
private final ExceptionThrower2 et;
|
||||
|
||||
public Example(ExceptionThrower2 et) {
|
||||
this.et = et;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void foo() throws Exception {
|
||||
try {
|
||||
_foo();
|
||||
} catch (Exception e) {
|
||||
throw et.throwChainedException(Exception.class, e, "Error: [%s]", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void _foo()
|
||||
throws Exception {
|
||||
throw new Exception();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user