ZArrayList bad index

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

Post Reply
User avatar
rrTea
Posts: 333
Joined: Sat Feb 15, 2014 9:54 am

ZArrayList bad index

Post by rrTea » Sun Jun 19, 2016 7:21 am

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.
Attachments
剪贴板图片 (20).png
剪贴板图片 (20).png (44.86 KiB) Viewed 2522 times

User avatar
VilleK
Site Admin
Posts: 1947
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: ZArrayList bad index

Post by VilleK » Sun Jun 19, 2016 8:37 am

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.

User avatar
rrTea
Posts: 333
Joined: Sat Feb 15, 2014 9:54 am

Re: ZArrayList bad index

Post by rrTea » Sun Jun 19, 2016 8:43 am

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.

User avatar
VilleK
Site Admin
Posts: 1947
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: ZArrayList bad index

Post by VilleK » Sun Jun 19, 2016 5:49 pm

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.

User avatar
rrTea
Posts: 333
Joined: Sat Feb 15, 2014 9:54 am

Re: ZArrayList bad index

Post by rrTea » Mon Jun 20, 2016 12:40 am

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 :)

User avatar
rrTea
Posts: 333
Joined: Sat Feb 15, 2014 9:54 am

Re: ZArrayList bad index

Post by rrTea » Mon Oct 22, 2018 11:32 am

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 :(

Post Reply