Bug 165753 - gcj generates different anonymous class names to sun
gcj generates different anonymous class names to sun
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Andrew Haley
Depends On:
  Show dependency treegraph
Reported: 2005-08-11 15:36 EDT by Andrew Cagney
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-03-30 15:22:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Andrew Cagney 2005-08-11 15:36:16 EDT
[there should be a gcc-java category :-)]

Given the java code:

import java.util.Observer;
import java.util.Observable;
class x
    Observer y = new Observer () {
	    public void update (Observable v, Object o) { }
    void function () {
	class O implements Observer {
	    public void update (Observable v, Object o) { }

GCJ creates the .class files:

$ gcj -C x.java
$ ls *.class
x$1.class x$2$O.class x.class

where as sun's compiler creates:

x$1.class x$1O.class x.class
Comment 2 Andrew Cagney 2005-08-11 16:47:34 EDT
FYI, ECJ exibits behavior consistent with sun (so presumably implemented the
same algorithm).

I'd assume this is a pedantic language-lawyer edge case (which is why I set the
severity to "low" :-).
Comment 3 Tom Tromey 2006-01-04 15:43:22 EST
AFAIK there's no spec or requirement for inner class names.
In fact I don't recall ever seeing that Sun's approach is documented.
Comment 4 Christian Iseli 2007-01-22 06:59:38 EST
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Comment 5 Tom Tromey 2007-03-08 14:14:12 EST
This still affects FC5 and FC6.  I set the version field here to fc6.

In F7 the inner class names are dependent on what the Eclipse compiler does.
If they are identical to sun, per comment #2, then this bug will be
fixed there.

In any case the names here are not part of the spec.
Fixing this in an older gcj is pretty hard.  I don't think anyone
will bother.
Comment 6 Jakub Jelinek 2007-03-12 08:52:11 EDT
I don't think it is even desirable to change this in FC5/FC6, there we primarily
need to avoid ABI breakages and need to be compatible with FC5 resp. FC6 gcj.
Comment 7 Tom Tromey 2007-03-30 15:22:07 EDT
I agree.  I am closing this.
I chose "wontfix", but I don't really know which resolution
is most appropriate.

Note You need to log in before you can comment on or make changes to this bug.