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

Bug 424933

Summary: ITypeBinding#getJavaElement() throws IAE for unresolved qualified type reference
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jay Arthanareeswaran <jarthana>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: srikanth_sankaran
Version: 4.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug

Description Markus Keller CLA 2014-01-06 08:58:58 EST
ITypeBinding#getJavaElement() throws an IAE for the unresolved qualified type reference "A.B" here:

package somewhere;
public class Imports {
    A.B f;
}

Expected: An inexistent source type "somewhere.A.B" in an inexistent CU "somehere/A.java".

For an unqualified type, this already works fine. E.g. in source "A g;", it returns a source type "somewhere.A" in CU "somewhere/A.java" (both inexistent).


org.eclipse.jdt.astview
Error
Mon Jan 06 14:50:43 CET 2014
Exception thrown in IBinding#getJavaElement() for "LA/B;"

java.lang.IllegalArgumentException: Compilation unit name must end with .java, or one of the registered Java-like extensions
	at org.eclipse.jdt.internal.core.PackageFragment.getCompilationUnit(PackageFragment.java:214)
	at org.eclipse.jdt.internal.core.util.Util.getCompilationUnit(Util.java:774)
	at org.eclipse.jdt.internal.core.util.Util.getUnresolvedJavaElement(Util.java:1532)
	at org.eclipse.jdt.core.dom.TypeBinding.getUnresolvedJavaElement(TypeBinding.java:528)
	at org.eclipse.jdt.core.dom.TypeBinding.getUnresolvedJavaElement(TypeBinding.java:519)
	at org.eclipse.jdt.core.dom.TypeBinding.getJavaElement(TypeBinding.java:501)
	at org.eclipse.jdt.astview.views.Binding.getChildren(Binding.java:251)
	at org.eclipse.jdt.astview.views.ASTViewContentProvider.getChildren(ASTViewContentProvider.java:95)
	at 
...
Comment 1 Eclipse Genie CLA 2019-11-29 09:40:02 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.