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

Bug 426854

Summary: Inner class handling with regular char $ in name
Product: [Eclipse Project] JDT Reporter: AndrĂ© Pankraz <andre>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description André Pankraz CLA 2014-01-29 03:12:48 EST
Hi,

if you compile following small (senseless) class then the DecTestInner$1 will overwrite the anonymous synthetic class for RUNNER : Runnable.
In fact the structures merge somehow, the lower class is now recognized as inner class (wrong) and the upper anonymous class disappears.

Please compare JDK compiler (which is really hard to perplex which such artificial scenarios, he does it fine):

---
package org.decojer.cavaj.test.jdk5;

public abstract class DecTestInner {

	private static Runnable RUNNER = new Runnable() {

		public void run() {
			System.out.println(this);
		}

	};

	DecTestInner$1 test = new DecTestInner$1();

}

class DecTestInner$1 {

	public static String TEST = "TEST";

}
---


The decompiled structure here is:

---
package org.decojer.cavaj.test.jdk5;


public abstract class DecTestInner {
	private static Runnable RUNNER = new Object() {
	};
	DecTestInner$1 test = new Object() {
		public static String TEST = "TEST";
	};
}
---
Comment 1 Eclipse Genie CLA 2018-10-12 01:28:12 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.

If you have further information on the current state of the bug, please add it. 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.