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

Bug 520201

Summary: [9] Code select fails with a binary type in a module
Product: [Eclipse Project] JDT Reporter: Jay Arthanareeswaran <jarthana>
Component: CoreAssignee: Jay Arthanareeswaran <jarthana>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 4.6   
Target Milestone: BETA J9   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Jay Arthanareeswaran CLA 2017-07-26 05:52:44 EDT
Steps:

1. Create a Java 9 project with JRE 9 in build path.
2. Open type ModuleDescriptor
3. Navigate to any of the constructors of that type and search for references or alternatively select any of the references to the type's fields and try to open declaration.

The exception thrown is:

java.lang.ClassCastException: org.eclipse.jdt.internal.compiler.lookup.ProblemReferenceBinding cannot be cast to org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding
	at org.eclipse.jdt.internal.compiler.lookup.ClassScope.detectHierarchyCycle(ClassScope.java:1315)
	at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:958)
	at org.eclipse.jdt.internal.compiler.lookup.ClassScope.connectTypeHierarchy(ClassScope.java:1122)
	at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.connectTypeHierarchy(CompilationUnitScope.java:360)
	at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:562)
	at org.eclipse.jdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:1041)
	at org.eclipse.jdt.internal.core.Openable.codeSelect(Openable.java:163)
	at org.eclipse.jdt.internal.core.ClassFile.codeSelect(ClassFile.java:196)
	at org.eclipse.jdt.internal.core.ClassFile.codeSelect(ClassFile.java:185)
Comment 1 Jay Arthanareeswaran CLA 2017-07-26 05:55:03 EDT
This particular issue can be fixed by passing a Java element when we construct the BasicCompilation unit in ClassFile#codeSelect(). But it needs to be investigated if there's an alternate way of doing. There are couple of constructors of BCU that don't take a Java element that are being used by few other clients.
Comment 2 Eclipse Genie CLA 2019-12-08 12:38:20 EST
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.