MethodReturnTypeFix: updated fix to change method return type based on return statements in method body (IDEA-216275)

GitOrigin-RevId: e97990950039123c8c41921a71342b8ed60afdee
This commit is contained in:
Artemiy Sartakov
2019-07-04 09:02:24 +03:00
committed by intellij-monorepo-bot
parent 52aa1ae553
commit 42d733a694
42 changed files with 381 additions and 55 deletions
@@ -1,6 +1,6 @@
class C {
<error descr="Illegal type: 'void'">void</error>[] m1() { }
<error descr="Illegal type: 'void'">void</error> m2()[] { }
<error descr="Illegal type: 'void'">void</error>[] <error descr="Invalid return type">m1</error>() { }
<error descr="Illegal type: 'void'">void</error> <error descr="Invalid return type">m2</error>()[] { }
void m3(<error descr="Illegal type: 'void'">void</error> p) {}
{
@@ -6,7 +6,7 @@ interface ii {}
int f1() throws Exception {
int <error descr="Invalid return type">f1</error>() throws Exception {
<error descr="Missing return statement">}</error>
Object f2(int i) throws Exception {
@@ -217,7 +217,7 @@ interface ii {}
int f1() throws Exception {
int <error descr="Invalid return type">f1</error>() throws Exception {
<error descr="Missing return statement">}</error>
Object f2(int i) throws Exception {
@@ -421,7 +421,7 @@ interface ii {}
int f1() throws Exception {
int <error descr="Invalid return type">f1</error>() throws Exception {
<error descr="Missing return statement">}</error>
Object f2(int i) throws Exception {
@@ -626,7 +626,7 @@ interface ii {}
int f1() throws Exception {
int <error descr="Invalid return type">f1</error>() throws Exception {
<error descr="Missing return statement">}</error>
Object f2(int i) throws Exception {
@@ -829,7 +829,7 @@ interface ii {}
int f1() throws Exception {
int <error descr="Invalid return type">f1</error>() throws Exception {
<error descr="Missing return statement">}</error>
Object f2(int i) throws Exception {
@@ -1,12 +1,12 @@
class s {
void f() {
void <error descr="Invalid return type">f</error>() {
<error descr="Cannot return a value from a method with void result type">return 0;</error>
}
void f2() {
return;
}
int f3() {
int <error descr="Invalid return type">f3</error>() {
<error descr="Missing return value">return;</error>
}
int f4() {