-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b67
-
generic
-
generic
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085528 | emb-9 | Srikanth Adayapalam | P3 | Resolved | Fixed | team |
$ catt PrivAndAbstract.java public class PrivAndAbstract {
interface P {
private abstract void foo() {};
}
}
$ javac PrivAndAbstract.java
PrivAndAbstract.java:3: error: illegal combination of modifiers: abstract and private
private abstract void foo() {};
^
PrivAndAbstract.java:3: error: interface abstract methods cannot have body
private abstract void foo() {};
^
2 errors
First message is correct. Second message shows that javac at this position treats the method as abstract. Choosing one of two modifiers for error analysis is not correct and could confuse the user.
interface P {
private abstract void foo() {};
}
}
$ javac PrivAndAbstract.java
PrivAndAbstract.java:3: error: illegal combination of modifiers: abstract and private
private abstract void foo() {};
^
PrivAndAbstract.java:3: error: interface abstract methods cannot have body
private abstract void foo() {};
^
2 errors
First message is correct. Second message shows that javac at this position treats the method as abstract. Choosing one of two modifiers for error analysis is not correct and could confuse the user.
- backported by
-
JDK-8085528 Redundant error message on private abstract interface method with body
- Resolved