In order to be compatible with LUA, setting the last element to nil will remove all the nil elements at the end of the array.
As shown in the LUA code in the picture, originally there are 3 elements in the array, and we set the second one as nil first, the size of the array is still 3, but when we set the third one to nil, which is the last element in the array, the size becomes 1, which indicates the second and the third elements are both removed since they are both nil.
But in our gjavac code, only the last null element is handled:
It needs to be fixed so that our Java smart contract will execute the same as those contracts in LUA.
In order to be compatible with LUA, setting the last element to nil will remove all the nil elements at the end of the array.
As shown in the LUA code in the picture, originally there are 3 elements in the array, and we set the second one as nil first, the size of the array is still 3, but when we set the third one to nil, which is the last element in the array, the size becomes 1, which indicates the second and the third elements are both removed since they are both nil.
But in our gjavac code, only the last null element is handled:
It needs to be fixed so that our Java smart contract will execute the same as those contracts in LUA.