Page 1 of 1

Exception while calling ro.sync.exml.workspace.api.results ResultsManager#removeResult()

Posted: Mon Mar 30, 2020 1:29 pm
by gmiddell
While removing custom results via

ro.sync.exml.workspace.api.results ResultsManager#removeResult(String, DocumentPositionedInfo),

https://www.oxygenxml.com/InstData/Edit ... ionedInfo-

Oxygen (Version: 20.1, build 2020010914) sometimes throws an exception with the application freezing afterwards:

Code: Select all

[ AWT-EventQueue-0 ]  -  java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 10
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 10
	at java.util.Vector.get(Vector.java:751)
	at ro.sync.exml.editor.results.l.getValueAt(Unknown Source)
	at ro.sync.ui.table.group.d.h(Unknown Source)
	at ro.sync.ui.treetable.e.getValueAt(Unknown Source)
	at ro.sync.ui.table.group.l.b(Unknown Source)
	at ro.sync.ui.table.b.h.getCellRect(Unknown Source)
	at javax.swing.plaf.basic.BasicTableUI.createTableSize(BasicTableUI.java:1694)
	at javax.swing.plaf.basic.BasicTableUI.getPreferredSize(BasicTableUI.java:1733)
	at ro.sync.ui.application.db.getPreferredSize(Unknown Source)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1662)
	at ro.sync.ui.treetable.ApplicationTreeTable.getPreferredSize(Unknown Source)
	at javax.swing.ViewportLayout.layoutContainer(ViewportLayout.java:141)
	at java.awt.Container.layout(Container.java:1513)
	at java.awt.Container.doLayout(Container.java:1502)
	at java.awt.Container.validateTree(Container.java:1698)
	at java.awt.Container.validateTree(Container.java:1707)
	at java.awt.Container.validate(Container.java:1633)
	at javax.swing.JViewport.validateView(JViewport.java:482)
	at javax.swing.JViewport.scrollRectToVisible(JViewport.java:393)
	at javax.swing.JComponent.scrollRectToVisible(JComponent.java:3111)
	at ro.sync.ui.application.ApplicationTable.scrollRectToVisible(Unknown Source)
	at ro.sync.ui.treetable.ApplicationTreeTable.scrollPathsToVisible(Unknown Source)
	at ro.sync.ui.treetable.ApplicationTreeTable$7.run(Unknown Source)
	at ro.sync.ui.le$1.run(Unknown Source)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
	at ro.sync.ui.le.m(Unknown Source)
	at ro.sync.ui.le.n(Unknown Source)
	at ro.sync.ui.treetable.ApplicationTreeTable.setSelectionPaths(Unknown Source)
	at ro.sync.ui.table.group.t.mtn(Unknown Source)
	at ro.sync.ui.table.group.d.vc(Unknown Source)
	at ro.sync.ui.table.group.d.gc(Unknown Source)
	at ro.sync.ui.table.group.d.nc(Unknown Source)
	at ro.sync.ui.table.group.d$1.tableChanged(Unknown Source)
	at javax.swing.table.AbstractTableModel.fireTableChanged(AbstractTableModel.java:296)
	at javax.swing.table.AbstractTableModel.fireTableRowsDeleted(AbstractTableModel.java:261)
	at ro.sync.exml.editor.results.l.p(Unknown Source)
	at ro.sync.exml.editor.results.t.vit(Unknown Source)
	at ro.sync.exml.editor.results.f.removeResult(Unknown Source)
	at ro.sync.exml.workspace.b.e.b.removeResult(Unknown Source)
	[…]
Does anybody have an idea, what could be the cause of this error? I am not calling the method on the event dispatcher thread. Could this be the issue?

Thanks,
Gregor

Re: Exception while calling ro.sync.exml.workspace.api.results ResultsManager#removeResult()

Posted: Mon Mar 30, 2020 2:12 pm
by Radu
Hi Gregor,

Our components are not thread safe so try to call all additions or removal of content from the results list on the AWT thread using something like SwingUtilities.invokeLater(Runnable). I cannot guarantee this is the problem, so if it happens again please give us more details, maybe some small code samples about how you add and remove those documentpositioninfo elements.

Regards,
Radu