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.
Build: NetBeans IDE 6.1 RC1 (Build 200804100130) VM: Java HotSpot(TM) Client VM, 10.0-b19, Java(TM) SE Runtime Environment, 1.6.0_05-b13 OS: Windows XP, 5.1, x86 User Comments:
Created attachment 60232 [details] stacktrace
Probably caused by synchronization defiencies in xml.multiview. It is a bit risky area, so I'll look at this post 6.5.
Marking it to future-later
NetBeans.org Migration: changing resolution from LATER to WONTFIX
The exception reports are now reappearing, so reopening.
Created attachment 118300 [details] proposed patch
On the affected line, the "encodingHelper" can't be null, so the problem has to lie in "getStringData()" method. Method loadData seems to be initializing buffer to at least empty string in all cases except the one, where fileTime can equal to last modified time of the file. But in cases when file is missing or IO troubles happens during getting modification time, it can be zero and the buffer stays uninitialized which can lead to NPE.
Created attachment 118305 [details] patch v2 I changed the patch a little bit to cover also the situation with IO error.
Svato please, could you take a look on the last attached patch? Finally I tried to involve also situation of IO troubles although all stacktraces I saw are only fileDeleted event related.
What about similar change to reloadData(), which also tries to avoid reloads on file changes ?
Firstly, thanks Svata for looking on the patch... (In reply to comment #10) > What about similar change to reloadData(), which also tries to avoid reloads on > file changes ? Actually I didn't understand if you mean similar change to reloadData instead of loadData or change also into reloadData. Anyway I'll try to explain why I would stay just with the change I already provided: If I'm not missing anything fix into loadData is needed since it's first place called in xml multiview from current stacktraces. And about the reloadData() - it looks to me that it doesn't initialize anything so in cases when the modification time would be zero it ends, there is no initialization code further - at least it looks to me so. What do you think?
I see - sorry, my mistake. Please proceed with the patch, thanks.
Thanks a lot Svata for your time and review of the patch. Patch applied in web-main #2475c2ea6686.
Integrated into 'main-golden', will be available in build *201204181547* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/2475c2ea6686 User: Martin Fousek <marfous@netbeans.org> Log: #132922 - NullPointerException at org.netbeans.modules.xml.multiview.XmlMultiViewDataObject$DataCache.createInputStream
*** Bug 211910 has been marked as a duplicate of this bug. ***