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 249122 - AssertionError: Tried to set a selected component that was not in the array of open components. ToSelect: org.netbeans.modules.git.ui.diff.DiffTopComponent[PaymentController.java [ Diff ],0,0,891x597
Summary: AssertionError: Tried to set a selected component that was not in the array ...
Status: REOPENED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Stanislav Aubrecht
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-04 18:40 UTC by athompson
Modified: 2017-05-22 12:49 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 213916


Attachments
stacktrace (4.17 KB, text/plain)
2014-12-04 18:40 UTC, athompson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description athompson 2014-12-04 18:40:34 UTC
Build: NetBeans IDE Dev (Build 201411300001)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.25-b02, Java(TM) SE Runtime Environment, 1.8.0_25-b17
OS: Mac OS X

User Comments:
athompson: trying to report another exception




Stacktrace: 
java.lang.AssertionError: Tried to set a selected component that was  not in the array of open components. ToSelect: org.netbeans.modules.git.ui.diff.DiffTopComponent[PaymentController.java [ Diff ],0,0,891x597,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=352,maximumSize=,minimumSize=,preferredSize=] ToSelectName=null ToSelectClass=class org.netbeans.modules.git.ui.diff.DiffTopComponent open components: [MVCTC[name=package.json, peer=[model=current=org.netbeans.core.spi.multiview.MultiViewFactory$MapMVD@1d433149]], MVCTC[name=index.html, peer=[model=current=org.netbeans.core.spi.multiview.MultiViewFactory$MapMVD@15af84e1]], MVCTC[name=services.js, peer=[model=current=org.netbeans.core.spi.multiview.MultiViewFactory$MapMVD@534b3319]], MVCTC[name=index.html, peer=[model=current=org.netbeans.core.spi.multiview.MultiViewFactory$MapMVD@1209189c]], MVCTC[name=invoice.html, peer=[model=current=org.netbeans.core.spi.multiview.MultiViewFactory$MapMVD@74a7256d]], MVCTC[name=main.js, peer=[mo
   at org.netbeans.core.windows.view.ui.tabcontrol.AbstractTabbedImpl.setTopComponents(AbstractTabbedImpl.java:224)
   at org.netbeans.core.windows.view.ui.TabbedHandler.setTopComponents(TabbedHandler.java:168)
   at org.netbeans.core.windows.view.ui.AbstractModeContainer.setTopComponents(AbstractModeContainer.java:126)
   at org.netbeans.core.windows.view.ModeView.setTopComponents(ModeView.java:138)
   at org.netbeans.core.windows.view.ViewHierarchy.updateViewForAccessor(ViewHierarchy.java:283)
   at org.netbeans.core.windows.view.ViewHierarchy.updateViewForAccessor(ViewHierarchy.java:270)
Comment 1 athompson 2014-12-04 18:40:35 UTC
Created attachment 150890 [details]
stacktrace
Comment 2 Stanislav Aubrecht 2014-12-05 09:10:40 UTC
There are many exceptions in the attached log file so the latest one reported here is probably just a side-effect of some earlier exception.
Please provide some steps to reproduce (with a clean user dir) and reopen, thanks.
Comment 3 athompson 2014-12-10 16:33:26 UTC
Yeah, IIRC there was an OOME as well. Hasn't happened again. Can you verify an incomplete bug?
Comment 4 Stanislav Aubrecht 2014-12-10 16:36:42 UTC
(In reply to athompson from comment #3)
> Yeah, IIRC there was an OOME as well. Hasn't happened again. Can you verify
> an incomplete bug?

You can reopen and then close/verify. Or just leave it as incomplete.
Comment 5 arsi_sk 2017-05-22 12:49:54 UTC
I have the same problem, it happens randomly and I find that the problem is here:

From change event of Windows2Local/Components/AlarmEditorTopComponent.settings is called PersistenceManager.removeTopComponentForDataObject(DataObject dob) 
and  dob.getCookie(InstanceCookie.class) returns null  it deletes the topcomponent from the registry. 
Subsequently PersistenceManager.getTopComponentPersistentForID creates a new instance. AbstractTabbedImpl.setTopComponents then compares  different instances of same topcomponent and run into AssertionError

I added to PersistenceManager.removeTopComponentForDataObject(DataObject dob) 

InstanceCookie ic = dob.getCookie(InstanceCookie.class);
InstanceCookie ic2 = dob.getLookup().lookup(InstanceCookie.class);
 and the result is an interesting..

ic = null
ic2=InstanceDataObject@342c4b0e[MultiFileObject@73b8337e[Windows2Local/Components/AlarmEditorTopComponent.settings