Bug 171201

Summary: wrong class instantiated
Product: Red Hat Enterprise Linux 4 Reporter: Andrew Cagney <cagney>
Component: gccAssignee: Andrew Haley <aph>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: ebachalo, jakub
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-07-27 12:11:31 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 173278    

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.