Bug 112169

Summary: [Apply Patch] Exception applying a patch
Product: [Eclipse Project] Platform Reporter: Martin Aeschlimann <martinae>
Component: CompareAssignee: Michael Valenta <Michael.Valenta>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne
Version: 3.2   
Target Milestone: 3.3 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch for preventing the checking of diffs with problems in Apply Patch none

Description Martin Aeschlimann CLA 2005-10-11 04:36:18 EDT
N20051009

- select AssistQuickFixTest.java from org.eclipse.jdt.ui.texts
- apply patch from attachment 27447 [details]. No match, check the tree anyway (is this a
bug?) and press ok


Error 2005-10-11 10:32:18.909 Internal Error
java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:327)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:843)
	at
org.eclipse.compare.internal.patch.PatchWizard.performFinish(PatchWizard.java:117)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:676)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:349)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:607)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:884)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3229)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2853)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:809)
	at org.eclipse.jface.window.Window.open(Window.java:787)
	at
org.eclipse.compare.internal.patch.CompareWithPatchAction.run(CompareWithPatchAction.java:65)
	at org.eclipse.compare.internal.BaseCompareAction.run(BaseCompareAction.java:26)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:544)
	at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:494)
	at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:406)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:884)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3229)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2853)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1763)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1727)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:371)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106)
	at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:375)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:164)
	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:338)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:282)
	at org.eclipse.core.launcher.Main.run(Main.java:977)
	at org.eclipse.core.launcher.Main.main(Main.java:952)
Caused by: java.lang.IllegalArgumentException: Attempted to beginRule:
F/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix, does not match
outer scope rule:
L/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/AssistQuickFixTest.java
	at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java:58)
	at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:117)
	at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:226)
	at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:59)
	at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:190)
	at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:96)
	at
org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1662)
	at org.eclipse.core.internal.resources.Folder.create(Folder.java:84)
	at org.eclipse.core.internal.resources.Folder.create(Folder.java:117)
	at org.eclipse.compare.internal.patch.Patcher.createPath(Patcher.java:977)
	at org.eclipse.compare.internal.patch.Patcher.applyAll(Patcher.java:827)
	at
org.eclipse.compare.internal.patch.WorkspacePatcher.applyAll(WorkspacePatcher.java:181)
	at org.eclipse.compare.internal.patch.PatchWizard$1.execute(PatchWizard.java:111)
	at
org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:98)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1707)
	at
org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:110)
	at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Comment 1 Bogdan Gheorghe CLA 2005-10-11 14:20:19 EDT
Created attachment 28126 [details]
Patch for preventing the checking of diffs with problems in Apply Patch
Comment 2 Bogdan Gheorghe CLA 2005-10-11 14:20:43 EDT
Problem stemmed from the new Patcher allowing user to check the tree and an
attempt to apply the patch despite the hunk having no match. The old patcher
avoided this problem by preventing users from applying the patch in the first place.

Attached is a patch that will check the state of the element that has been
checked  which will prevent the above situation from reoccuring.
Comment 3 Michael Valenta CLA 2007-01-22 15:46:21 EST
*** Bug 170085 has been marked as a duplicate of this bug. ***
Comment 4 Michael Valenta CLA 2007-01-22 16:26:34 EST
Fix released to HEAD
Comment 5 Michael Valenta CLA 2007-02-06 08:57:58 EST
Verified using I20070206-0010