gcj/317: static method can't have same name as base class

bryce@albatross.co.nz bryce@albatross.co.nz
Tue Aug 15 18:50:00 GMT 2000


>Number:         317
>Category:       gcj
>Synopsis:       static method can't have same name as base class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 15 18:50:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Bryce McKinlay
>Release:        current
>Organization:
>Environment:

>Description:
The following legal Java code does not compile with gcj:

class Constructor {}

class Sub extends Constructor
{
  static void Constructor() {}
}

$ gcj -C Constructor.java 
Constructor.java:8: Instance methods can't be overriden by a static method. Method `<init>()' is an instance method in class `Constructor'.
  static void Constructor() {}
              ^
1 error
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Java-prs mailing list