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 255649 - Renaming class and also the file causes file no longer valid error
Summary: Renaming class and also the file causes file no longer valid error
Status: REOPENED
Alias: None
Product: php
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 8.0.2
Hardware: PC Windows 8.1
: P3 normal with 1 vote (vote)
Assignee: Tomas Mysik
URL:
Keywords:
: 252779 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-10-02 06:35 UTC by gameshas
Modified: 2017-06-21 12:39 UTC (History)
2 users (show)

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 gameshas 2015-10-02 06:35:31 UTC
if you rename a class and also select an option to rename the file as well, first the file rename is performed and then netbeans tries to find the old file to rename the class but fails and produces an error that the file is no longer valid.

Example class UserAliasValidatorTest {} in file UserAliasValidatorTest.php

rename the class to AliasValidatorTest and also check "[X] Rename also file with Declaration"
Imediatelly you get this error:
the file .../AliasValidatorTest.php seams no longer valid!

i see that the file was renamed it is now "AliasValidatorTest.php", but the class name inside is still "UserAliasValidatorTest".

This started happening after 8.0.1
Comment 1 Tomas Mysik 2016-06-03 06:56:31 UTC
Works for me in the dev version of NetBeans without any problem. Could you please verify it [1]?

Thanks.
[1] http://bits.netbeans.org/download/trunk/nightly/latest/

Product Version: NetBeans IDE Dev (Build 20160602-eb3cfce69024)
Java: 1.8.0_91; Java HotSpot(TM) 64-Bit Server VM 25.91-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_91-b14
System: Linux version 4.2.0-36-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 2 gameshas 2016-06-03 08:55:12 UTC
works for me too, tested on:

Product Version: NetBeans IDE Dev (Build 201606030002)
Java: 1.8.0_60; Java HotSpot(TM) 64-Bit Server VM 25.60-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_60-b27

But does not work on v8.1:
Product Version: NetBeans IDE 8.1 (Build 201510222201)
Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1
Java: 1.8.0_73; Java HotSpot(TM) 64-Bit Server VM 25.73-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_73-b02
Comment 3 Tomas Mysik 2016-06-03 09:28:17 UTC
Thanks for your verification! If you need this functionality, please use dev version of NetBeans.

Thanks.
Comment 4 Tomas Mysik 2016-06-07 14:49:32 UTC
*** Bug 252779 has been marked as a duplicate of this bug. ***
Comment 5 rahuijts 2017-06-21 12:12:34 UTC
Does not work in NetBeans IDE 8.2 (Build 201609300101) which was the target milestone for this bug.

The file is renamed and then the operation fails with the error message "The file [path/to/NewClassName.php] seems no longer valid!". The class and references to it are not refactored. After this operation, Undo stops working.

This happens most of the time, but not always. It is weird that it complains about the new filename not being valid, because renaming the file to that new name is the only thing that succeeds in this operation.

My files are on a local SSD, no remote/network disk stuff is involved. I saved all files before starting the operation. None of the files are open in other programs. Is there any other information I can supply to help solve this?