public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/4568: static inner classes fails
@ 2001-10-14 13:06 s.nicolas
  0 siblings, 0 replies; 2+ messages in thread
From: s.nicolas @ 2001-10-14 13:06 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4568
>Category:       java
>Synopsis:       static inner classes fails
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Oct 14 13:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     s.nicolas@videotron.ca
>Release:        gcj-3.0.1
>Organization:
>Environment:
linux i686, glibc 2.2.4, kernel 2.4.10	
>Description:
gcj doesn't compile classes when they have a 
static inner class And call the class without explicit
use of the fqn
Suppose : 
class A
{
  static class inner
  {}
}

If another class like (ex: B) imports 
A.inner, 
it must call inner A.inner to refer to the inner class 
to be commpiled, but with java, this is not compulsory,
once you imported A.inner, inner suffishes to refer to the inner class.

Steff
>How-To-Repeat:

>Fix:

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: java/4568: static inner classes fails
@ 2002-02-07 16:06 Bryce McKinlay
  0 siblings, 0 replies; 2+ messages in thread
From: Bryce McKinlay @ 2002-02-07 16:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR java/4568; it has been noted by GNATS.

From: Bryce McKinlay <bryce@waitaki.otago.ac.nz>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
   nobody@gcc.gnu.org, s.nicolas@videotron.ca
Cc:  
Subject: Re: java/4568: static inner classes fails
Date: Fri, 08 Feb 2002 13:02:50 +1300

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4568
 
 Nic Ferrier sent this test case.
 
 file a.java:
 
 public class A
 {
    public static X createSomething ()
    {
      return new X();
    }
 
    public class X
    {
       public void someMethod ()
       {
         return;
       }
    }
 }
 
 
 file b.java:
 
 import A.X;
 
 public class B
 {
    public void someThing ()
    {
      X var = A.createSomething();
      var.someMethod();
    }
 }
 
 
 But trying to compile this with GCJ produces the following error:
 
 
 ./../paperclips/source/gnu/paperclips/WebApp.java:173: 
 Type `X' not found in the declaration of the local variable `var'.
         X var = (X) A.createSomething();
 
 
 This does compile with javac.
 
 If GCJ does this it won't be able to compile javamail which also uses
 import references to inner classes.
 
 
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-02-08  0:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-14 13:06 java/4568: static inner classes fails s.nicolas
2002-02-07 16:06 Bryce McKinlay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).