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 23879 Details for
Bug 101512
[compiler] Useless fields generated for anonymous classes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Sample code
Sample.java (text/plain), 1.73 KB, created by
Keith W. Campbell
on 2005-06-23 13:56:38 EDT
(
hide
)
Description:
Sample code
Filename:
MIME Type:
Creator:
Keith W. Campbell
Created:
2005-06-23 13:56:38 EDT
Size:
1.73 KB
patch
obsolete
>package bug101512; > >/** > * This class tests whether compilers optimize away the 'this' pointer > * for unreferenced outer classes. > * > * @author keithc > */ >public class Sample >{ > class Inner > { > void non_static_test() > { > run(new Runnable() > { > // we don't need Inner.this.this > public void run() > { > println("Inter non-static"); //$NON-NLS-1$ > } > }); > } > } > > static class Nested > { > static void static_test() > { > run(new Runnable() > { > public void run() > { > println("Nested static"); //$NON-NLS-1$ > } > }); > } > > void non_static_test() > { > run(new Runnable() > { > // we don't need Nested.this > public void run() > { > println("Nested non-static"); //$NON-NLS-1$ > } > }); > } > } > > static void static_test() > { > class StaticLocal > { > void non_static_test() > { > run(new Runnable() > { > // we don't need StaticLocal.this > public void run() > { > println("StaticLocal non-static"); //$NON-NLS-1$ > } > }); > } > } > > run(new Runnable() > { > public void run() > { > println("static"); //$NON-NLS-1$ > } > }); > } > > void non_static_test() > { > class NonStaticLocal > { > void non_static_test() > { > run(new Runnable() > { > // we don't need NonStaticLocal.this > public void run() > { > println("NonStaticLocal non-static"); //$NON-NLS-1$ > } > }); > } > } > > run(new Runnable() > { > // we don't need Sample.this here > public void run() > { > println("non-static"); //$NON-NLS-1$ > } > }); > } > > static void println(String text) > { > System.out.println(text); > } > > static void run(Runnable runnable) > { > runnable.run(); > } >}
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 101512
: 23879