Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336672 - Introduce Parameter Object Script Creation (and Reading) Broken
Summary: Introduce Parameter Object Script Creation (and Reading) Broken
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-08 22:01 EST by Kyle P CLA
Modified: 2023-02-23 17:38 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle P CLA 2011-02-08 22:01:27 EST
Build Identifier: 20100617-1415, M20100909-0800

I've tried this on both mac and win7 environments on relatively recent versions of Eclipse: Use Eclipse to introduce a parameter object (via refactoring menu). Next tell it to create a script of that refactoring, and it spits out a file with just xml and session tags. Upon investigation, I find this error: 
org.eclipse.core.runtime.CoreException: Error reading file %Path to my particular history file% at org.eclipse.ltk.internal.core.refactoring.history.RefactoringHistoryManager.getCachedSession(RefactoringHistoryManager.java:970) 
at org.eclipse.ltk.internal.core.refactoring.history.RefactoringHistoryManager.requestDescriptor(RefactoringHistoryManager.java:1166)
	at org.eclipse.ltk.internal.core.refactoring.history.RefactoringHistoryService.requestDescriptor(RefactoringHistoryService.java:823)
	at org.eclipse.ltk.core.refactoring.RefactoringDescriptorProxy.requestDescriptor(RefactoringDescriptorProxy.java:131)
	at org.eclipse.ltk.internal.ui.refactoring.history.RefactoringHistoryControl$6.runInUIThread(RefactoringHistoryControl.java:688)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ltk.ui.refactoring.actions.CreateRefactoringScriptAction.showCreateScriptWizard(CreateRefactoringScriptAction.java:95)
	at org.eclipse.ltk.ui.refactoring.actions.CreateRefactoringScriptAction.run(CreateRefactoringScriptAction.java:120)
	at org.eclipse.jdt.internal.ui.refactoring.actions.CreateRefactoringScriptAction.run(CreateRefactoringScriptAction.java:50)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Contains: Invalid contents at line 3 column 1191
java.lang.IllegalArgumentException: The method must exist
	at org.eclipse.ltk.internal.core.refactoring.RefactoringSessionReader.startElement(RefactoringSessionReader.java:235)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
	at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1343)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
	at org.eclipse.ltk.internal.core.refactoring.RefactoringSessionReader.readSession(RefactoringSessionReader.java:138)
	at org.eclipse.ltk.internal.core.refactoring.history.RefactoringHistoryManager.getCachedSession(RefactoringHistoryManager.java:965)
	at org.eclipse.ltk.internal.core.refactoring.history.RefactoringHistoryManager.requestDescriptor(RefactoringHistoryManager.java:1166)
	at org.eclipse.ltk.internal.core.refactoring.history.RefactoringHistoryService.requestDescriptor(RefactoringHistoryService.java:823)
	at org.eclipse.ltk.core.refactoring.RefactoringDescriptorProxy.requestDescriptor(RefactoringDescriptorProxy.java:131)
	at org.eclipse.ltk.internal.ui.refactoring.history.RefactoringHistoryControl$6.runInUIThread(RefactoringHistoryControl.java:688)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ltk.ui.refactoring.actions.CreateRefactoringScriptAction.showCreateScriptWizard(CreateRefactoringScriptAction.java:95)
	at org.eclipse.ltk.ui.refactoring.actions.CreateRefactoringScriptAction.run(CreateRefactoringScriptAction.java:120)
	at org.eclipse.jdt.internal.ui.refactoring.actions.CreateRefactoringScriptAction.run(CreateRefactoringScriptAction.java:50)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: java.lang.IllegalArgumentException: The method must exist
	at org.eclipse.jdt.core.refactoring.descriptors.IntroduceParameterObjectDescriptor.setMethod(IntroduceParameterObjectDescriptor.java:450)
	at org.eclipse.jdt.core.refactoring.descriptors.IntroduceParameterObjectDescriptor.initializeFromMap(IntroduceParameterObjectDescriptor.java:372)
	at org.eclipse.jdt.core.refactoring.descriptors.IntroduceParameterObjectDescriptor.<init>(IntroduceParameterObjectDescriptor.java:237)
	at org.eclipse.jdt.internal.core.refactoring.descriptors.RefactoringSignatureDescriptorFactory.createIntroduceParameterObjectDescriptor(RefactoringSignatureDescriptorFactory.java:194)
	at org.eclipse.jdt.internal.corext.refactoring.scripting.IntroduceParameterObjectContribution.createDescriptor(IntroduceParameterObjectContribution.java:46)
	at org.eclipse.ltk.internal.core.refactoring.history.RefactoringContributionManager.createDescriptor(RefactoringContributionManager.java:113)
	at org.eclipse.ltk.internal.core.refactoring.RefactoringSessionReader.startElement(RefactoringSessionReader.java:233)
	... 58 more
When I view the history file, the refactoring instance is there, so I copy it into a new script file and ask Eclipse to run it. Eclipse refuses to recognize it as a script file.

Reproducible: Always

Steps to Reproduce:
1.Use Eclipse to Introduce a Parameter Object (refactoring).
2.Tell it to create a script from that refactoring.
3.Watch it fail.
4.Retrieve refactoring manually from history file.
5.Try to apply this refactoring script.
6.Watch it fail again.
Comment 1 Eclipse Genie CLA 2019-01-03 02:22:30 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Dani Megert CLA 2019-01-03 05:29:50 EST
Still fails.
Comment 3 Eclipse Genie CLA 2020-12-24 13:50:32 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Eclipse Genie CLA 2023-02-23 17:38:16 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.