Bug 97273 - Illegal argument exception in Signature#getTypeSignatureKind
Summary: Illegal argument exception in Signature#getTypeSignatureKind
Status: CLOSED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 RC2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-30 10:52 EDT by Dirk Baeumer CLA
Modified: 2005-06-10 09:49 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2005-05-30 10:52:47 EDT
RC1:

- check out org.eclipse.ltk.core.refactoring form HEAD
- change compliance level to 5.0
- run infer type arguments

observe: you get the exception below.

The type signature which caused the exception looks like this:

<T:>Ljava.lang.Class;

We created the signature from a binding key which looks like this:

Ljava/lang/Class<TT;>;

using new BindingKey("Ljava/lang/Class<TT;>;").internalToSignature()

Assigning to JDT/Core first since I think this is a core problem.

java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:327)
	at
org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:293)
	at
org.eclipse.ltk.ui.refactoring.RefactoringWizard.createChange(RefactoringWizard.java:573)
	at
org.eclipse.ltk.ui.refactoring.RefactoringWizard.computeUserInputSuccessorPage(RefactoringWizard.java:416)
	at
org.eclipse.ltk.ui.refactoring.UserInputWizardPage.computeSuccessorPage(UserInputWizardPage.java:74)
	at
org.eclipse.ltk.ui.refactoring.UserInputWizardPage.getNextPage(UserInputWizardPage.java:114)
	at
org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.previewPressed(RefactoringWizardDialog2.java:447)
	at
org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.access$3(RefactoringWizardDialog2.java:445)
	at
org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2$1.widgetSelected(RefactoringWizardDialog2.java:584)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2929)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2562)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:809)
	at org.eclipse.jface.window.Window.open(Window.java:787)
	at
org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation$1.run(RefactoringWizardOpenOperation.java:125)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
	at
org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation.run(RefactoringWizardOpenOperation.java:138)
	at
org.eclipse.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate(RefactoringStarter.java:40)
	at
org.eclipse.jdt.internal.corext.refactoring.RefactoringExecutionStarter.startInferTypeArgumentsRefactoring(RefactoringExecutionStarter.java:223)
	at
org.eclipse.jdt.ui.actions.InferTypeArgumentsAction.run(InferTypeArgumentsAction.java:113)
	at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:222)
	at
org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:198)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
	at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
	at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
	at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2929)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2562)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1694)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1658)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:366)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:375)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:162)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)
Caused by: java.lang.IllegalArgumentException
	at org.eclipse.jdt.core.Signature.getTypeSignatureKind(Signature.java:1090)
	at
org.eclipse.jdt.internal.corext.codemanipulation.ImportsStructure.addImportFromSignature(ImportsStructure.java:519)
	at
org.eclipse.jdt.internal.corext.codemanipulation.ImportRewrite.addImportFromSignature(ImportRewrite.java:174)
	at
org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring.getTypeArguments(InferTypeArgumentsRefactoring.java:341)
	at
org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring.rewriteTypeVariable(InferTypeArgumentsRefactoring.java:313)
	at
org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring.rewriteConstraintVariable(InferTypeArgumentsRefactoring.java:294)
	at
org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring.rewriteDeclarations(InferTypeArgumentsRefactoring.java:273)
	at
org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactoring.checkFinalConditions(InferTypeArgumentsRefactoring.java:200)
	at
org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:84)
	at
org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:114)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1719)
	at
org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:86)
	at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Comment 1 Philipe Mulet CLA 2005-06-02 12:45:16 EDT
+1 for RC2
Comment 2 Jerome Lanneluc CLA 2005-06-03 04:34:24 EDT
Changed Signature#getTypeSignatureKind(String) and getTypeSignatureKind(char[])
to skip the type parameters definition.
Added regression tests SignatureTests#testGetTypeSignatureKind25() and
testGetTypeSignatureKindCharArray25().
Comment 3 Olivier Thomann CLA 2005-06-07 13:38:16 EDT
Verified in N20050606-0010 + JDT/Core HEAD
Comment 4 Frederic Fusier CLA 2005-06-10 09:49:50 EDT
Verified for 3.1 RC2 using build I20050610-0010