Like in topic. I have problem with getting primitive value from ArrayList. Everything should work, IDE show no errors, all values are initialized and I can see them in debugger (in ArrayList object list), but when I am trying to do anything with this object I am getting NullPointerException. Also, when I am hovering primitive while debuging I see Malformed expression: "(ERROR)" instead of value.

In Buildings.delete() method you are setting an index to null instead of using remove(). If you aren't closing the gaps, you will have null values that will give you an error when you try to iterate over everything.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org