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 210787 - java.io.FileNotFoundException: FileObject C:\Users\Mark\Documents\NetBeansProjects\MouseEvents\src\NewJApplet.form@6f0c16a7:1e38061[invalid] is not valid.
Summary: java.io.FileNotFoundException: FileObject C:\Users\Mark\Documents\NetBeansPro...
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.2
Hardware: All All
: P2 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-05 23:53 UTC by MackSix
Modified: 2012-04-06 14:51 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 185150


Attachments
stacktrace (4.19 KB, text/plain)
2012-04-05 23:53 UTC, MackSix
Details
stacktrace (4.19 KB, text/plain)
2012-04-06 00:02 UTC, MackSix
Details
Project to use for reproduction. (17.34 KB, application/zip)
2012-04-06 01:31 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2012-04-05 23:53:52 UTC
Build: NetBeans IDE Dev (Build 201204040400)
VM: Java HotSpot(TM) Client VM, 22.1-b02, Java(TM) SE Runtime Environment, 1.7.0_03-b05
OS: Windows Vista

User Comments:
MackSix: Did an Undo and then a Redo and this happened.

GUEST: Tried to rename a class




Stacktrace: 
java.io.FileNotFoundException: FileObject C:\Users\Mark\Documents\NetBeansProjects\MouseEvents\src\NewJApplet.form@6f0c16a7:1e38061[invalid] is not valid.
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getInputStream(FileObj.java:166)
   at org.netbeans.modules.refactoring.spi.BackupFacility$DefaultImpl.copy(BackupFacility.java:274)
   at org.netbeans.modules.refactoring.spi.BackupFacility$DefaultImpl.backup(BackupFacility.java:213)
   at org.netbeans.modules.refactoring.spi.BackupFacility$DefaultImpl.backup(BackupFacility.java:199)
   at org.netbeans.modules.form.refactoring.FormRefactoringUpdate.saveForUndo(FormRefactoringUpdate.java:627)
   at org.netbeans.modules.form.refactoring.FormRefactoringUpdate.saveFormForUndo(FormRefactoringUpdate.java:576)
Comment 1 MackSix 2012-04-05 23:53:57 UTC
Created attachment 117911 [details]
stacktrace
Comment 2 MackSix 2012-04-06 00:02:22 UTC
Created attachment 117912 [details]
stacktrace

Redo Safe File Delete.
Comment 3 MackSix 2012-04-06 01:31:56 UTC
Created attachment 117913 [details]
Project to use for reproduction.

1.) Run NetBeans
2.) Open attached project.
3.) Create new JFrame.
4.) Safely Delete JFrame from with Refactoring.
5.) Ensure focus is on Projects Widow by clicking on Project name.
6.) Click the Undo Button on toolbar and click Yes on dialog.
7.) Focus should still be on Projects window. Click the Redo Button on toolbar and click Yes on dialog.

This FileNotFound Exception is thrown.

8.) Cancel Exception Reporter.
9.) Focus should still be on Projects Window. Click Undo Button on toolbar and click Yes on dialog.

JFrame form comes back, but .form file is missing.

Product Version: NetBeans IDE Dev (Build 201204050400)
Java: 1.7.0_03; Java HotSpot(TM) Client VM 22.1-b02
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
Comment 4 MackSix 2012-04-06 01:35:04 UTC
If Undo/Redo is available in this case, it should reliably recover safely deleted files. This is dangerous and no workaround so I would say this is a P1.
Comment 5 Jan Becicka 2012-04-06 06:25:29 UTC
Also reproducible in 7.1.
If you do Safe Delete / Undo / Redo you end up with deleted file. So I don't think, that this is P1.
Comment 6 Jan Becicka 2012-04-06 06:32:45 UTC
FormRefactoringUpdate passes invalid fileObject to BackupFacility
Comment 7 Jan Stola 2012-04-06 14:51:04 UTC
Fixed - trying to keep the corresponding dataObject/fileObject up-to-date during undo/redo of form removal.

Modified file: http://hg.netbeans.org/jet-main/rev/65cbf9da542f