Project: JDT
Bug 39923 NPE inlining a variable [refactoring]
Reported: 2003-07-11 09:13:10 | Status: resolved fixed

I20030710 Tried to inline 'unit' in the following method: public void beginReporting() { ICompilationUnit unit= fCompilationUnit; if (unit != null && unit.getJavaProject().isOnClasspath(unit)) fCollectedProblems= new ArrayList(); else fCollectedProblems= null; } The method belongs to a static inner class. java.lang.NullPointerException at org.eclipse.jdt.internal.corext.refactoring.code.InlineMethodRefactoring.getTar getNode(InlineMethodRefactoring.java:319) at org.eclipse.jdt.internal.corext.refactoring.code.InlineMethodRefactoring.create (InlineMethodRefactoring.java:119) at org.eclipse.jdt.ui.actions.InlineAction.tryInlineMethod (InlineAction.java:127) at org.eclipse.jdt.ui.actions.InlineAction.run(InlineAction.java:109) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java:196) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java:172) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.ui.actions.RetargetAction.runWithEvent (RetargetAction.java:187) at org.eclipse.ui.internal.WWinPluginAction.runWithEvent (WWinPluginAction.java:212) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:542) at org.eclipse.jface.action.ActionContributionItem.access$4 (ActionContributionItem.java:496) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent (ActionContributionItem.java:468) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:848) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2041) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1747) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1383) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1366) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:858) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:291) at org.eclipse.core.launcher.Main.run(Main.java:747) at org.eclipse.core.launcher.Main.main(Main.java:583

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