Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 17794 Details for
Bug 84801
Bad code generated for Java 5.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
This file generates bad code when compiled for Java 5
BadCodeDemo.java (text/plain), 1.37 KB, created by
Michael Dudzik
on 2005-02-09 12:33:56 EST
(
hide
)
Description:
This file generates bad code when compiled for Java 5
Filename:
MIME Type:
Creator:
Michael Dudzik
Created:
2005-02-09 12:33:56 EST
Size:
1.37 KB
patch
obsolete
>public class BadCodeDemo { > /* The following code misbehaves in Eclipse 3.1M4 when compiled under Java 5 > * It should print: > * m(int)1 > * m(Object)1 > * and terminate > * Instead, it repeately prints m(int)1 > * until stack overflow > * > * Removal of the unnecessary and unexecuted function m(double) allows the code to execute normally, > * as will an explicit cast of Integer to Object in method A.m(int) > * > * This code executes correctly when compiled with jdk1.5.0.0_01 > */ > > public static void main(String[] args) { > A a = new B(); > a.m(1); > } > > public interface I { > > void m(Object o); > > } > > public static abstract class A implements I { > > public final void m(int i) { > System.out.println("m(int)" + i); > /* if the following line is replaced with m((Object)new Integer(i)); , there is no infinite recursion */ > m(new Integer(i)); > } > /* or, if the following unexecuted method is removed, there is no infinite recursion */ > public final void m(double d) { > System.out.println("m(double)" + d); > m(new Double(d)); > } > } > > public static class B extends A { > > public void m(Object o) { > System.out.println("m(Object)" + o); > } > > } > > > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 84801
: 17794