Page 1 of 1

ZArrayList bad index

Posted: Sun Jun 19, 2016 7:21 am
by rrTea
I wasn't getting these for some time, but now they're back? I got them on a few separate occasions under the same circumstances as the previous time (when attempting to move a component down in the Project Tree). Unfortunately I can't see any logic to it or how to reproduce it.

Re: ZArrayList bad index

Posted: Sun Jun 19, 2016 8:37 am
by VilleK
Does your project use Arrays? The first thing you should do is check your code that accesses arrays and make sure they stay within array bounds.

Re: ZArrayList bad index

Posted: Sun Jun 19, 2016 8:43 am
by rrTea
Yes I use arrays but to me this doesn't look like it's connected - for example this time the error appeared when I attempted top move a RenderSetColor component in the OnRender (the component was unnamed and unconnected to any arrays from the project) to the bottom by clicking on one of the arrows in the IDE's toolbar. The previous time it was the same, I attempted to move a completely plain component to the bottom and it didn't want to move it.

Re: ZArrayList bad index

Posted: Sun Jun 19, 2016 5:49 pm
by VilleK
So it is not while the project is running? I haven't encountered this but let me know if you can reproduce a simple case and I'll make sure to fix it.

Re: ZArrayList bad index

Posted: Mon Jun 20, 2016 12:40 am
by rrTea
Yes, it's not while the project is running - at least that's not what happened in this case. I haven't managed to reproduce it in simple projects, I only encountered it in my main project (which is pretty big). If I manage to reproduce it as a simple case I'll post it here :)

Re: ZArrayList bad index

Posted: Mon Oct 22, 2018 11:32 am
by rrTea
From time to time (very rarely) I get some similar strange behavior but without actual reports of "ZArray" errors when I drag and copy a component in Project Tree while the project is running in Preview, meaning not adding a new component but LMB click on an existing component in Project Tree, press CTRL, drag the component elsewhere and release the LMB (the new copy of the component gets added to the bottom of wherever the destiantion was).

After moving the new component up it can happen that it just doesn't do anything – I usually do this only with simple components like SetRenderColor whose effects are easy to see. Can't really say for sure but it seems to me that the chances of the new component being strange are higher when I operate like this on components that are in OnRender.

This can be solved by saving and reopening the zgeproj file. In such cases I sometimes noticed the copy of the component was still on the bottom of wherever it was placed even though I think I moved it up. Again, can't say for sure.

Unfortunately I don't know how to reliably reproduce it yet :(