Can't use method ensureCapacity for ArrayList

Hello. I'm using a script on painless language, and I can't get it working with the ArrayList object.
Even example from docs isn't working for me. I've tested it on 7.13.2 and 7.16.3. Thanks in advance for your answer.

You can see what methods are available in the documentation. It doesn't look like ensurecapacity is an available method for java.util.arraylist.

1 Like

Thanks a lot, Aaron! I've found usage of this method on the painless types page


. I am sharing a screenshot where I've highlighted it for you.

Maybe a developer could weigh in but it doesn't look like a supported method to me so not sure why it's in the documentation. Believe it might have in older versions.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.