Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 101512

Summary: [compiler] Useless fields generated for anonymous classes
Product: [Eclipse Project] JDT Reporter: Keith W. Campbell <keithc>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
Sample code none

Description Keith W. Campbell CLA 2005-06-23 13:55:04 EDT
Anonymous classes that don't make reference to fields or methods of outer
classes don't need synthetic this$0 fields. Eliminating them would yield a
(small?) time and space improvement.

BTW, even Sun's java(5.0) compiler does this!
Comment 1 Keith W. Campbell CLA 2005-06-23 13:56:38 EDT
Created attachment 23879 [details]
Sample code
Comment 2 Philipe Mulet CLA 2005-06-23 16:33:15 EDT
We did it in the past, and took this out to better mimic some JLS semantics. Now
it is true that we could optimize them out in the end.
Comment 3 Eclipse Genie CLA 2020-04-20 06:33:00 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.