Bug 171201 - wrong class instantiated
Summary: wrong class instantiated
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Andrew Haley
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 173278
TreeView+ depends on / blocked
 
Reported: 2005-10-19 12:25 UTC by Andrew Cagney
Modified: 2010-07-27 12:11 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-07-27 12:11:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 24442 0 None None None Never
Sourceware 2270 0 None None None Never

Description Andrew Cagney 2005-10-19 12:25:47 UTC
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 13:02:21 UTC
Redirected to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24442

Comment 2 Andrew Cagney 2005-11-09 19:25:31 UTC
Unfortunatly upstream doesn't fix RHEL 4.


Comment 6 Red Hat Bugzilla 2007-02-05 19:00:30 UTC
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.