java - jface/swt Tree refresh issue on Windows XP -
i have desktop application built on swt. have tree enclosed in scrolledcomposite. piece of code in application supposed refresh ui component.
atreeviewer.setinput(this.items) //items array list of relevant objects
but behaves weirdly on windows xp , windows 7. in win xp, returns hard arrayindexoutofbounds exception affects behavior of application.
java.lang.arrayindexoutofboundsexception: 46 @ org.eclipse.swt.widgets.tree._getitem(tree.java:254) @ org.eclipse.swt.widgets.tree._getitem(tree.java:248) @ org.eclipse.swt.widgets.tree.findcell(tree.java:2703) @ org.eclipse.swt.widgets.tree.wm_mousemove(tree.java:6806) @ org.eclipse.swt.widgets.control.windowproc(control.java:4575) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4989) @ org.eclipse.swt.internal.win32.os.dispatchmessagew(native method) @ org.eclipse.swt.internal.win32.os.dispatchmessage(os.java:2546) @ org.eclipse.swt.widgets.display.readanddispatch(display.java:3756)
whereas on win 7, appears homecoming swt layer message seems runtimeexception prints on eclipse console in no way effects behavior of application. meaning, application working fine.
ignored reentrant phone call while viewer busy. logged 1 time per viewer instance, similar calls still ignored. java.lang.runtimeexception @ org.eclipse.jface.viewers.columnviewer.checkbusy(columnviewer.java:763) @ org.eclipse.jface.viewers.columnviewer.refresh(columnviewer.java:541) @ org.eclipse.jface.viewers.structuredviewer.refresh(structuredviewer.java:1490) @ com.sxsy.smtj.ui.cw.widgets.ewlist.basicrefresh(ewlist.java:86) @ com.sxsy.smtj.ui.cw.widgets.ewtablelist.basicrefresh(ewtablelist.java:75) @ com.sxsy.smtj.ui.cw.widgets.ewlist.refresh(ewlist.java:402) @ com.sxsy.smtj.ui.cw.widgets.ewtablelist.columnschanged(ewtablelist.java:115) @ com.sxsy.smtj.ui.cw.widgets.ewtablecolumn.updatewidget(ewtablecolumn.java:377) @ com.sxsy.smtj.ui.cw.widgets.ewtablecolumn.width(ewtablecolumn.java:407) @ com.sxsy.smtj.ui.cw.widgets.wktablewidget.doautosizecolumns(wktablewidget.java:244) @ com.sxsy.smtj.ui.cw.widgets.wktablewidget.autosizecolumns(wktablewidget.java:87) @ com.sxsy.smtj.ui.cw.widgets.wktablewidget.processresizedevent(wktablewidget.java:437) @ com.sxsy.smtj.ui.cw.widgets.ewlist$3.controlresized(ewlist.java:449) @ org.eclipse.swt.widgets.typedlistener.handleevent(typedlistener.java:235) @ org.eclipse.swt.widgets.eventtable.sendevent(eventtable.java:84) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1053) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1077) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1058) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5795) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.defwindowprocw(native method) @ org.eclipse.swt.internal.win32.os.defwindowproc(os.java:2541) @ org.eclipse.swt.widgets.tree.callwindowproc(tree.java:1442) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5859) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.setscrollinfo(native method) @ org.eclipse.swt.widgets.tree.updatescrollbar(tree.java:5660) @ org.eclipse.swt.widgets.tree.callwindowproc(tree.java:1589) @ org.eclipse.swt.widgets.scrollable.wm_size(scrollable.java:316) @ org.eclipse.swt.widgets.composite.wm_size(composite.java:1662) @ org.eclipse.swt.widgets.tree.wm_size(tree.java:7137) @ org.eclipse.swt.widgets.control.windowproc(control.java:4603) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.callwindowprocw(native method) @ org.eclipse.swt.internal.win32.os.callwindowproc(os.java:2440) @ org.eclipse.swt.widgets.tree.callwindowproc(tree.java:1534) @ org.eclipse.swt.widgets.control.wm_windowposchanged(control.java:5408) @ org.eclipse.swt.widgets.control.windowproc(control.java:4616) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.showscrollbar(native method) @ org.eclipse.swt.widgets.tree.wm_size(tree.java:7124) @ org.eclipse.swt.widgets.control.windowproc(control.java:4603) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.callwindowprocw(native method) @ org.eclipse.swt.internal.win32.os.callwindowproc(os.java:2440) @ org.eclipse.swt.widgets.tree.callwindowproc(tree.java:1534) @ org.eclipse.swt.widgets.control.wm_windowposchanged(control.java:5408) @ org.eclipse.swt.widgets.control.windowproc(control.java:4616) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.callwindowprocw(native method) @ org.eclipse.swt.internal.win32.os.callwindowproc(os.java:2440) @ org.eclipse.swt.widgets.tree.callwindowproc(tree.java:1534) @ org.eclipse.swt.widgets.control.windowproc(control.java:4623) @ org.eclipse.swt.widgets.tree.windowproc(tree.java:5958) @ org.eclipse.swt.widgets.display.windowproc(display.java:4976) @ org.eclipse.swt.internal.win32.os.sendmessagew(native method) @ org.eclipse.swt.internal.win32.os.sendmessage(os.java:3385) @ org.eclipse.swt.widgets.tree.createitem(tree.java:2104) @ org.eclipse.swt.widgets.treeitem.<init>(treeitem.java:203) @ org.eclipse.swt.widgets.treeitem.<init>(treeitem.java:91) @ org.eclipse.jface.viewers.treeviewer.createnewrowpart(treeviewer.java:809) @ org.eclipse.jface.viewers.treeviewer.newitem(treeviewer.java:315) @ org.eclipse.jface.viewers.abstracttreeviewer.createtreeitem(abstracttreeviewer.java:847) @ org.eclipse.jface.viewers.abstracttreeviewer$1.run(abstracttreeviewer.java:823) @ org.eclipse.swt.custom.busyindicator.showwhile(busyindicator.java:70) @ org.eclipse.jface.viewers.abstracttreeviewer.createchildren(abstracttreeviewer.java:797) @ org.eclipse.jface.viewers.treeviewer.createchildren(treeviewer.java:644) @ org.eclipse.jface.viewers.abstracttreeviewer.createchildren(abstracttreeviewer.java:768) @ org.eclipse.jface.viewers.abstracttreeviewer.internalinitializetree(abstracttreeviewer.java:1548) @ org.eclipse.jface.viewers.treeviewer.internalinitializetree(treeviewer.java:833) @ org.eclipse.jface.viewers.abstracttreeviewer$5.run(abstracttreeviewer.java:1532) @ org.eclipse.jface.viewers.structuredviewer.preservingselection(structuredviewer.java:1443) @ org.eclipse.jface.viewers.treeviewer.preservingselection(treeviewer.java:403) @ org.eclipse.jface.viewers.structuredviewer.preservingselection(structuredviewer.java:1404) @ org.eclipse.jface.viewers.abstracttreeviewer.inputchanged(abstracttreeviewer.java:1525) @ org.eclipse.jface.viewers.contentviewer.setinput(contentviewer.java:280) @ org.eclipse.jface.viewers.structuredviewer.setinput(structuredviewer.java:1690) @ com.sxsy.smtj.ui.cw.widgets.ewlist.refreshitems(ewlist.java:439) @ com.sxsy.smtj.ui.cw.widgets.ewtablelist.refreshitems(ewtablelist.java:514) @ com.sxsy.smtj.ui.cw.widgets.ewtabletree.refreshitems(ewtabletree.java:275) @ com.sxsy.smtj.ui.cw.widgets.ewlist.itemshavechanged(ewlist.java:345) @ com.sxsy.smtj.ui.cw.widgets.ewlinearlist.itemshavechanged(ewlinearlist.java:200) @ com.sxsy.smtj.ui.cw.widgets.ewlist.setitems(ewlist.java:549) @ com.sxsy.smtj.ui.cw.widgets.wktablewidget.setitems(wktablewidget.java:467) @ com.sxsy.smtj.ui.abt.widgets.compatibility.extendedlist.widgetsetitems(extendedlist.java:574) @ com.sxsy.smtj.ui.abt.widgets.compatibility.extendedlist.setitems(extendedlist.java:479) @ com.sxsy.smtj.ui.wk.table.compatibility.wktablewidgetview.setitems(wktablewidgetview.java:645) @ com.misys.liq.ui.collateral.liqcollateralagreementtypedefinitioncontroller.updateattributegrid(liqcollateralagreementtypedefinitioncontroller.java:1712) @ com.misys.liq.ui.collateral.liqcollateralagreementtypedefinitioncontroller.showcoreattributes(liqcollateralagreementtypedefinitioncontroller.java:1730) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ com.sxsy.smtj.utilities.reflectionutility.invoke(reflectionutility.java:754) @ com.sxsy.smtj.utilities.reflectionutility.directperform(reflectionutility.java:740) @ com.sxsy.smtj.utilities.reflectionutility.perform(reflectionutility.java:605) @ com.sxsy.smtj.compatibility.va.kernel.core.directedmessage.performaction(directedmessage.java:106) @ com.misys.liq.infrastructure.eventobservablesupport.signalevent(eventobservablesupport.java:21) @ com.sxsy.smtj.ui.abt.observableobject.primsignalevent(observableobject.java:324) @ com.sxsy.smtj.ui.abt.observableobject.signalevent(observableobject.java:398) @ com.sxsy.smtj.ui.abt.widgets.compatibility.basicview.signalevent(basicview.java:1879) @ com.sxsy.smtj.ui.abt.widgets.compatibility.togglebuttonview$2.widgetselected(togglebuttonview.java:316) @ org.eclipse.swt.widgets.typedlistener.handleevent(typedlistener.java:248) @ org.eclipse.swt.widgets.eventtable.sendevent(eventtable.java:84) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1053) @ org.eclipse.swt.widgets.display.rundeferredevents(display.java:4169) @ org.eclipse.swt.widgets.display.readanddispatch(display.java:3758) @ com.misys.liq.loaniq$13.value(loaniq.java:676) @ com.sxsy.smtj.exceptions.exceptionutility.whendo(exceptionutility.java:99) @ com.misys.liq.loaniq.standardliqeventloop(loaniq.java:693) @ com.misys.liq.loaniq.desktoptestmanuallogin(loaniq.java:924) @ com.misys.liq.loaniq.mainclassic(loaniq.java:589) @ com.misys.liq.loaniq.main(loaniq.java:309)
the first thing struck mind wrap ui logic within display.asyncexec's runnable , thereby able prepare weird behavior in win xp.
although, have no clue has happened within internals or if prepare right. nice if had experienced kind of swt weirdness throw lite on this.
this swt/jface bug. workaround issue set items null before setting actual object.
atreeviewer.setinput(null); atreeviewer.setinput(this.items);
java swt jface
No comments:
Post a Comment