Bug 78087

Summary: [dom] TypeBinding#getJavaElement() throws IllegalArgumentException for parameterized or raw reference to binary type
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: martinae, tobias_widmer
Version: 3.0   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2004-11-08 13:00:33 EST
200411050810

On a raw TypeBinding of 'java.util.Comparable', method getJavaElement() throws
the exception below. [Not reproducible in eclipse - client code is not in CVS.]


!ENTRY org.eclipse.ui 4 0 2004-11-08 18:35:29.163
!MESSAGE Compilation unit name must end with .java
!STACK 0
java.lang.IllegalArgumentException: Compilation unit name must end with .java
	at
org.eclipse.jdt.internal.core.PackageFragment.getCompilationUnit(PackageFragment.java:191)
	at org.eclipse.jdt.core.dom.TypeBinding.getCompilationUnit(TypeBinding.java:449)
	at org.eclipse.jdt.core.dom.TypeBinding.getJavaElement(TypeBinding.java:293)
	at org.eclipse.jdt.core.dom.MethodBinding.getJavaElement(MethodBinding.java:200)
	at org.eclipse.jdt.internal.corext.dom.Bindings.asUIString(Bindings.java:101)
	at
org.eclipse.jdt.internal.ui.text.correction.UnimplementedMethodsCompletionProposal.getAdditionalProposalInfo(UnimplementedMethodsCompletionProposal.java:266)
	at
org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation(AdditionalInfoController.java:221)
	at
org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation(AbstractInformationControlManager.java:761)
	at
org.eclipse.jface.text.AbstractInformationControlManager.showInformation(AbstractInformationControlManager.java:751)
	at
org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run(AdditionalInfoController.java:173)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:118)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2771)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2451)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1529)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1500)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:276)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:102)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
	at java.lang.reflect.Method.invoke(Method.java:391)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:185)
	at org.eclipse.core.launcher.Main.run(Main.java:704)
	at org.eclipse.core.launcher.Main.main(Main.java:688)
Compilation unit name must end with .java
Comment 1 Tobias Widmer CLA 2004-11-10 07:07:30 EST
JDT UI note: Update Bindings/PullUpRefactoring
Comment 2 Markus Keller CLA 2004-11-23 08:31:37 EST
This problem also occurs with parameterized binary types (e.g.
ArrayList<Integer>). Adapting summary.
Comment 3 Jerome Lanneluc CLA 2004-11-26 06:41:44 EST
Changed TypeBinding#getJavaElement() to take the erasure of the type if it is a
raw or parameterized type.

Added regression tests ASTModelBridgeTests#testParameterizedBinaryType() and
testRawBinaryType()
Comment 4 Markus Keller CLA 2004-11-26 18:34:21 EST
*** Bug 79580 has been marked as a duplicate of this bug. ***
Comment 5 Frederic Fusier CLA 2004-12-15 05:50:33 EST
Verified for 3.1 M4 using build I200412142000.