Project: JDT
Bug 40402 NPE on paste
Reported: 2003-07-17 12:45:32 | Status: resolved fixed

M2 testing 1. In the package explorer select a type in a class file / JAR 2. Copy 3. Paste it in a CU or a type java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.runInCurrentThread(Unknown Source) at org.eclipse.jface.operation.ModalContext.run(Unknown Source) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Unknown Source) at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper.perform(RefactoringExecutionHelper.java:131) at org.eclipse.jdt.internal.ui.refactoring.reorg.ReorgCopyStarter.run(ReorgCopyStarter.java:70) at org.eclipse.jdt.internal.ui.refactoring.reorg.PasteAction$JavaElementAndResourcePaster.paste(PasteAction.java:304) at org.eclipse.jdt.internal.ui.refactoring.reorg.PasteAction.run(PasteAction.java:146) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:194) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:172) at org.eclipse.jface.action.Action.runWithEvent(Unknown Source) at org.eclipse.ui.actions.RetargetAction.runWithEvent(Unknown Source) at org.eclipse.ui.internal.commands.old.ActionHandler.execute(Unknown Source) at org.eclipse.ui.internal.commands.old.ContextAndHandlerManager.pressed(Unknown Source) at org.eclipse.ui.internal.commands.old.ContextAndHandlerManager.access$1(Unknown Source) at org.eclipse.ui.internal.commands.old.ContextAndHandlerManager$7.widgetSelected(Unknown Source) at org.eclipse.ui.internal.AcceleratorMenu$2.handleEvent(Unknown Source) 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:2188) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1878) at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source) at org.eclipse.ui.internal.Workbench.run(Unknown Source) at org.eclipse.core.internal.boot.InternalBootLoader.run(Unknown Source) at org.eclipse.core.boot.BootLoader.run(Unknown Source) 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(Unknown Source) at org.eclipse.core.launcher.Main.run(Unknown Source) at org.eclipse.core.launcher.Main.main(Unknown Source) Caused by: java.lang.NullPointerException at org.eclipse.jdt.internal.corext.util.Resources.checkInSync(Resources.java:63) at org.eclipse.jdt.internal.corext.refactoring.reorg.CopyRefactoring.checkActivation(CopyRefactoring.java:70) at org.eclipse.jdt.internal.corext.refactoring.base.Refactoring.checkPreconditions(Refactoring.java:77) at org.eclipse.jdt.internal.ui.refactoring.RefactoringExecutionHelper$Operation.run(RefactoringExecutionHelper.java:69) ... 31 more

Files changed in fix:
org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/CopyRefactoring.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/DeleteRefactoring.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/MoveRefactoring.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/reorg/ReorgUtils.java