This is the mail archive of the java-prs@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcj/94: compiler allows assignment to interface constants



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]