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 Dev (Build 071023) VM: Java HotSpot(TM) Client VM, 1.5.0_12-b04 OS: Linux, 2.6.22-14-generic, i386 User Comments:
Created attachment 51518 [details] stacktrace
Probably a winsys problem. I think this may happen in case you: Start the IDE, open a.java, b.java, keep B selected Shutdown the IDE delete a.java Start the IDE, it would show a.java, [b.java] Exit the IDE. Or in similar case where the IDE learns the fact that file in editor is no longer valid. I have seen this before, IIRC....
I think I simply had created a project, had some files open in it, then deleted it and shut down the IDE. Thrown many times, so I can probably find a reproducible test case if you need one.
Could this be a regression from the fix of issue #101700?
I will look at it.
I do not think it has anything to do with fix of #101700 as reports at are older. Yes some steps to reproduce this would be useful. Anyway I can handle it without reproduction, just to verify fix. Steps from Petr would not work as if you delete file when IDE does not run IDE will not open editor for deleted file - it will throw DataObjectNotFoundException. Probably it is necessary to delete file for open but not selected editor.
1. Run Basic IDE, fresh user dir, JDK 6, Ubuntu. 2. New Java Application in /tmp. 3. Select Projects tab. Select prj root node, Delete. 4. Also Delete Sources..., Yes. 5. Close main window. => WARNING [org.netbeans.core.windows.persistence]: TopComponent Main is not serializable. java.io.NotSerializableException: Serializing component is invalid: org.netbeans.modules.java.JavaDataObject$JavaEditor[Main.java,1,0,838x781,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=256,maximumSize=,minimumSize=,preferredSize=] at org.openide.text.CloneableEditor.writeReplace(CloneableEditor.java:588) [....] at org.openide.loaders.InstanceDataObject.convertorWriteMethod(InstanceDataObject.java:1416) at org.openide.loaders.InstanceDataObject.storeThroughConvertor(InstanceDataObject.java:1403) at org.openide.loaders.InstanceDataObject.storeSettings(InstanceDataObject.java:346) at org.openide.loaders.InstanceDataObject.access$900(InstanceDataObject.java:88) at org.openide.loaders.InstanceDataObject$Creator.run(InstanceDataObject.java:1366) [....] at org.openide.loaders.InstanceDataObject$Creator.createInstanceDataObject(InstanceDataObject.java:1380) at org.openide.loaders.InstanceDataObject.create(InstanceDataObject.java:331) at org.openide.loaders.InstanceDataObject.create(InstanceDataObject.java:307) [catch] at org.netbeans.core.windows.persistence.PersistenceManager.saveTopComponents(PersistenceManager.java:713) at org.netbeans.core.windows.persistence.PersistenceManager.saveWindowSystem(PersistenceManager.java:1101) at org.netbeans.core.windows.PersistenceHandler.save(PersistenceHandler.java:312) at org.netbeans.core.windows.WindowSystemImpl.save(WindowSystemImpl.java:76) [....]
First step is to lower log level of saving TCs from WARNING to INFO. Second step is to avoid saving closed TC when their persistence type is PERSISTENCE_ONLY_OPENED. Change log level: /cvs/core/windows/src/org/netbeans/core/windows/persistence/PersistenceManager.java new revision: 1.49; previous revision: 1.48
When TC is closed it is saved (settings and wstcref) only when it has persistence type PERSISTENT_ALWAYS. It also fixes this problem as when java file is deleted, editor TC is closed and as editor ahs persistence type PERSISTENT_ONLY_OPENED winsys will not try to save editor TC. Modified: /cvs/core/windows/src/org/netbeans/core/windows/PersistenceHandler.java new revision: 1.56; previous revision: 1.55 /cvs/core/windows/src/org/netbeans/core/windows/WindowManagerImpl.java new revision: 1.70; previous revision: 1.69 /cvs/core/windows/src/org/netbeans/core/windows/persistence/PersistenceManager.java new revision: 1.50; previous revision: 1.49