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 150432

Summary: Bundle file is not possible to save after refactoring
Product: utilities Reporter: Jana Maleckova <janie>
Component: PropertiesAssignee: Alexey Butenko <alexeybutenko>
Status: VERIFIED FIXED    
Severity: blocker CC: mmirilovic, mslama, pribyl, sustaining
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 150818    
Attachments: 150432

Description Jana Maleckova 2008-10-16 19:38:33 UTC
Product Version: NetBeans IDE Dev (Build 20081016162902)
Java: 1.6.0_10-rc2; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)

Description:
============
have j2se project with jFrame in some package
1. insert some components into jFrame
2. switch on auto i18n
3. save all files
4. rename the package with jFrame
5. insert another component into jFrame
6. do Save All files -> warning like Bundle file was modified externally

StackTrace:
===========
INFO
org.openide.text.CloneableEditorSupport$4: File C:\Documents and Settings\Admin\My
Documents\NetBeansProjects\JavaApplication15\src\newpackage66\Bundle.properties was modified externally. Overwrite it?
	at org.openide.text.CloneableEditorSupport.saveDocument(CloneableEditorSupport.java:899)
	at org.netbeans.modules.properties.PropertiesEditorSupport.saveThisEntry(PropertiesEditorSupport.java:527)
	at org.netbeans.modules.properties.PropertiesEditorSupport.access$600(PropertiesEditorSupport.java:125)
	at org.netbeans.modules.properties.PropertiesEditorSupport$Environment.save(PropertiesEditorSupport.java:876)
	at org.netbeans.modules.properties.PropertiesOpen$ModifiedListener.saveDocument(PropertiesOpen.java:544)
	at org.netbeans.modules.properties.PropertiesOpen$ModifiedListener.save(PropertiesOpen.java:526)
[catch] at org.netbeans.modules.i18n.form.I18nServiceImpl.autoSave(I18nServiceImpl.java:425)
Comment 1 Jana Maleckova 2008-10-16 19:40:02 UTC
Created attachment 72031 [details]
150432
Comment 2 Jana Maleckova 2008-10-17 09:48:01 UTC
more significant in Java Desktop Application project where resource management is switched on as default
Comment 3 mslama 2008-10-20 14:04:25 UTC
See fixes for issues #149330, #149152, #149069, #149330.
34e0ffc99ff3
afe07db1345a
09c8d6bb50aa

There was change to use actual file time instead of System.currentTimeMillis. Also there added extra property to notify
change between CloneableEditorSupport and DataEditorSupport.
Comment 4 mslama 2008-10-20 16:06:59 UTC
Fix should be to fire "expectedTime" with new file time when property file is renamed. See DataEditorSupport.
Comment 5 Lukas Hasik 2008-10-24 12:20:57 UTC
copied from 149069
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 6 Marian Petras 2008-11-03 16:51:34 UTC
Thanks for the steps to reproduce.

I will fix it using the "expectedTime" property.
Comment 7 Marian Petras 2008-11-06 12:13:41 UTC
If issue #48263 (task "Do not bundle multiple .properties file into a DataObject") is going to be handled by NB 7.0,
then is not worth fixing this (#150432) bug before.
Comment 8 Jana Maleckova 2008-11-06 12:26:31 UTC
Marian, according to simple reproducible testcase and due to a bad consequences of this bug, this should be really fixed
into 65patch1. Could you look at it once again?
Comment 9 Marian Petras 2008-11-06 12:27:02 UTC
OK, I am going to fix it now.
Comment 10 pgebauer 2008-11-24 09:31:25 UTC
The issue didn't pass the nomination process by nomination cut-off date. It has been marked as 65fixes2-candidate.
Comment 11 Alexey Butenko 2008-12-08 14:34:58 UTC
fixed in trunk
fc6cdd2dd8ac
Comment 12 kaa 2008-12-16 18:39:16 UTC
Product Version: NetBeans IDE Dev (Build 200812150750)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
Comment 13 pslechta 2008-12-16 19:03:31 UTC
The fix was ported into release65_fixes repository.

http://hg.netbeans.org/release65_fixes/rev/674a00727fce
Comment 14 kaa 2009-01-22 16:22:17 UTC
re-verified with 65patch2