We accept the following invalid code from 3.4.0 and above:
interface A { void methA(); }
class B implements A{
void methA() { }
}
We used to error out with:
B.java:4: error: Class `B' must override `B.methA()' with a public method in
order to implement
interface `A'.
void methA() { }
^
1 error
Which is correct.
Sun's 1.4.0 javac gives:
B.java:3: methA() in B cannot implement methA() in A; attempting to assign
weaker access privileges;
was public
class B implements A{
^
1 error
--
Summary: [3.4/4.0/4.1 Regression] Accepts invalid
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: accepts-invalid
Severity: normal
Priority: P2
Component: java
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23655