mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
quick fix which adds exception from field initializer to constructor signature (IDEA-142284)
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
// "Add exception to class constructors signature" "true"
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
class C {
|
||||
final FileWriter fw = new FileWriter("asd");
|
||||
|
||||
C(int i) throws RuntimeException, IOException {
|
||||
|
||||
}
|
||||
|
||||
C(int i, int j) throws IOException {
|
||||
|
||||
}
|
||||
|
||||
C(int i, int j, int k) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
C(int i, int j, int k, int l) throws IOException {
|
||||
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Add exception to class default constructor signature" "true"
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
class C {
|
||||
final FileWriter fw = new FileWriter("asd");
|
||||
|
||||
C() throws IOException {
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Add exception to class constructor signature" "true"
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
class C {
|
||||
final FileWriter fw = new FileWriter("asd");
|
||||
|
||||
C(int i) throws RuntimeException, IOException {
|
||||
|
||||
}
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// "Add exception to class constructors signature" "true"
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
class C {
|
||||
final FileWriter fw = new FileWri<caret>ter("asd");
|
||||
|
||||
C(int i) throws RuntimeException {
|
||||
|
||||
}
|
||||
|
||||
C(int i, int j) throws IOException {
|
||||
|
||||
}
|
||||
|
||||
C(int i, int j, int k) throws Exception {
|
||||
|
||||
}
|
||||
|
||||
C(int i, int j, int k, int l) {
|
||||
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// "Add exception to class default constructor signature" "true"
|
||||
import java.io.FileWriter;
|
||||
|
||||
class C {
|
||||
final FileWriter fw = new FileWrit<caret>er("asd");
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Add exception to class default constructor signature" "false"
|
||||
import java.io.FileWriter;
|
||||
|
||||
class C {
|
||||
final FileWriter fw = new MyCal<caret>lable() {
|
||||
@Override
|
||||
public FileWriter get() {
|
||||
return new FileWriter("");
|
||||
}
|
||||
}.get();
|
||||
|
||||
interface MyCallable {
|
||||
FileWriter get();
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Add exception to class default constructor signature" "false"
|
||||
import java.io.FileWriter;
|
||||
|
||||
class C {
|
||||
final FileWriter fw = ((MyCall<caret>able) () -> new FileWriter("")).get();
|
||||
|
||||
interface MyCallable {
|
||||
FileWriter get();
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// "Add exception to class constructor signature" "false"
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
class C {
|
||||
final FileWriter fw = new F<caret>ileWriter("asd");
|
||||
|
||||
C() throws IOException {
|
||||
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// "Add exception to class constructor signature" "true"
|
||||
import java.io.FileWriter;
|
||||
|
||||
class C {
|
||||
final FileWriter fw = new F<caret>ileWriter("asd");
|
||||
|
||||
C(int i) throws RuntimeException {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user