Project: JDT
Bug 99958 [refactoring] NPE in Infer Type Arguments
Reported: 2005-06-14 09:56:55 | Status: verified fixed

3.1 RC2 Steps to reproduce: - Workspace with JDT UI imported in source - All dependencies of JDT UI imported as linked binary projects -> Invoke Infer Type Arguments on JDT UI -> Following NPE occurs: 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:3058) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2691) 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.startIn ferTypeArgumentsRefactoring(RefactoringExecutionStarter.java:225) 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:3058) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2691) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1716) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1680) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:365) 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:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) 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.NullPointerException at org.eclipse.jdt.internal.core.util.BindingKeyParser.<init> (BindingKeyParser.java:417) at org.eclipse.jdt.internal.core.util.KeyToSignature.<init> (KeyToSignature.java:42) at org.eclipse.jdt.core.BindingKey.internalToSignature(BindingKey.java:233) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactor ing.getTypeArguments(InferTypeArgumentsRefactoring.java:374) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactor ing.rewriteTypeVariable(InferTypeArgumentsRefactoring.java:342) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactor ing.rewriteConstraintVariable(InferTypeArgumentsRefactoring.java:323) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactor ing.rewriteDeclarations(InferTypeArgumentsRefactoring.java:302) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactor ing.checkFinalConditions(InferTypeArgumentsRefactoring.java:229) 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) Root exception: java.lang.NullPointerException at org.eclipse.jdt.internal.core.util.BindingKeyParser.<init> (BindingKeyParser.java:417) at org.eclipse.jdt.internal.core.util.KeyToSignature.<init> (KeyToSignature.java:42) at org.eclipse.jdt.core.BindingKey.internalToSignature(BindingKey.java:233) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactor ing.getTypeArguments(InferTypeArgumentsRefactoring.java:374) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactor ing.rewriteTypeVariable(InferTypeArgumentsRefactoring.java:342) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactor ing.rewriteConstraintVariable(InferTypeArgumentsRefactoring.java:323) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactor ing.rewriteDeclarations(InferTypeArgumentsRefactoring.java:302) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsRefactor ing.checkFinalConditions(InferTypeArgumentsRefactoring.java:229) 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) The problem seems to be in file TypeHistoryInfo.java, method getEnclosingNames (): A TType (ArrayType) has been created for 'char[]', but without valid binding key

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/typeconstraints/types/TypeEnvironment.java