Re: Illegal reflective access (ArrayList.size) – Fixed in any Groovy 3.x/4.x version?

"Milles, Eric (TR Technology) via dev" <dev-GSC0n/0aZo1d/SJB6HiN2Ni2O/[email protected]>
Newsgroups gmane.comp.lang.groovy.devel
Message-ID <PH7PR03MB7224C2E0D8F0F93CC0F88F968A74A@PH7PR03MB7224.namprd03.prod.outlook.com>
If you use code such as "def list = new ArrayList(); print(list.size)" it will produce the warning within the Java9 class, where the field lookup is performed.

The solution to this from your perspective is to use the size method, aka "list.size()".

If you suspect such field usage exists within the Groovy runtime, it would be helpful to find it so we can make a similar change.  We do have one or two test cases that do this on purpose to exercise the warning.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.