Simplix-Softworks / SimplixStorage

Library to store data in a better way
Apache License 2.0
138 stars 25 forks source link

remove() results in ArrayIndexOutOfBoundsException #21

Closed test414EFF closed 4 years ago

test414EFF commented 4 years ago

Describe the bug Trying to use remove() to delete a hashmap in a JSON file results in this error: https://hastebin.com/ovasapukam.sql

To Reproduce Use remove() on a hashmap in a json file. I have not tested this with other file types or other datatypes.

Expected behavior I expected this to remove the data from the file.

Desktop (please complete the following information):

KotlinFactory commented 4 years ago

Hey 414EFF,

Can you please provide some sample code to reproduce this error.

Regards,

test414EFF commented 4 years ago

Sure. I'm using this to create the item I'm trying to delete (it's a shop stored in a hashmap):

HashMap<String, HashMap> shop = new HashMap<>();
HashMap<String, String> items = new HashMap<>();
HashMap<String, Object> info = new HashMap<>();

items.put(serializer.itemToString(item), price.toString());
info.put("owner", utility.getUUID(p));
shop.put("items", items);
shop.put("info", info);
shops.set(name.toString(), shop);

And this code to remove it: shops.remove(name);

KotlinFactory commented 4 years ago

Hi 414EFF,

We fixed this issue with the latest version:) Thank you for reporting it.

Regards,