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 137078 - FileNotFoundException when removing a project
Summary: FileNotFoundException when removing a project
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: mslama
URL:
Keywords:
: 38889 103215 158342 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-12 08:35 UTC by Jaromir Uhrik
Modified: 2009-06-30 17:36 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot attached... (26.28 KB, image/png)
2008-06-12 08:37 UTC, Jaromir Uhrik
Details
messages.log attached... (38.76 KB, text/plain)
2008-06-12 12:17 UTC, Jaromir Uhrik
Details
Log (13.08 KB, text/plain)
2008-06-19 17:10 UTC, mslama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaromir Uhrik 2008-06-12 08:35:38 UTC
Product Version: NetBeans IDE Dev (Build 200806111204)
Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b04
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)

Steps to reproduce:
-create j2se project
-type something into the Main class
-save the Main class
-open local history for the Main class
-delete project
-->>the local history tab stays in the editor even when switching to the tab the warning dialog appears - see attached
screenshot
Comment 1 Jaromir Uhrik 2008-06-12 08:37:57 UTC
Created attachment 62723 [details]
Screenshot attached...
Comment 2 Jaromir Uhrik 2008-06-12 08:46:21 UTC
Reassign to localhistory component.
Comment 3 Tomas Stupka 2008-06-12 10:05:55 UTC
> Local history stays opened when the project is deleted
1.) speaking for my self - i would sell it as a feature that the LH stays open when the file for which its opened gets
deleted. 

2.) nice screenshot. do you also have a messages.log? i could not reproduce the warning
Comment 4 Jaromir Uhrik 2008-06-12 12:16:28 UTC
1.)Maybe I don't get it what is this feature for. When the project is deleted then I expect that nothing related to this
project is available.
2.)The dialog appears when you switch to e.g. Start Page and then back to the tab with the local history. 100%
reproducible on my Win XP machine.
Comment 5 Jaromir Uhrik 2008-06-12 12:17:38 UTC
Created attachment 62745 [details]
messages.log attached...
Comment 6 Tomas Stupka 2008-06-13 10:36:23 UTC
> 1.)Maybe I don't get it what is this feature for. 
to restore removed files?

> 2.)The dialog appears when you switch to e.g. Start Page and then back to the tab with the local history. 
> 100% reproducible on my Win XP machine.
can't reproduce on linux. could be win specific

the exception comes from org.openide.text reassigning for further evaluation
Comment 7 Jaromir Uhrik 2008-06-13 15:11:09 UTC
Yes, this issue is platform specific - I cannot reproduce on Mac. Removing INOCMPLETE keyword because all required info
was attached.
Comment 8 mslama 2008-06-13 15:57:17 UTC
What do you expect from openide/editor? It tries to reload document but there is no file for it so it throws
FileNotFoundException. I think I have no clue if such exception is important or not ie. if it is result of user action
and can be swallowed as used knows what he does or if it is result of some failure accidental deletion of file.

To me it looks like result of local history which still uses document for deleted file. I think it should be handled in
local history module. IMO CloneableEditor should be released. I can just find out who keeps reference to it and pass it
to owner.
Comment 9 mslama 2008-06-19 16:57:49 UTC
I investigated: diff module listens to document property change and when file is deleted it tried to refresh (reload)
document. It is definitely wrong IMO as it results in FileNotFoundException on Windows. I do not think CloneableEditor
(or DataEditorSupport in this case) can know context and decide if exception should be swallowed or not. If local
history really thinks it is important to show local history of deleted files you should handle this case somehow in diff
module. Easy fix is to close local history for deleted file. I will attach call stack from
CloneableEditorSupport.openDocument.
Comment 10 mslama 2008-06-19 17:09:20 UTC
EditableDiffView loads document twice.
Comment 11 mslama 2008-06-19 17:10:19 UTC
Created attachment 63120 [details]
Log
Comment 12 mslama 2008-06-19 17:15:03 UTC
Note: Ignore first line of attached log. DataEditorSupport log comes after Loading document as it is run asynchronously
in another thread. So first loading is for C:\Documents and Settings\Administrator\My
Documents\NetBeansProjects\JavaApplication5\src\javaapplication5\Main.java (listed below call stack) and second loading
is again for the same file.
Comment 13 Maros Sandor 2008-08-21 11:50:34 UTC
CloneableEditorSupport.loadDocument() should not be popping up error dialogs but rather leave error resolution to its
clients. EditableDiffView is already handling all document loading problems.
Comment 14 mslama 2008-10-13 18:10:24 UTC
Yes. CES.loadDocument(EditorKit, StyledDocument) shows this dialog but it should not. I have to check history why it is
there.
Comment 15 mslama 2008-10-16 11:33:02 UTC
Fixed main #faa6f8b8a24c
Comment 16 Quality Engineering 2008-10-16 15:41:26 UTC
Integrated into 'main-golden', will be available in build *200810161401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/faa6f8b8a24c
User: Marek Slama <mslama@netbeans.org>
Log: #137078: Do not show Warning dialog from CES.loadDocument for IOException.
Comment 17 mslama 2008-10-17 15:29:23 UTC
*** Issue 38889 has been marked as a duplicate of this issue. ***
Comment 18 mslama 2008-10-27 16:51:45 UTC
*** Issue 103215 has been marked as a duplicate of this issue. ***
Comment 19 mslama 2009-03-04 15:55:01 UTC
*** Issue 158342 has been marked as a duplicate of this issue. ***