Bug 7932 - Moving a class with checked Update references fails
Summary: Moving a class with checked Update references fails
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Adam Kiezun CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-01-21 09:34 EST by Martin Möbius CLA
Modified: 2002-01-28 06:03 EST (History)
0 users

See Also:


Attachments
Best is to import it into a new project. My name ClassMove (2.49 KB, application/octet-stream)
2002-01-25 03:22 EST, Martin Möbius CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Möbius CLA 2002-01-21 09:34:52 EST
Version 20020115, java perspective

Right clkick class, choose Move.., choose other package, check Update 
references to...,
Internal Error appears, stacktrace

4 org.eclipse.jdt.ui 1 Internal Error
org.eclipse.jdt.core.JavaModelException[966]: Java Model Exception: Java Model 
Status [Operation requires one or more elements.]
	at 
org.eclipse.jdt.internal.corext.textmanipulation.TextBufferEditor.performEdits
(TextBufferEditor.java:166)
	at 
org.eclipse.jdt.internal.corext.refactoring.changes.TextChange.getPreviewContent
(TextChange.java:164)
	at 
org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.getCompareInput
(PreviewWizardPage.java:201)
	at 
org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.getPreviewer
(PreviewWizardPage.java:254)
	at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.showPreview
(PreviewWizardPage.java:374)
	at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.access$1
(PreviewWizardPage.java:372)
	at 
org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage$2.selectionChanged
(PreviewWizardPage.java:363)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged
(Viewer.java:147)
	at org.eclipse.jface.viewers.StructuredViewer.updateSelection
(StructuredViewer.java:999)
	at org.eclipse.jface.viewers.StructuredViewer.setSelection
(StructuredViewer.java:758)
	at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:342)
	at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.setVisible
(PreviewWizardPage.java:328)
	at org.eclipse.jface.wizard.WizardDialog.showStartingPage
(WizardDialog.java:906)
	at org.eclipse.jface.wizard.WizardDialog.createContents
(WizardDialog.java:458)
	at org.eclipse.jface.window.Window.create(Window.java:237)
	at org.eclipse.jface.window.Window.open(Window.java:510)
	at org.eclipse.jdt.internal.ui.reorg.MoveAction.doReorg
(MoveAction.java:176)
	at org.eclipse.jdt.internal.ui.reorg.ReorgDestinationAction.run
(ReorgDestinationAction.java:104)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:452)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:74)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1413)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1205)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:822)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:805)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:878)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:321)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:151)
	at org.eclipse.core.launcher.Main.run(Main.java:502)
	at org.eclipse.core.launcher.Main.main(Main.java:362)
	4 org.eclipse.jdt.core 966 Core exception: Operation requires one or 
more elements.
Java Model Exception: Java Model Status [Operation requires one or more 
elements.]
	at 
org.eclipse.jdt.internal.corext.textmanipulation.TextBufferEditor.performEdits
(TextBufferEditor.java:166)
	at 
org.eclipse.jdt.internal.corext.refactoring.changes.TextChange.getPreviewContent
(TextChange.java:164)
	at 
org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.getCompareInput
(PreviewWizardPage.java:201)
	at 
org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.getPreviewer
(PreviewWizardPage.java:254)
	at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.showPreview
(PreviewWizardPage.java:374)
	at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.access$1
(PreviewWizardPage.java:372)
	at 
org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage$2.selectionChanged
(PreviewWizardPage.java:363)
	at org.eclipse.jface.viewers.Viewer.fireSelectionChanged
(Viewer.java:147)
	at org.eclipse.jface.viewers.StructuredViewer.updateSelection
(StructuredViewer.java:999)
	at org.eclipse.jface.viewers.StructuredViewer.setSelection
(StructuredViewer.java:758)
	at org.eclipse.jface.viewers.Viewer.setSelection(Viewer.java:342)
	at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.setVisible
(PreviewWizardPage.java:328)
	at org.eclipse.jface.wizard.WizardDialog.showStartingPage
(WizardDialog.java:906)
	at org.eclipse.jface.wizard.WizardDialog.createContents
(WizardDialog.java:458)
	at org.eclipse.jface.window.Window.create(Window.java:237)
	at org.eclipse.jface.window.Window.open(Window.java:510)
	at org.eclipse.jdt.internal.ui.reorg.MoveAction.doReorg
(MoveAction.java:176)
	at org.eclipse.jdt.internal.ui.reorg.ReorgDestinationAction.run
(ReorgDestinationAction.java:104)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:452)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:74)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1413)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1205)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:822)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:805)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:878)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:321)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:151)
	at org.eclipse.core.launcher.Main.run(Main.java:502)
	at org.eclipse.core.launcher.Main.main(Main.java:362)
		4 org.eclipse.jdt.core 968 Operation requires one or more 
elements.
Comment 1 Dirk Baeumer CLA 2002-01-24 04:41:10 EST
Adam please have a look at this. I think the generated text edits aren't correct
Comment 2 Adam Kiezun CLA 2002-01-24 11:38:01 EST
i cannot reproduce it on 20020123
can you provide more specific steps 
(best would be if you could come up with a test case - like a set of .java 
files that causes this to happen)
Comment 3 Martin Möbius CLA 2002-01-25 03:22:36 EST
Created attachment 263 [details]
Best is to import it into a new project. My name ClassMove
Comment 4 Martin Möbius CLA 2002-01-25 03:28:07 EST
Oops bugzilla removed my comments. Here again.
Couldn't verify bug in 20020123. Testcase if for 0115. Moving Test2 to package 
a.b should come up with an error.

It's another stacktrace than before. This stacktrace is from another class 
moving. Just to prove, if testcase fails.

org.eclipse.jdt.internal.ui.JavaUIException: Status
	at org.eclipse.jdt.internal.ui.reorg.ReorgDestinationAction.doReorg
(ReorgDestinationAction.java:146)
	at org.eclipse.jdt.internal.ui.reorg.MoveAction.doReorg
(MoveAction.java:171)
	at org.eclipse.jdt.internal.ui.reorg.ReorgDestinationAction.run
(ReorgDestinationAction.java:104)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:452)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:407)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent
(ActionContributionItem.java:361)
	at org.eclipse.jface.action.ActionContributionItem.access$0
(ActionContributionItem.java:352)
	at 
org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent
(ActionContributionItem.java:47)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:74)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1413)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1205)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:822)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:805)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:878)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:321)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:151)
	at org.eclipse.core.launcher.Main.run(Main.java:502)
	at org.eclipse.core.launcher.Main.main(Main.java:362)
	4 org.eclipse.jdt.ui 0 Status
		2=============<children>=============
		4 org.eclipse.jdt.core 968 Operation requires one or more 
elements.
		4 org.eclipse.jdt.core 968 Operation requires one or more 
elements.
		4 org.eclipse.jdt.core 968 Operation requires one or more 
elements.
		4 org.eclipse.jdt.core 968 Operation requires one or more 
elements.
		2=============</children>=============
Comment 5 Adam Kiezun CLA 2002-01-28 06:03:46 EST
cannot reproduce anymore on 20020125
closing - please reopen if you see it again
resolving as fixed - it was fixed some time ago as another bug report 
(don't remember the number though)