Bug 171201 - wrong class instantiated
wrong class instantiated
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Andrew Haley
: Reopened
Depends On:
Blocks: 173278
  Show dependency treegraph
 
Reported: 2005-10-19 08:25 EDT by Andrew Cagney
Modified: 2010-07-27 08:11 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-07-27 08:11:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 24442 None None None Never
Sourceware 2270 None None None Never

  None (edit)
Description Andrew Cagney 2005-10-19 08:25:47 EDT
public class SameName
{
    public Object foo ()
    {
        class SingleName
        {
            public String toString ()
            {
                return "foo.SingleName";
            }
        }
        return new SingleName ();
    }
    public Object bar ()
    {
        class SingleName
        {
            public String toString ()
            {
                throw new RuntimeException ("bar.SingleName");
            }
        }
        return new SingleName ();
    }
    public static void main (String[] args)
    {
        System.out.println (new SameName ().foo().toString());
    }
}

cagney@localhost$ ./a.out
Exception in thread "main" java.lang.RuntimeException: bar.SingleName
   at SameName$2$SingleName.toString() (Unknown Source)
   at SameName.main(java.lang.String[]) (Unknown Source)
   at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
   at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
Comment 1 Andrew Haley 2005-10-19 09:02:21 EDT
Redirected to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24442
Comment 2 Andrew Cagney 2005-11-09 14:25:31 EST
Unfortunatly upstream doesn't fix RHEL 4.
Comment 6 Red Hat Bugzilla 2007-02-05 14:00:30 EST
REOPENED status has been deprecated. ASSIGNED with keyword of Reopened is preferred.

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