Bug 170235 - [search] Move and Rename refactoring throws exception on phantom deleted resource
Summary: [search] Move and Rename refactoring throws exception on phantom deleted reso...
Status: VERIFIED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
: 170272 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-01-11 11:59 EST by Scott Dybiec CLA
Modified: 2008-02-04 11:53 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 Scott Dybiec CLA 2007-01-11 11:59:31 EST
Build ID: M20060921-0945

Steps To Reproduce:
Here's how I can reproduce the problem in my workspace. I've done it several times now:

1. Copy a package and its included classes from project A to project B
2. Delete a class in project A from the copied package.
2. Refactor (move or rename) the copied package in Project B
3. Refactoring error dialog thrown: "An unexpected exception occurred while performing the refactoring. See the error log for more details. Reason: Resource /RW Model Edit/com/humanfactor/rw/menucontributions/IMenuContributionsProvider.class does not exist.

For some reason it is still expecting the .class file to be in the runtime directory, even though the corresponding .java file has been deleted and the the project recompiled.

More information:
Stack Trace from the error log after attempting a rename:

!ENTRY org.eclipse.ltk.ui.refactoring 4 10000 2007-01-11 11:19:34.406
!MESSAGE Internal Error
!STACK 1
Java Model Exception: Core Exception [code 368] Resource /RW Model Edit/runtime/com/humanfactor/rw/menucontributions/IMenuContributionsProvider.class does not exist.
	at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine.internalSearch(RefactoringSearchEngine.java:147)
	at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine.search(RefactoringSearchEngine.java:113)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor$PackageRenamer.getReferences(RenamePackageProcessor.java:548)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor$PackageRenamer.doRename(RenamePackageProcessor.java:518)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor.doCheckFinalConditions(RenamePackageProcessor.java:300)
	at org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor.checkFinalConditions(JavaRenameProcessor.java:46)
	at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:175)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:118)
	at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:189)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource /RW Model Edit/runtime/com/humanfactor/rw/menucontributions/IMenuContributionsProvider.class does not exist.
	at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:311)
	at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:187)
	at org.eclipse.core.internal.resources.File.getContents(File.java:288)
	at org.eclipse.jdt.internal.core.util.Util.newClassFileReader(Util.java:1390)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.getBinaryInfo(MatchLocator.java:784)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:1510)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1033)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1074)
	at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1180)
	at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:94)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:212)
	at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:490)
	at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:538)
	at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine.internalSearch(RefactoringSearchEngine.java:145)
	at org.eclipse.jdt.internal.corext.refactoring.RefactoringSearchEngine.search(RefactoringSearchEngine.java:113)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor$PackageRenamer.getReferences(RenamePackageProcessor.java:548)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor$PackageRenamer.doRename(RenamePackageProcessor.java:518)
	at org.eclipse.jdt.internal.corext.refactoring.rename.RenamePackageProcessor.doCheckFinalConditions(RenamePackageProcessor.java:300)
	at org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor.checkFinalConditions(JavaRenameProcessor.java:46)
	at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:175)
	at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:83)
	at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:118)
	at org.eclipse.ltk.core.refactoring.PerformChangeOperation.run(PerformChangeOperation.java:189)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1737)
	at org.eclipse.ltk.internal.ui.refactoring.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:87)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
!SUBENTRY 1 org.eclipse.core.resources 4 368 2007-01-11 11:19:34.406
!MESSAGE Resource /RW Model Edit/runtime/com/humanfactor/rw/menucontributions/IMenuContributionsProvider.class does not exist.
Comment 1 Olivier Thomann CLA 2007-01-11 14:00:54 EST
Move to JDT/UI
Comment 2 Olivier Thomann CLA 2007-01-11 21:31:05 EST
*** Bug 170272 has been marked as a duplicate of this bug. ***
Comment 3 Markus Keller CLA 2007-02-05 08:19:44 EST
The nested exception ("Caused by: ...") happens inside SearchEngine.search(..).
Comment 4 Frederic Fusier CLA 2008-01-08 07:55:38 EST
Strictly following your scenario, I cannot reproduce neither with 3.2 nor with 3.2.2 and 3.4M4. Is there any other specific set-up in your workspace/projects?
Can you reproduce following your scenario in a brand new wksp?
Comment 5 Scott Dybiec CLA 2008-01-08 09:42:18 EST
My solution to the problem was to recreate my workspace, importing projects one at a time to a new workspace until I found the project causing the problem. I carefully rebuilt that project creating the project by hand and importing it's components piecemeal. 

Never did figure out why the problem occurred in the first place, but I'm up and running on 3.3 right now.
Comment 6 Frederic Fusier CLA 2008-01-08 12:36:13 EST
Thanks for your feedback, so close as WORKSFORME for now. Please reopen if you get a similar issue using 3.3.
Comment 7 David Audel CLA 2008-02-04 11:53:11 EST
Verified for 3.4M5 using build I20080204-0010.