forked from azachar/org.eclipse.jdt.ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 428856: [1.8][extract method] Extracted method adds an additional…
… throws clause which result in compiler error
- Loading branch information
1 parent
b1b64fc
commit 5ef5a0e
Showing
7 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...ring/resources/ExtractMethodWorkSpace/ExtractMethodTests/defaultMethods18_in/A_test6.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package defaultMethods_in; | ||
|
||
import java.io.IOException; | ||
|
||
@FunctionalInterface | ||
interface FI { | ||
int foo(int i) throws IOException; | ||
|
||
default FI method1(FI i1) { | ||
/*[*/return FI::fun;/*]*/ | ||
} | ||
|
||
static int fun(int i) throws IOException { | ||
return i++; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...ing/resources/ExtractMethodWorkSpace/ExtractMethodTests/defaultMethods18_out/A_test6.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package defaultMethods_in; | ||
|
||
import java.io.IOException; | ||
|
||
@FunctionalInterface | ||
interface FI { | ||
int foo(int i) throws IOException; | ||
|
||
default FI method1(FI i1) { | ||
return extracted(); | ||
} | ||
|
||
default FI extracted() { | ||
/*[*/return FI::fun;/*]*/ | ||
} | ||
|
||
static int fun(int i) throws IOException { | ||
return i++; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
.../resources/ExtractMethodWorkSpace/ExtractMethodTests/lambdaExpression18_in/A_test326.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package lambdaExpression18_in; | ||
|
||
import java.io.IOException; | ||
|
||
@FunctionalInterface | ||
interface FI { | ||
int foo(int i) throws IOException; | ||
|
||
default FI method(FI i1) throws InterruptedException { | ||
/*[*/if (i1 == null) | ||
throw new InterruptedException(); | ||
return x -> { | ||
throw new IOException(); | ||
};/*]*/ | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...resources/ExtractMethodWorkSpace/ExtractMethodTests/lambdaExpression18_out/A_test326.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package lambdaExpression18_in; | ||
|
||
import java.io.IOException; | ||
|
||
@FunctionalInterface | ||
interface FI { | ||
int foo(int i) throws IOException; | ||
|
||
default FI method(FI i1) throws InterruptedException { | ||
return extracted(i1); | ||
} | ||
|
||
default FI extracted(FI i1) throws InterruptedException { | ||
/*[*/if (i1 == null) | ||
throw new InterruptedException(); | ||
return x -> { | ||
throw new IOException(); | ||
};/*]*/ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters