Bug 171201
| Summary: | wrong class instantiated | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 4 | Reporter: | Andrew Cagney <cagney> |
| Component: | gcc | Assignee: | Andrew Haley <aph> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 4.0 | CC: | 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 | ||
Redirected to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24442 Unfortunatly upstream doesn't fix RHEL 4. REOPENED status has been deprecated. ASSIGNED with keyword of Reopened is preferred. |
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)