This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 149069 - Redundant external file modifications dialog
Summary: Redundant external file modifications dialog
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-03 14:25 UTC by Tomas Danek
Modified: 2008-12-23 12:55 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
CloneableEditorSupport patch. (4.38 KB, text/plain)
2008-10-06 15:24 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2008-10-03 14:25:11 UTC
Product Version: NetBeans IDE Dev (Build 200810031107)
Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
Userdir: C:\Documents and Settings\uadmin\.netbeans\dev
-----------
- create project on UNC path
- modify the java class, save it
- dialog "File XXX was externaly modifed, do you wish to save it?" appears

..maybe should be assigned to FS?!
Comment 1 Jesse Glick 2008-10-03 16:40:25 UTC
Can't see how this has any relation to the project system. (The very first thing you should check is to save a plain
text file opened from a random UNC location in the Favorites tab, which would rule out any interactions from either Java
infrastructure or the project system.)
Comment 2 Antonin Nebuzelsky 2008-10-06 09:25:05 UTC
reproducible always or random?
Comment 3 Jiri Skrivanek 2008-10-06 09:29:23 UTC
I am not able to reproduce it at all.
Comment 4 Tomas Danek 2008-10-06 11:58:49 UTC
reproducible always on my XP. Just one note: when i do first modification in file and save it, no dialog appears. Second
and every other modification brings up this dialog.
Comment 5 Jiri Skrivanek 2008-10-06 15:22:39 UTC
The problem is that there can be a delay between closing of stream and setting file modification time by OS. Please
review my patch and possibly apply it.
Comment 6 Jiri Skrivanek 2008-10-06 15:24:25 UTC
Created attachment 71214 [details]
CloneableEditorSupport patch.
Comment 7 Jaroslav Tulach 2008-10-06 17:19:01 UTC
*** Issue 149152 has been marked as a duplicate of this issue. ***
Comment 8 Jaroslav Tulach 2008-10-06 17:21:44 UTC
The fix helps. Thanks a lot:

34e0ffc99ff3
Comment 9 Lukas Hasik 2008-10-07 09:36:36 UTC
*** Issue 149330 has been marked as a duplicate of this issue. ***
Comment 10 Quality Engineering 2008-10-08 06:03:29 UTC
Integrated into 'main-golden', will be available in build *200810080201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/34e0ffc99ff3
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #149152 and #149069: Using real time from the file and not System.currentTimeMillis. Patch by jskrivanek@netbeans.org
Comment 11 pribyl 2008-10-17 13:31:14 UTC
Product Version: NetBeans IDE 6.5 RC1 (Build 200810151402)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

I am sorry, but I have to reopen :( I found another steps to reproduce this problem (the external file modifications 
dialog)

1, create new simple J2SE project
2, create new package within this project
3, move Main.java to this new package
4, rename the new package

-> the dialog appears, displaying that Main cannot be saved. From now on it keeps poping up, for example when you try 
to Save All. The only way to get rid of it is to directly save (ctrl+S) Main.java, because only then you have the 
option to confirm that you really want to save it (there are buttons Yes and No, in other cases there is just OK 
button)
Comment 12 Jiri Skrivanek 2008-10-17 13:42:34 UTC
Hopefully fixed with issue 149330. Please, try to reproduce in the latest trunk build.
Comment 13 pribyl 2008-10-17 13:57:28 UTC
You are right, it works without problem in 6.5 RC1 (Build 200810170201)

(I am sorry, I did not realized I tried that on older build)

Setting back to FIXED
Comment 14 pribyl 2008-10-24 11:51:53 UTC
Product Version: NetBeans IDE Dev (Build 200810240201)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

Another approach :( 
Now after moving a .properties file

Steps to reproduce:
1, Create new J2SE project with default setting. 
2, Create a new package
3, In the new package create new JFrame Form and new Properties file with some key and value
4, Use the Properties file in the Form (e.g. use the value from the properties as Form's title)
5, Now move the Properties file to another package, add new key and value (or change it anyhow) and try to save it
-> the well known dialog is here again 

(And agin: when using Ctrl+S, the dialog offers "Yes" and "No" buttons, while using "Save All" there is only "OK" 
button) 
Comment 15 Jiri Skrivanek 2008-10-24 12:03:11 UTC
I believe it is another use case how to reproduce issue 150432. It belongs to properties module.
Comment 16 Tomas Danek 2008-12-23 12:55:25 UTC
cannot reproduce on linux; 20081223