mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-331038 [java]: better error message for "attempting to assign weaker access privileges"
GitOrigin-RevId: 9edbeca1895c09e471200dc4d31ad587c382045a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
9905bef526
commit
2645b4463b
+1
-1
@@ -218,7 +218,7 @@ method.should.have.body=Method body expected
|
||||
method.instance.overrides.static=Instance method ''{0}'' in ''{1}'' cannot override static method ''{2}'' in ''{3}''
|
||||
method.static.overrides.instance=Static method ''{0}'' in ''{1}'' cannot override instance method ''{2}'' in ''{3}''
|
||||
method.overrides.final=''{0}'' cannot override ''{1}'' in ''{2}''; overridden method is final
|
||||
method.inheritance.weaker.privileges={0}; attempting to assign weaker access privileges (''{1}''); was ''{2}''
|
||||
method.inheritance.weaker.privileges={0}; cannot reduce visibility from ''{2}'' to ''{1}''
|
||||
method.inheritance.clash.unrelated.return.types={0}; methods have unrelated return types
|
||||
method.inheritance.clash.incompatible.return.types={0}; incompatible return type
|
||||
method.inheritance.clash.does.not.throw={0}; overridden method does not throw ''{1}''
|
||||
|
||||
+4
-4
@@ -4,7 +4,7 @@ interface i {
|
||||
}
|
||||
|
||||
public class a implements i {
|
||||
void <error descr="'ff()' in 'a' clashes with 'ff()' in 'i'; attempting to assign weaker access privileges ('package-private'); was 'public'">ff</error>() {}
|
||||
void <error descr="'ff()' in 'a' clashes with 'ff()' in 'i'; cannot reduce visibility from 'public' to 'package-private'">ff</error>() {}
|
||||
}
|
||||
class ai implements i {
|
||||
public <error descr="'ff()' in 'ai' clashes with 'ff()' in 'i'; incompatible return type">int</error> ff() { return 0;}
|
||||
@@ -25,7 +25,7 @@ class c3 extends c2 {
|
||||
|
||||
class c4 extends c3 {
|
||||
private c4() {}
|
||||
<error descr="'g()' in 'c4' clashes with 'g()' in 'c2'; attempting to assign weaker access privileges ('private'); was 'protected'">private</error> void g() {}
|
||||
<error descr="'g()' in 'c4' clashes with 'g()' in 'c2'; cannot reduce visibility from 'protected' to 'private'">private</error> void g() {}
|
||||
private String fff(String s) throws java.io.IOException { return null; }
|
||||
}
|
||||
class c4i extends c3 {
|
||||
@@ -55,7 +55,7 @@ interface A {
|
||||
interface ConflictWithObject {
|
||||
Object clone() throws CloneNotSupportedException;
|
||||
}
|
||||
<error descr="'clone()' in 'java.lang.Object' clashes with 'clone()' in 'ConflictWithObject'; attempting to assign weaker access privileges ('protected'); was 'public'">class s implements ConflictWithObject</error> {
|
||||
<error descr="'clone()' in 'java.lang.Object' clashes with 'clone()' in 'ConflictWithObject'; cannot reduce visibility from 'public' to 'protected'">class s implements ConflictWithObject</error> {
|
||||
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ interface InderFace {
|
||||
interface SubInderFace extends InderFace {
|
||||
}
|
||||
|
||||
<error descr="'clone()' in 'java.lang.Object' clashes with 'clone()' in 'InderFace'; attempting to assign weaker access privileges ('protected'); was 'public'">class Implementation implements SubInderFace</error> {
|
||||
<error descr="'clone()' in 'java.lang.Object' clashes with 'clone()' in 'InderFace'; cannot reduce visibility from 'public' to 'protected'">class Implementation implements SubInderFace</error> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
+3
-3
@@ -34,13 +34,13 @@ interface i2 {
|
||||
class weak {
|
||||
void f1() {}
|
||||
}
|
||||
<error descr="'f1()' in 'weak' clashes with 'f1()' in 'i'; attempting to assign weaker access privileges ('package-private'); was 'public'">class a2 extends weak implements i</error> {
|
||||
<error descr="'f1()' in 'weak' clashes with 'f1()' in 'i'; cannot reduce visibility from 'public' to 'package-private'">class a2 extends weak implements i</error> {
|
||||
}
|
||||
|
||||
class a3 {
|
||||
protected void f1() {}
|
||||
}
|
||||
<error descr="'f1()' in 'a3' clashes with 'f1()' in 'i'; attempting to assign weaker access privileges ('protected'); was 'public'">class a4 extends a3 implements i</error> {
|
||||
<error descr="'f1()' in 'a3' clashes with 'f1()' in 'i'; cannot reduce visibility from 'public' to 'protected'">class a4 extends a3 implements i</error> {
|
||||
// public void f1() {}
|
||||
}
|
||||
class a5 extends a3 implements i {
|
||||
@@ -104,7 +104,7 @@ class Foo {
|
||||
protected static void foo(String s) {}
|
||||
}
|
||||
class Bar extends Foo{
|
||||
<error descr="'foo(String)' in 'Bar' clashes with 'foo(String)' in 'Foo'; attempting to assign weaker access privileges ('private'); was 'protected'">private</error> static void foo(String s) {}
|
||||
<error descr="'foo(String)' in 'Bar' clashes with 'foo(String)' in 'Foo'; cannot reduce visibility from 'protected' to 'private'">private</error> static void foo(String s) {}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ interface A1 extends A {
|
||||
<error descr="Static method 'm()' in 'A1' cannot override instance method 'm()' in 'A'">private static void m()</error> {}
|
||||
}
|
||||
interface A2 extends A {
|
||||
<error descr="'m()' in 'A2' clashes with 'm()' in 'A'; attempting to assign weaker access privileges ('private'); was 'public'">private</error> void m() {}
|
||||
<error descr="'m()' in 'A2' clashes with 'm()' in 'A'; cannot reduce visibility from 'public' to 'private'">private</error> void m() {}
|
||||
}
|
||||
|
||||
interface B {
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ class F {
|
||||
|
||||
class E extends F {
|
||||
@Override
|
||||
<error descr="'f()' in 'E' clashes with 'f()' in 'F'; attempting to assign weaker access privileges ('protected'); was 'public'">protected</error> void f() {
|
||||
<error descr="'f()' in 'E' clashes with 'f()' in 'F'; cannot reduce visibility from 'public' to 'protected'">protected</error> void f() {
|
||||
super.f();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user