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 253591 - Can't rename file with extension .ser
Summary: Can't rename file with extension .ser
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 8.0.2
Hardware: PC Windows 8 x64
: P3 normal (vote)
Assignee: Jaroslav Havlin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-20 17:30 UTC by terje7601
Modified: 2015-10-20 14:34 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sketch of the fix (1.29 KB, patch)
2015-07-21 14:07 UTC, Jaroslav Havlin
Details | Diff
Possible Fix (12.78 KB, patch)
2015-10-20 14:34 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description terje7601 2015-07-20 17:30:46 UTC
To reproduce:
* create a new "Java Application" project
* create an "Empty File" named "fmt.ser"
* right-click the file in the "Projects" view & do "Rename..."
* enter "abc" & click OK
=> the file wasn't renamed, but its Properties show "abc" as its name & doing "Rename..." again shows you "abc" as well
Comment 1 cezariusz 2015-07-20 21:46:28 UTC
Reproduced with:

Product Version: NetBeans IDE Dev (Build 201507040001)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b15
System: Windows 8 version 6.2 running on amd64; UTF-8; pl_PL (nb)
Comment 2 Jaroslav Havlin 2015-07-21 14:02:32 UTC
The problem is that extension .ser is used for "instance" files used by the IDE, so InstanceDataObject is created for them and filesystem operations have some special implementation.

We could modify InstanceLoader to load only .ser files located in system filesystem, it seems that they are not used otherwise in the IDE.
This is an incompatible change, which should be carefully tested, and should be configurable via branding so that platform applications are not affected.

Thank you for reporting.
Comment 3 Jaroslav Havlin 2015-07-21 14:07:38 UTC
Created attachment 154767 [details]
Sketch of the fix

(Pending possibility to configure the behavior.)
Comment 4 Jaroslav Havlin 2015-07-21 14:24:42 UTC
Workaround to rename file "a.ser" to "b.ser":

 - Right-click "a.ser", select "Properties", change Extension to "txt" and click "Close"
 - Right-click "a.txt", select "Rename...", enter "b.ser" and click "OK"
 - Right-click "b.ser", select "Properties", change Name to "b" and click "Close"
   (this is not necessary, the underlying file is already renamed, but it can be confusing in some views)
Comment 5 Jaroslav Havlin 2015-10-20 14:34:34 UTC
Created attachment 156840 [details]
Possible Fix

Patch with support for a property that can switch to original behavior, and updated tests that need to set this property.