Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 488565 - ArrayIndexOutOfBoundsException in default graph settings dialog
Summary: ArrayIndexOutOfBoundsException in default graph settings dialog
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows NT
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Laurent CARON CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-26 09:38 EST by Michael Kagel CLA
Modified: 2021-07-05 11:39 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Kagel CLA 2016-02-26 09:38:19 EST
Hi!

In the traces tab of the "Configure Graph Settings" dialog an ArrayIndexOutOfBoundsException can be provoked by doing the following:

1. have an empty drop down for the "Y-Axis" selection
2. click on the "Y-Axis" drop down so the selection box is opened
3. DO NOT select something and also DO NOT close the selection box
4. click directly on "Apply" (two times)
-> Results in the ArrayIndexOutOfBoundsException (detailed stack trace see below) which comes every time you click on "Apply" from now on.

I analyzed this and found the problem in org.eclipse.nebula.visualization.internal.xygraph.toolbar.TraceConfigPage.applyChanges()
Here the code at the beginning...:

trace.setXAxis(xyGraph.getXAxisList().get(xAxisCombo.getSelectionIndex()));
trace.setYAxis(xyGraph.getYAxisList().get(yAxisCombo.getSelectionIndex()));

...wants to read from the axis list without checking the selection index which is returned by the combo control. I would suggest to check the index to be >=0 so the exception can be avoided.

Best Regards

Michael Kagel


Stack trace:

!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ArrayIndexOutOfBoundsException: -1
	at java.util.ArrayList.elementData(ArrayList.java:418)
	at java.util.ArrayList.get(ArrayList.java:431)
	at org.eclipse.nebula.visualization.internal.xygraph.toolbar.TraceConfigPage.applyChanges(TraceConfigPage.java:281)
	at org.eclipse.nebula.visualization.internal.xygraph.toolbar.XYGraphConfigDialog.applyChanges(XYGraphConfigDialog.java:261)
	at org.eclipse.nebula.visualization.internal.xygraph.toolbar.XYGraphConfigDialog.access$3(XYGraphConfigDialog.java:255)
	at org.eclipse.nebula.visualization.internal.xygraph.toolbar.XYGraphConfigDialog$4.widgetSelected(XYGraphConfigDialog.java:236)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
	at org.eclipse.jface.window.Window.open(Window.java:803)
	at org.eclipse.nebula.visualization.xygraph.figures.XYGraphToolbar$1.actionPerformed(XYGraphToolbar.java:80)
	at org.eclipse.draw2d.Clickable.fireActionPerformed(Clickable.java:206)
	at org.eclipse.draw2d.Clickable$1.actionPerformed(Clickable.java:175)
	at org.eclipse.draw2d.ButtonModel.fireActionPerformed(ButtonModel.java:140)
	at org.eclipse.draw2d.ButtonModel$DefaultFiringBehavior.released(ButtonModel.java:506)
	at org.eclipse.draw2d.ButtonModel.fireReleased(ButtonModel.java:179)
	at org.eclipse.draw2d.ButtonModel.setPressed(ButtonModel.java:466)
	at org.eclipse.draw2d.ClickableEventHandler.mouseReleased(ClickableEventHandler.java:92)
	at org.eclipse.draw2d.Figure.handleMouseReleased(Figure.java:947)
	at org.eclipse.draw2d.SWTEventDispatcher.dispatchMouseReleased(SWTEventDispatcher.java:267)
	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
Comment 1 Laurent CARON CLA 2019-06-03 16:19:47 EDT
https://github.com/eclipse/nebula/pull/90
Comment 2 Laurent CARON CLA 2019-06-03 16:22:55 EDT
Bug fixed in release 2.2.0