Bug 99686 - IAE in Util#scanTypeBoundSignature
Summary: IAE in Util#scanTypeBoundSignature
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-13 11:20 EDT by Tobias Widmer CLA
Modified: 2005-06-16 13:59 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix (1.31 KB, patch)
2005-06-14 12:43 EDT, Jerome Lanneluc CLA
no flags Details | Diff
Regression test (1.24 KB, patch)
2005-06-14 12:44 EDT, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Widmer CLA 2005-06-13 11:20:31 EDT
3.1 RC2

Steps to reproduce:
- Invoke content assist on following snippet:

public class C {
	Object fObject= null;
	public void foo() {
		Object clazz= new Object() {
			Object object= this.getClass().<Ctrl+Space>
		}
	}
}

The following exception occurs:

java.lang.IllegalArgumentException
	at org.eclipse.jdt.internal.core.util.Util.scanTypeBoundSignature
(Util.java:2574)
	at org.eclipse.jdt.internal.core.util.Util.scanTypeSignature
(Util.java:2353)
	at org.eclipse.jdt.core.Signature.getReturnType(Signature.java:1635)
	at 
org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.createMethodPropos
alLabel(CompletionProposalLabelProvider.java:182)
	at 
org.eclipse.jdt.ui.text.java.CompletionProposalLabelProvider.createLabel
(CompletionProposalLabelProvider.java:351)
	at 
org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.computeDisplay
String(LazyJavaCompletionProposal.java:365)
	at 
org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.getDisplayStri
ng(LazyJavaCompletionProposal.java:359)
	at 
org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.computeSortStr
ing(LazyJavaCompletionProposal.java:714)
	at 
org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.getSortString
(LazyJavaCompletionProposal.java:704)
	at org.eclipse.jdt.ui.text.java.CompletionProposalComparator.getSortKey
(CompletionProposalComparator.java:73)
	at org.eclipse.jdt.ui.text.java.CompletionProposalComparator.compare
(CompletionProposalComparator.java:68)
	at java.util.Arrays.mergeSort(Arrays.java:1284)
	at java.util.Arrays.mergeSort(Arrays.java:1296)
	at java.util.Arrays.mergeSort(Arrays.java:1295)
	at java.util.Arrays.mergeSort(Arrays.java:1295)
	at java.util.Arrays.mergeSort(Arrays.java:1295)
	at java.util.Arrays.sort(Arrays.java:1223)
	at org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.order
(JavaCompletionProcessor.java:305)
	at 
org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.internalComputeCo
mpletionProposals(JavaCompletionProcessor.java:390)
	at 
org.eclipse.jdt.internal.ui.text.java.JavaCompletionProcessor.computeCompletion
Proposals(JavaCompletionProcessor.java:313)
	at 
org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposal
s(ContentAssistant.java:1503)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals
(CompletionProposalPopup.java:256)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$7
(CompletionProposalPopup.java:253)
	at org.eclipse.jface.text.contentassist.CompletionProposalPopup$1.run
(CompletionProposalPopup.java:216)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:69)
	at 
org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals
(CompletionProposalPopup.java:211)
	at org.eclipse.jface.text.contentassist.ContentAssistant$2.run
(ContentAssistant.java:327)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages
(Synchronizer.java:118)
	... 18 more
Comment 1 Olivier Thomann CLA 2005-06-13 21:20:45 EDT
Could not reproduce.
Comment 2 Tobias Widmer CLA 2005-06-14 05:02:02 EDT
I am still able to reproduce it. I have only one project with one class in my 
workspace. The project uses 5.0 compliance and a 1.5 JRE.
Comment 3 Jerome Lanneluc CLA 2005-06-14 12:43:43 EDT
Created attachment 23069 [details]
Proposed fix

In the case of code assist, the constant pool name of local and anoymous types
is always null (since code generation has not started). As a consequence the
signature is invalid (L;) and cannot be decded.

Changing it to use the source name for local types, and the super class source
name for anonymous.
Comment 4 Jerome Lanneluc CLA 2005-06-14 12:44:04 EDT
Created attachment 23070 [details]
Regression test
Comment 5 Philipe Mulet CLA 2005-06-15 07:39:36 EDT
+1 for RC3

Dani - pls cast your vote
Comment 6 Dani Megert CLA 2005-06-15 07:49:12 EDT
+1 for 3.1 RC3.
Comment 7 Jerome Lanneluc CLA 2005-06-15 09:08:37 EDT
Thanks Dani.
Released fix and regression test.
Comment 8 Olivier Thomann CLA 2005-06-16 13:59:22 EDT
Verified using N20050616-0010 + JDT/Core HEAD