Project: JDT
Bug 151611 [infer type arguments] NPE in InferTypeArgumentsTCModel.makeVariableVariable()
Reported: 2006-07-24 13:50:25 | Status: verified fixed

In the Java Editor, I was in the following line: Map<PpmMedia, String> parallelVersions = new HashMap(); when I chose Ctrl+1 and picked "Add type parameters to 'HashMap'" on the HashMap constructor. That resulted in the following NPE: eclipse.buildId=M20060629-1905 java.version=1.5.0 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE Command-line arguments: -os win32 -ws win32 -arch x86 -data D:\eclipse_workspaces\sgw2 This is a continuation of log file D:\eclipse_workspaces\sgw2\.metadata\.bak_0.log Created Time: 2006-07-24 13:16:35.266 Error Mon Jul 24 19:52:30 CEST 2006 java.lang.NullPointerException java.lang.NullPointerException at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeVariableVariable(InferTypeArgumentsTCModel.java:350) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsTCModel.makeDeclaredVariableVariable(InferTypeArgumentsTCModel.java:367) at org.eclipse.jdt.internal.corext.refactoring.generics.InferTypeArgumentsConstraintCreator.endVisit(InferTypeArgumentsConstraintCreator.java:869) at org.eclipse.jdt.core.dom.VariableDeclarationFragment.accept0(VariableDeclarationFragment.java:226) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2466) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2536) at org.eclipse.jdt.core.dom.VariableDeclarationStatement.accept0(VariableDeclarationStatement.java:272) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2466) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2536) at org.eclipse.jdt.core.dom.Block.accept0(Block.java:135) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2466) at org.eclipse.jdt.core.dom.ASTNode.acceptChild(ASTNode.java:2513) at org.eclipse.jdt.core.dom.MethodDeclaration.accept0(MethodDeclaration.java:501) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2466) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2536) at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:483) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2466) at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:2536) at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:212) at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:2466) at org.eclipse.jdt.internal.corext.fix.Java50Fix$AddTypeParametersOperation.rewriteAST(Java50Fix.java:116) at org.eclipse.jdt.internal.corext.fix.LinkedFix.createChange(LinkedFix.java:106) at org.eclipse.jdt.internal.ui.text.correction.FixCorrectionProposal.createTextChange(FixCorrectionProposal.java:75) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.createChange(CUCorrectionProposal.java:303) at org.eclipse.jdt.internal.ui.text.correction.ChangeCorrectionProposal.getChange(ChangeCorrectionProposal.java:207) at org.eclipse.jdt.internal.ui.text.correction.ChangeCorrectionProposal.performChange(ChangeCorrectionProposal.java:100) at org.eclipse.jdt.internal.ui.text.correction.LinkedCorrectionProposal.performChange(LinkedCorrectionProposal.java:231) at org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal.apply(CUCorrectionProposal.java:244) at org.eclipse.jdt.internal.ui.text.correction.FixCorrectionProposal.apply(FixCorrectionProposal.java:142) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertProposal(CompletionProposalPopup.java:777) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.insertSelectedProposalWithMask(CompletionProposalPopup.java:728) at org.eclipse.jface.text.contentassist.CompletionProposalPopup.verifyKey(CompletionProposalPopup.java:1139) at org.eclipse.jface.text.contentassist.ContentAssistant$InternalListener.verifyKey(ContentAssistant.java:650) at org.eclipse.jface.text.TextViewer$VerifyKeyListenersManager.verifyKey(TextViewer.java:434) at org.eclipse.swt.custom.StyledTextListener.handleEvent(StyledTextListener.java:61) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:709) at org.eclipse.swt.custom.StyledText.handleKeyDown(StyledText.java:5047) at org.eclipse.swt.custom.StyledText$7.handleEvent(StyledText.java:4789) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:952) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:937) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:965) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:961) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1275) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3346) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3246) at org.eclipse.swt.widgets.Display.windowProc(Display.java:4025) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1923) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) 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:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/generics/InferTypeArgumentsTCModel.java