mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-23 16:55:09 +00:00
8035956: javac, incomplete error message
Reviewed-by: vromero
This commit is contained in:
parent
24400e1745
commit
3eb793cd06
@ -1625,7 +1625,7 @@ public class Check {
|
||||
protection(m.flags()) > protection(other.flags())) {
|
||||
log.error(TreeInfo.diagnosticPositionFor(m, tree), "override.weaker.access",
|
||||
cannotOverride(m, other),
|
||||
other.flags() == 0 ?
|
||||
(other.flags() & AccessFlags) == 0 ?
|
||||
"package" :
|
||||
asFlagSet(other.flags() & AccessFlags));
|
||||
m.flags_field |= BAD_OVERRIDE;
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8035956
|
||||
* @summary javac, incomplete error message
|
||||
* @author kizune
|
||||
*
|
||||
* @run compile/fail/ref=IncompleteMessageOverride.out -XDrawDiagnostics IncompleteMessageOverride.java
|
||||
*/
|
||||
|
||||
class Super {
|
||||
static void m() {}
|
||||
}
|
||||
|
||||
class Sub extends Super {
|
||||
private static void m() {}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
IncompleteMessageOverride.java:15:25: compiler.err.override.weaker.access: (compiler.misc.cant.override: m(), Sub, m(), Super), package
|
||||
1 error
|
||||
Loading…
x
Reference in New Issue
Block a user