mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 00:20:55 +07:00
[java] improve error message (IDEA-223692)
GitOrigin-RevId: df344c76be34232b3dc682d36b9d233ab2a6d54f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
17d30e0697
commit
d19410735d
@@ -4,7 +4,7 @@ import static p.Boo.*;
|
||||
|
||||
class FooImpl implements Foo, Boo {
|
||||
public void baz() {
|
||||
<error descr="Static method may be invoked on containing interface class only">foo();</error>
|
||||
<error descr="Static method may only be called on its containing interface">foo();</error>
|
||||
bar();
|
||||
boo();
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import static p.Foo.FooEx.<error descr="Static method may be invoked on containing interface class only">foo</error>;
|
||||
import static p.Foo.FooEx.<error descr="Static method may only be called on its containing interface">foo</error>;
|
||||
|
||||
class FooImpl {
|
||||
public void baz() {
|
||||
<error descr="Static method may be invoked on containing interface class only">foo();</error>
|
||||
<error descr="Static method may only be called on its containing interface">foo();</error>
|
||||
}
|
||||
}
|
||||
@@ -11,16 +11,16 @@ class Bug {
|
||||
|
||||
interface IFunction extends Function<Integer, Integer> {
|
||||
static void a() {
|
||||
Function<Integer, Integer> identity = <error descr="Static method may be invoked on containing interface class only">identity();</error>
|
||||
Function<Integer, Integer> identity = <error descr="Static method may only be called on its containing interface">identity();</error>
|
||||
}
|
||||
}
|
||||
|
||||
public void foo() {
|
||||
Function<Integer, Integer> f = Function.identity();
|
||||
|
||||
Function<Integer, Integer> g = <error descr="Static method may be invoked on containing interface class only">f.identity();</error>
|
||||
Function<Integer, Integer> g = <error descr="Static method may only be called on its containing interface">f.identity();</error>
|
||||
|
||||
Function<Integer, Integer> h = IFunction.<error descr="Static method may be invoked on containing interface class only">identity</error>();
|
||||
Function<Integer, Integer> h = IFunction.<error descr="Static method may only be called on its containing interface">identity</error>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,15 +40,15 @@ class StaticMethodInterfaceExample {
|
||||
}
|
||||
|
||||
public <T extends MyImplementation> void doStuff1() {
|
||||
<error descr="Static method may be invoked on containing interface class only">T.staticMethod();</error>
|
||||
<error descr="Static method may only be called on its containing interface">T.staticMethod();</error>
|
||||
}
|
||||
|
||||
public <T extends MyInterface & X> void doStuff2() {
|
||||
<error descr="Static method may be invoked on containing interface class only">T.staticMethod();</error>
|
||||
<error descr="Static method may only be called on its containing interface">T.staticMethod();</error>
|
||||
}
|
||||
|
||||
public <T extends MyImplementation & MyInterface> void doStuff3() {
|
||||
<error descr="Static method may be invoked on containing interface class only">T.staticMethod();</error>
|
||||
<error descr="Static method may only be called on its containing interface">T.staticMethod();</error>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@ interface I {
|
||||
|
||||
class A implements I {
|
||||
{
|
||||
System.out.println(A./*c1*/<error descr="Static method may be invoked on containing interface class only">foo</error>());
|
||||
Runnable r = <error descr="Static method may be invoked on containing interface class only">A/*c2*/::<String>foo;</error>
|
||||
System.out.println(A./*c1*/<error descr="Static method may only be called on its containing interface">foo</error>());
|
||||
Runnable r = <error descr="Static method may only be called on its containing interface">A/*c2*/::<String>foo;</error>
|
||||
System.out.println(r);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class Test2 {
|
||||
public static void main(IJ s, J<String> j) {
|
||||
s.f("");
|
||||
|
||||
<error descr="Static method may be invoked on containing interface class only">j.j("");</error>
|
||||
<error descr="Static method may only be called on its containing interface">j.j("");</error>
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user