MethodReturnTypeFix: highlight only return statements when method return type doesn't match expected (IDEA-216275)

GitOrigin-RevId: d5f7dc3b03d68d249ba29532b0e8c0555cae60d6
This commit is contained in:
Artemiy Sartakov
2019-07-08 15:09:05 +03:00
committed by intellij-monorepo-bot
parent ba328fd25a
commit 642c65dd11
37 changed files with 167 additions and 217 deletions
@@ -1,6 +1,6 @@
class C {
<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>()[] { }
<error descr="Illegal type: 'void'">void</error>[] m1() { }
<error descr="Illegal type: 'void'">void</error> m2()[] { }
void m3(<error descr="Illegal type: 'void'">void</error> p) {}
{
@@ -6,7 +6,7 @@ interface ii {}
int <error descr="Invalid return type">f1</error>() throws Exception {
int f1() throws Exception {
<error descr="Missing return statement">}</error>
Object f2(int i) throws Exception {
@@ -217,7 +217,7 @@ interface ii {}
int <error descr="Invalid return type">f1</error>() throws Exception {
int f1() throws Exception {
<error descr="Missing return statement">}</error>
Object f2(int i) throws Exception {
@@ -421,7 +421,7 @@ interface ii {}
int <error descr="Invalid return type">f1</error>() throws Exception {
int f1() throws Exception {
<error descr="Missing return statement">}</error>
Object f2(int i) throws Exception {
@@ -626,7 +626,7 @@ interface ii {}
int <error descr="Invalid return type">f1</error>() throws Exception {
int f1() throws Exception {
<error descr="Missing return statement">}</error>
Object f2(int i) throws Exception {
@@ -829,7 +829,7 @@ interface ii {}
int <error descr="Invalid return type">f1</error>() throws Exception {
int f1() throws Exception {
<error descr="Missing return statement">}</error>
Object f2(int i) throws Exception {
@@ -1,12 +1,12 @@
class s {
void <error descr="Invalid return type">f</error>() {
void f() {
<error descr="Cannot return a value from a method with void result type">return 0;</error>
}
void f2() {
return;
}
int <error descr="Invalid return type">f3</error>() {
int f3() {
<error descr="Missing return value">return;</error>
}
int f4() {
@@ -1071,7 +1071,7 @@ public abstract class ClassLoader
return parent;
}
static ClassLoader <error descr="Invalid return type">createSystemClassLoader</error>(URL[] urls, ClassLoader parent)
static ClassLoader createSystemClassLoader(URL[] urls, ClassLoader parent)
{
return
new <error descr="Cannot resolve symbol 'URLClassLoader'">URLClassLoader</error>(urls, parent)