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 220672 - NullPointerException at org.openide.text.CloneableEditorSupport.saveDocument, file looses content
Summary: NullPointerException at org.openide.text.CloneableEditorSupport.saveDocument,...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 7.2
Hardware: All All
: P1 normal with 1 vote (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 221500 221905 221906 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-23 12:27 UTC by alexnot
Modified: 2012-11-15 02:46 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 193861


Attachments
stacktrace (1.88 KB, text/plain)
2012-10-23 12:28 UTC, alexnot
Details
stacktrace (5.00 KB, text/plain)
2012-10-25 14:42 UTC, markiewb
Details
stacktrace (6.35 KB, text/plain)
2012-10-27 14:39 UTC, szmitek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alexnot 2012-10-23 12:27:58 UTC
Build: NetBeans IDE 7.2 (Build nbms-and-javadoc-9498-on-20121022)
VM: Java HotSpot(TM) Client VM, 23.0-b21, Java(TM) SE Runtime Environment, 1.7.0_04-b20
OS: Linux

User Comments:
GUEST: creating a test class

GUEST: saving a file




Stacktrace: 
java.lang.NullPointerException
   at org.openide.text.CloneableEditorSupport.saveDocument(CloneableEditorSupport.java:1138)
   at org.openide.text.DataEditorSupport.superSaveDoc(DataEditorSupport.java:606)
   at org.openide.text.DataEditorSupport$SaveImpl.run(DataEditorSupport.java:1309)
   at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:127)
   at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:607)
   at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:603)
Comment 1 alexnot 2012-10-23 12:28:00 UTC
Created attachment 126398 [details]
stacktrace
Comment 2 Exceptions Reporter 2012-10-24 13:15:17 UTC
This bug already has 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=193861
Comment 3 markiewb 2012-10-25 14:42:12 UTC
Created attachment 126553 [details]
stacktrace

Reverting a change in the local history, i tried to save, then the NPE occurs.
Result: File is empty. Data is lost.
Comment 4 szmitek 2012-10-27 14:39:11 UTC
Created attachment 126661 [details]
stacktrace

Run C++ project
Comment 5 Miloslav Metelka 2012-10-28 22:20:45 UTC
This should already be fixed by http://hg.netbeans.org/main-golden/rev/3c90ead1557d
If the problem persists in current dev builds please reopen the issue.
Comment 6 Marian Mirilovic 2012-11-07 08:47:19 UTC
*** Bug 221500 has been marked as a duplicate of this bug. ***
Comment 7 Marian Mirilovic 2012-11-11 21:00:05 UTC
*** Bug 221906 has been marked as a duplicate of this bug. ***
Comment 8 Marian Mirilovic 2012-11-11 21:00:52 UTC
Unfortunately the latest duplicte came from a build 20121111
Comment 9 Marian Mirilovic 2012-11-11 21:05:50 UTC
*** Bug 221905 has been marked as a duplicate of this bug. ***
Comment 10 Miloslav Metelka 2012-11-12 12:40:27 UTC
I still think that this must be caused by an obsolete BeforeSaveTasks class (though I think I've increased spec/impl versions properly). Anyway I have added a safe fallback into CloneableEditorSupport to act like if save actions were not present.
http://hg.netbeans.org/jet-main/rev/3b44327e97ef
Comment 11 Quality Engineering 2012-11-15 02:46:13 UTC
Integrated into 'main-golden', will be available in build *201211150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3b44327e97ef
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #220672 - NullPointerException at org.openide.text.CloneableEditorSupport.saveDocument, file looses content - fallback when saveToMemory runnable not run.