Bug 515697 - Rename Resource - Out of sync should honor Refresh on access
Summary: Rename Resource - Out of sync should honor Refresh on access
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.8 M3   Edit
Assignee: Jonas Hungershausen CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2017-04-24 10:57 EDT by Lars Vogel CLA
Modified: 2020-02-19 02:19 EST (History)
5 users (show)

See Also:


Attachments
Screenshot (11.82 KB, image/png)
2017-04-24 10:57 EDT, Lars Vogel CLA
no flags Details
After the patch (49.40 KB, image/png)
2018-09-21 09:15 EDT, Sarika Sinha CLA
no flags Details
After the patch txt file (29.74 KB, image/png)
2018-09-21 10:45 EDT, Sarika Sinha CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2017-04-24 10:57:08 EDT
Created attachment 267946 [details]
Screenshot

As I also change files outside of Eclipse, I frequently get the "Resource out of sync dialog" with no option to solve that. 

We should add the option to sync automatically on this dialog.

To test:
1.) Change a file in a folder outside of Eclipse
2.) Try to rename the folder which contains the file
-> Dialog without the option to do something
Comment 1 Lars Vogel CLA 2017-04-24 10:57:38 EDT
Patrik, something for you?
Comment 2 Dani Megert CLA 2017-04-24 11:03:43 EDT
Out of the box this should just work since "Refresh on access" is enabled by default. It looks like Rename is not honoring this.

This is either in Platform UI or Platform Resources.
Comment 3 Lars Vogel CLA 2018-08-28 08:03:07 EDT
Jonas, IIRC you suffered from missing auto-refresh in the past. Can you investigate?

Steps:
1.) Find the code which triggers the dialog (easiest way it to start a runtime Eclipse and press the pause button to see the call stack).
2.) Check if preference is set and refresh resource if it is set

Please start with 1.) once you found it, I can help with 2.).
Comment 4 Lars Vogel CLA 2018-08-28 08:04:53 EDT
To reproduce see Comment 0.
Comment 5 Jonas Hungershausen CLA 2018-08-30 03:44:34 EDT
I could find the responsible code:

Package is org.eclipse.ltk.ui.refactoring;
Class RefactoringWizardOpenOperation
And in there on line 175

I don't know where I can find the ltk packages. Any hints?
Comment 6 Lars Vogel CLA 2018-08-30 04:08:19 EDT
(In reply to Jonas Hungershausen from comment #5)
> I could find the responsible code:
> 
> Package is org.eclipse.ltk.ui.refactoring;
> Class RefactoringWizardOpenOperation
> And in there on line 175
> 
> I don't know where I can find the ltk packages. Any hints?

Jdt UI repo
Comment 7 Eclipse Genie CLA 2018-08-30 05:09:24 EDT
New Gerrit change created: https://git.eclipse.org/r/128360
Comment 8 Sarika Sinha CLA 2018-09-21 09:15:20 EDT
Created attachment 275928 [details]
After the patch

I applied the patch and modified the file out of eclipse.
Renamed the package name and got this message, I was expecting that it will either auto synch or give a dialog to perform synch.
Have I missed any thing Lars ?
Comment 9 Lars Vogel CLA 2018-09-21 09:28:00 EDT
(In reply to Sarika Sinha from comment #8)
> Created attachment 275928 [details]
> After the patch
> 
> I applied the patch and modified the file out of eclipse.
> Renamed the package name and got this message, I was expecting that it will
> either auto synch or give a dialog to perform synch.
> Have I missed any thing Lars ?

Or test was with for normal (non Java) files? Can test the case with a regular folder and text file? IIRC Java rename triggers a different code path.
Comment 10 Jonas Hungershausen CLA 2018-09-21 10:17:37 EDT
(In reply to Sarika Sinha from comment #8)
> Created attachment 275928 [details]
> After the patch
> 
> I applied the patch and modified the file out of eclipse.
> Renamed the package name and got this message, I was expecting that it will
> either auto synch or give a dialog to perform synch.
> Have I missed any thing Lars ?

Yes, you will need to test this with non java files in a folder (resources for example). 
Java file renames are not handled by the modified code.
Comment 11 Sarika Sinha CLA 2018-09-21 10:45:45 EDT
Created attachment 275932 [details]
After the patch txt file

I created a folder in a java project and a .txt file under it. I closed the .txt file from editor.I modified the file out of eclipse and tried to rename the folder in Eclipse and got this error dialog.
Comment 12 Lars Vogel CLA 2018-09-28 00:06:13 EDT
(In reply to Sarika Sinha from comment #11)
> Created attachment 275932 [details]
> After the patch txt file
> 
> I created a folder in a java project and a .txt file under it. I closed the
> .txt file from editor.I modified the file out of eclipse and tried to rename
> the folder in Eclipse and got this error dialog.

Jonas, please see if you can reproduce this.
Comment 13 Jonas Hungershausen CLA 2018-10-08 10:15:56 EDT
(In reply to Sarika Sinha from comment #11)
> Created attachment 275932 [details]
> After the patch txt file
> 
> I created a folder in a java project and a .txt file under it. I closed the
> .txt file from editor.I modified the file out of eclipse and tried to rename
> the folder in Eclipse and got this error dialog.

I couldn't reproduce this on ubuntu. Do you, by any chance have time to paste a stacktrace in here? 


My process was with a project named "test":

1. Create text file in the root of the "test" folder.
2. Rename text file to something else (from outside eclipse)
3. Rename the "test" folder to "test12" (from inside eclipse)

Was this what you did?
Comment 14 Sarika Sinha CLA 2018-10-12 05:12:10 EDT
Ok, Looks like some workspace issue. I am not seeing it anymore.

I have provided couple of gerrit comments. After that, it should be good to go.
Comment 16 Sarika Sinha CLA 2018-10-24 23:18:32 EDT
Thanks Lars and Jonas!!
Please verify the fix in the next I build.