Community
Participate
Working Groups
Using eclipse.buildId=I20070516-0800 java.version=1.6.0_02-ea java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_CA Framework arguments: -startup D:\eclipse\I0516\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070515.jar -showlocation Command-line arguments: -os win32 -ws win32 -arch x86 -startup D:\eclipse\I0516\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070515.jar -debug -consolelog -console -showlocation I got this NPE trying to exclude part of a patch. Is this related to the old model ? java.lang.NullPointerException at org.eclipse.compare.internal.patch.Patcher.setEnabledHunk(Patcher.java:581) at org.eclipse.compare.internal.patch.Patcher.setEnabledFile(Patcher.java:564) at org.eclipse.compare.internal.patch.Patcher.setEnabled(Patcher.java:549) at org.eclipse.compare.internal.patch.PatchDiffNode.setEnabled(PatchDiffNode.java:37) at org.eclipse.compare.internal.patch.PreviewPatchPage2$5.run(PreviewPatchPage2.java:193) at org.eclipse.jface.action.Action.runWithEvent(Action.java:498) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284) at org.eclipse.jface.window.Window.runEventLoop(Window.java:820) at org.eclipse.jface.window.Window.open(Window.java:796) at org.eclipse.compare.patch.ApplyPatchOperation.openWizard(ApplyPatchOperation.java:154) at org.eclipse.compare.patch.ApplyPatchOperation.run(ApplyPatchOperation.java:198) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67) at org.eclipse.compare.internal.patch.CompareWithPatchAction$1.run(CompareWithPatchAction.java:59) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3650) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3287) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2365) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2204) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) 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:597) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:497) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436) at org.eclipse.equinox.launcher.Main.run(Main.java:1162) at org.eclipse.equinox.launcher.Main.main(Main.java:1137)
Would it be possible for you to attach the patch that caused the problem?
This is the patch attached to bug 187329. It is not a workspace patch.
I wanted to apply only the test part and I could not exclude parts inside org.eclipse.jdt.core after I selected the compiler tests project as the location to apply the patch. The part relative to org.eclipse.jdt.core was failing since it is not part of the compiler tests. But I could not exclude them without getting the NPE.
Tomasz, please investigate.
Created attachment 67634 [details] Patch This looks like an easy one. NPE was thrown due to fact that the patch provided by Olivier wasn't a workspace patch (it had no information about it's project). Two simple checks inside Patcher#setEnabledHunk should do the job. At least it works for me now :)
Created attachment 67635 [details] mylar/context/zip
The fix looks safe enough to consider for RC2.
Olivier, could I get you to review the patch. It's fairly straight forward.
+1. Patch is straight forward and help to exclude part of a patch when the patch is not a workspace patch
+1. Patch reviewed and released to HEAD.
Created attachment 68751 [details] Simple test I've been thinking about making the test more high-level (eg. start the test from parsing a non-workspace patch), but I hope the way it works now will also do the job.
Verified in I20070524-1800 and against the attached test.
Tests released.