Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 437556

Summary: Cannot use any refactor that involves renaming a file if workspace is a symlink dir
Product: [Eclipse Project] JDT Reporter: Kat Bradley <kbradley>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, eclipse.sprigogin, kbradley, markus.kell.r
Version: 4.3.1   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard:

Description Kat Bradley CLA 2014-06-16 15:03:12 EDT
Because of the weird project structure used at my workplace (a separate repository for each version), I have my file system set up as follows:

~/code/stable/project/subprojects
~/code/release-x.x/project/subprojects

I have my workspace pointed to a symlink at ~/workspace/project, with individual eclipse projects pointed to ~/workspace/project/subproject.  In this way, if I need to change the working dir from 'project' to 'release-x.x', I update the symlink to point to the desired location, but maintain all of my workspace info, such as the current view and all run/debug configurations.

Overall, this seems to work perfectly, except that I cannot use any refactoring that requires renaming a file.  This applies to ctrl+shift+r to "rename type" (if that operation would rename the file), and right clicking on the file in the navigator and hitting "rename...".  

The error I get is "An exception has been caught while processing the refactoring "Rename Type".  Reason: {new filename}.java [in {project}] does not exist.

This works fine without the symlink, so I'm assuming it's related to that.
Comment 1 Markus Keller CLA 2014-06-18 13:00:14 EDT
Sounds like your workspace is not refreshed after you change the file system contents behind the scenes. You probably want to enable Preferences > General > Workspace > Refresh using native hooks or polling.

Or you have to refresh the affected projects manually (or clear the selection in the Package Explorer and refresh the whole workspace).
Comment 2 Kat Bradley CLA 2014-06-18 13:05:20 EDT
I have the native hooks or polling pref turned on (this workspace setup is nearly unusable without it).  Cleaning and refreshing doesn't fix it.  Also, the error always happens, even if I haven't modified the symlinks since I opened Eclipse.  The fact that it is a symlink at all seems to be what is causing the problem.
Comment 3 Markus Keller CLA 2014-06-18 13:32:36 EDT
Probably caused by bug 338010.
Comment 4 Kat Bradley CLA 2014-06-18 14:07:06 EDT
Would that bug also be the reason that importing a new project that is in a symlink dir results in a project that points to the resolved path of the symlink, not the symlink itself?
Comment 5 Kat Bradley CLA 2014-06-18 14:13:39 EDT
Nevermind, the answer is yes.  That is bug 233019. Sorry, should've looked first.
Comment 6 Dani Megert CLA 2014-07-23 11:34:37 EDT

*** This bug has been marked as a duplicate of bug 233019 ***