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 228474 - Extract interface dialog does not warn when file with different casing is about to be overwritten
Summary: Extract interface dialog does not warn when file with different casing is abo...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.3
Hardware: PC Windows Vista
: P1 normal (vote)
Assignee: Ralph Ruijs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-11 10:37 UTC by Chiana
Modified: 2013-04-22 02:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chiana 2013-04-11 10:37:17 UTC
When using the "Extrace interface" refactoring it is possible to overwrite an existing file without warning, my guess this is a windows-only problem and related to CamelCasing.

Here is how to reproduce;

Create a project of any Java type.
Create a first class, for sake of easiness name it : "NewJavaClass"
Introduce a method of some kind, it does not need to do anything sensible at this moment.
Save the file.
Right-click the source in the project tree and select "Refactor->Extract interface"
Now, type the new class name "NewJavaclass" (lowercase in "class") and you can note that it does not give any warning about existing file(!).
Now, press "Finish" and it will overwrite "NewJavaClass".
IMHO there should have been a warning issued that "NewJavaclass" already existed.
Comment 1 Chiana 2013-04-11 10:58:27 UTC
I have found out that this sometimes result in that the new class (the interface) does not get created and that sometimes it gets overwritten, have so far not been able to determine the different cases.
Comment 2 Chiana 2013-04-11 13:25:55 UTC
I just come to think about it, it does not matter what the endresult is, the problem is the missing warning in the Extract interface dialog. Altering bug description to reflect.
Comment 3 Ralph Ruijs 2013-04-21 04:29:25 UTC
changeset   : c8c5a1e625fc
author      : Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
date        : Sat Apr 20 23:20:23 CEST 2013
summary     : #228474 - Extract interface dialog does not warn when file with different casing is about to be overwritten
Comment 4 Quality Engineering 2013-04-22 02:03:05 UTC
Integrated into 'main-golden', will be available in build *201304212301* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/c8c5a1e625fc
User: Ralph Benjamin Ruijs <ralphbenjamin@netbeans.org>
Log: #228474 - Extract interface dialog does not warn when file with different casing is about to be overwritten