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 255122

Summary: Completely separate IO stuff from document's handling when reading/reloading document content from file stream
Product: platform Reporter: Miloslav Metelka <mmetelka>
Component: TextAssignee: Miloslav Metelka <mmetelka>
Status: NEW ---    
Severity: normal CC: vv159170
Priority: P2 Keywords: NO81
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 236761    

Description Miloslav Metelka 2015-09-09 08:34:13 UTC
This is consequence of issue #236439.
On a very slow FS the FileObject.refresh() and reading from a stream can take a considerable time. When document is write-locked during this time the AWT may be waiting on document's readlock so the IDE looks like frozen.

The read and reload operations in o.o.text.DocumentOpenClose should be modified to
1. Perform FO.refresh()
2. Read file content into a String and remember time when the file content was read.
3. Perform Document.runAtomic() and insert the String into the document.

A similar approach should be made for reload but in addition there will be a possibility that the user may type several characters during the reload operations so such situation will have to be handled accordingly.
Comment 1 Miloslav Metelka 2015-09-18 10:43:22 UTC
Issue 236761 (showing dialog for incorrect charset during load) should be possibly be resolved together with this issue.