gcj/94: compiler allows assignment to interface constants
bryce@albatross.co.nz
bryce@albatross.co.nz
Tue Nov 9 14:50:00 GMT 1999
>Number: 94
>Category: gcj
>Synopsis: compiler allows assignment to interface constants
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Nov 09 14:50:00 PST 1999
>Closed-Date:
>Last-Modified:
>Originator: Bryce McKinlay <bryce@albatross.co.nz>
>Release: current
>Organization:
>Environment:
any
>Description:
Constants declared in interfaces are implicitly "static
final". However, the gcj source parser apparantly allows
assignment to these interface constants.
See below for example code. When generating bytecode with
"gcj -C", the compiler correctly reports:
Test.java:5: Can't assign a value to the final variable `A'.
but with "gcj -c", no error is reported!
>How-To-Repeat:
interface Foo
{
int A = 1;
}
class Test implements Foo
{
Test ()
{
A = 2;
}
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Java-prs
mailing list