Restore axes method throws an exception after unzoom

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Slix
Newbie
Newbie
Posts: 3
Joined: Wed Sep 10, 2014 12:00 am

Restore axes method throws an exception after unzoom

Post by Slix » Fri Sep 12, 2014 11:58 am

To reproduce the ArrayIndexOutOfBoundsException, following actions have to be done:

Create a chart and e.g. add a line. Then zoom into and afterwards create a custom axis. Now if you unzoom an ArrayIndexOutOfBoundsException will be thrown.
As an attachment I add a code example.
Attachments
TestChartAxis.zip
Reproduces an ArrayIndexOutOfBoundsException
(1005 Bytes) Downloaded 2449 times

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Restore axes method throws an exception after unzoom

Post by Yeray » Mon Sep 15, 2014 9:57 am

Hello,

I can't reproduce this with TeeChart Java v3.2014.0519 SWT.
What version are you using?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Slix
Newbie
Newbie
Posts: 3
Joined: Wed Sep 10, 2014 12:00 am

Re: Restore axes method throws an exception after unzoom

Post by Slix » Wed Sep 17, 2014 8:49 am

Hi Yeray,

thx for reply.

I use absolutely the same/newest version as you. Maybe you didn't reproduce it in the way I described it. :wink:

The code I attached, you should use in the following manner.

1) Start the TeeChart SWT Application by running the attached code.
2) Zoom into the Chart
3) press the button
4!) Zoom out -> ArrayIndexOutOfBoundsException will be thrown

I also debugged the source and on this position the source changed in comparison to the previous teechart version.

Stacktrace:

Code: Select all

java.lang.ArrayIndexOutOfBoundsException: 0
	at com.steema.teechart.Chart.restoreScales(Chart.java:1511)
	at com.steema.teechart.Chart.restoreAxisScales(Chart.java:654)
	at com.steema.teechart.Zoom.undo(Zoom.java:437)
	at com.steema.teechart.Chart.mouseReleased(Chart.java:1595)
	at com.steema.teechart.TChart.processMouseEvent(TChart.java:1191)
	at com.steema.teechart.TChart$5.handleEvent(TChart.java:372)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1262)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1060)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Restore axes method throws an exception after unzoom

Post by Yeray » Thu Sep 18, 2014 9:53 am

Hello Slix,

Excuse me, I didn't follow the steps correctly.
I could reproduce the problem now so I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=925
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Restore axes method throws an exception after unzoom

Post by Yeray » Thu Sep 18, 2014 10:04 am

An I've fixed it for the next maintenance release too. :D
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Slix
Newbie
Newbie
Posts: 3
Joined: Wed Sep 10, 2014 12:00 am

Re: Restore axes method throws an exception after unzoom

Post by Slix » Thu Nov 13, 2014 12:39 pm

Hi Yeray,

thx for the fix! My question for the moment is, how am I able to download this maintenance release? I can't find it in my download area, it's really urgent. :) I hope you can help me.

Yeray
Site Admin
Site Admin
Posts: 9622
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Restore axes method throws an exception after unzoom

Post by Yeray » Thu Nov 13, 2014 2:26 pm

Hello,
Slix wrote:thx for the fix! My question for the moment is, how am I able to download this maintenance release? I can't find it in my download area, it's really urgent. :) I hope you can help me.
I'm afraid I can't tell you when the next maintenance release will be published.
However, I see you own the sources so you can apply the fix to the sources yourself.
At Chart.java you'll find a method called restoreScales(AllAxisSavedScales s). Change the line where says (line 1509 in Chart.java):

Code: Select all

        for (int i=0; i < axes.getCustom().size(); i++)
For this:

Code: Select all

        for (int i=0; i < s.customAxes.length; i++)
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply