This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


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

java/1341: Failure to resolve inner class defined in superclass of enclosing context which is itself an inner class



>Number:         1341
>Category:       java
>Synopsis:       Failure to resolve inner class defined in superclass of enclosing context which is itself an inner class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:19:13 PST 2000
>Closed-Date:    Thu Dec 14 20:24:39 PST 2000
>Last-Modified:  Thu Dec 14 20:30:01 PST 2000
>Originator:     Bryce McKinlay
>Release:        the current one
>Organization:
>Environment:
linux
>Description:
While attempting to debug PR 283, I came across (and fixed)
another bug, in do_resolve_class(). This function needs to 
check superclasses, enclosing contexts of superclasses, and
superclasses of enclosing contexts for the inner class. 

However it currently only looks in superclasses of the 
outermost context because the value of 'enclosing' is 
changed before the superclass check occurs. The patch below
corrects this.

Test case:

class PR
{
  class A {}
}

class B
{
  class C extends PR
  {
    class D extends A {}
  }
}

$ gcj -C PR.java
PR.java:10: Superclass `A' of class `B$C$D' not found.
    class D extends A {}
                    ^
1 error

>How-To-Repeat:

>Fix:
Apply the patch and try the test case again. It still wont
compile, due to PR 283, but you'll get past this first bug.
>Release-Note:

>Audit-Trail:

Formerly PR gcj/316


From: Alexandre Petit-Bianco <apbianco@cygnus.com>
To: bryce@albatross.co.nz
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/316: Failure to resolve inner class defined in superclass of enclosing context which is itself an inner class
Date: Fri, 20 Oct 2000 21:40:46 -0700 (PDT)

 bryce@albatross.co.nz writes:
 
 > While attempting to debug PR 283, I came across (and fixed) another
 > bug, in do_resolve_class().
 
 This patch is fine. Please check it in.
 
 ./A
State-Changed-From-To: open->closed
State-Changed-By: bryce
State-Changed-When: Thu Dec 14 20:24:39 2000
State-Changed-Why:
    I checked in the fix for this some time ago.

From: bryce@albatross.co.nz
To: apbianco@cygnus.com, bryce@albatross.co.nz,
  java-gnats@sourceware.cygnus.com
Cc:  
Subject: Re: gcj/316
Date: 15 Dec 2000 04:24:39 -0000

 Synopsis: Failure to resolve inner class defined in superclass of enclosing context which is itself an inner class
 
 State-Changed-From-To: open->closed
 State-Changed-By: bryce
 State-Changed-When: Thu Dec 14 20:24:39 2000
 State-Changed-Why:
     I checked in the fix for this some time ago.
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=316&database=java
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="gcj-inner-1.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gcj-inner-1.patch"

MjAwMC0wOC0xNSAgQnJ5Y2UgTWNLaW5sYXkgIDxicnljZUBhbGJhdHJvc3MuY28ubno+CgoJKiBw
YXJzZS55IChkb19yZXNvbHZlX2NsYXNzKTogQWxzbyBleHBsb3JlIHN1cGVyY2xhc3NlcyBvZiAK
CWludGVybWVkaWF0ZSBlbmNsb3NpbmcgY29udGV4dHMgd2hlbiBzZWFyY2hpbmcgZm9yIGlubmVy
IGNsYXNzZXMuCgpJbmRleDogcGFyc2UueQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3ZzL2djYy9l
Z2NzL2djYy9qYXZhL3BhcnNlLnksdgpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMjAwCmRpZmYgLXUg
LXIxLjIwMCBwYXJzZS55Ci0tLSBwYXJzZS55CTIwMDAvMDgvMTEgMjI6MDE6MzcJMS4yMDAKKysr
IHBhcnNlLnkJMjAwMC8wOC8xNSAwODo0NzowMApAQCAtNTQ1MywxNSArNTQ1MywxNyBAQAogICB3
aGlsZSAoZW5jbG9zaW5nKQogICAgIHsKICAgICAgIHRyZWUgbmFtZTsKKyAgICAgIHRyZWUgaW50
ZXJtZWRpYXRlOwogCiAgICAgICBpZiAoKG5ld19jbGFzc19kZWNsID0gZmluZF9hc19pbm5lcl9j
bGFzcyAoZW5jbG9zaW5nLCBjbGFzc190eXBlLCBjbCkpKQogICAgICAgICByZXR1cm4gbmV3X2Ns
YXNzX2RlY2w7Ci0KKyAgICAgIAorICAgICAgaW50ZXJtZWRpYXRlID0gZW5jbG9zaW5nOwogICAg
ICAgLyogRXhwbG9yZSBlbmNsb3NpbmcgY29udGV4dHMuICovCi0gICAgICB3aGlsZSAoSU5ORVJf
Q0xBU1NfREVDTF9QIChlbmNsb3NpbmcpKQorICAgICAgd2hpbGUgKElOTkVSX0NMQVNTX0RFQ0xf
UCAoaW50ZXJtZWRpYXRlKSkKIAl7Ci0JICBlbmNsb3NpbmcgPSBERUNMX0NPTlRFWFQgKGVuY2xv
c2luZyk7Ci0JICBpZiAoKG5ld19jbGFzc19kZWNsID0gZmluZF9hc19pbm5lcl9jbGFzcyAoZW5j
bG9zaW5nLCAKKwkgIGludGVybWVkaWF0ZSA9IERFQ0xfQ09OVEVYVCAoaW50ZXJtZWRpYXRlKTsK
KwkgIGlmICgobmV3X2NsYXNzX2RlY2wgPSBmaW5kX2FzX2lubmVyX2NsYXNzIChpbnRlcm1lZGlh
dGUsIAogCQkJCQkJICAgICBjbGFzc190eXBlLCBjbCkpKQogCSAgICByZXR1cm4gbmV3X2NsYXNz
X2RlY2w7CiAJfQo=


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