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

"Anjan Baradwaj via users" <users-GSC0n/0aZo1d/SJB6HiN2Ni2O/[email protected]> Fri, 20 Feb 2026 06:46:03 +0000
Newsgroups gmane.comp.lang.groovy.user
Message-ID <SA1PR22MB544568607FCFBF496C4693949968A@SA1PR22MB5445.namprd22.prod.outlook.com>
--_000_SA1PR22MB544568607FCFBF496C4693949968ASA1PR22MB5445namp_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

Hello Groovy Team,

We are using Groovy 3.0.12 with JDK 11 and see the following warning
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v9.Java9
(file: .../groovy-3.0.12.jar) to field java.util.ArrayList.size
WARNING: Please consider reporting this to the maintainers of org.codehaus.=
groovy.vmplugin.v9.Java9
WARNING: All illegal access operations will be denied in a future release

We also tested with Groovy 4.x and observed similar behavior.

Environment details:

Groovy: 3.0.12 (also tested 4.x)
Java: 11.0.29
Maven: 3.5.2

Could you please let us know:


  1.
Has this been fixed in any newer Groovy 3.x or 4.x version?
  2.
If yes, which version should we upgrade to?
  3.
Is there any recommended approach to avoid this without using --add-opens J=
VM options?

Thank you for your help.

Best regards,
Anjan

CONFIDENTIALITY NOTICE: The information contained in this electronic messag=
e is intended to be viewed only by the individual or entity to which it is =
addressed. It may contain information that is privileged, confidential, and=
 exempt from disclosure under applicable law. If the reader of this message=
 is not the intended recipient, you are hereby notified that any disseminat=
ion, distribution or duplication of this message is strictly prohibited. If=
 this electronic message has been received in error, please notify sender i=
mmediately by return email and delete the original message and any copies o=
f it from your computer system. Thank you.

--_000_SA1PR22MB544568607FCFBF496C4693949968ASA1PR22MB5445namp_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
Hello Groovy Team,</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<br>
</div>
<div style=3D"margin-top: 1em; margin-bottom: 1em; font-family: Aptos, Apto=
s_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-s=
ize: 11pt; color: rgb(0, 0, 0);" class=3D"elementToProof">
<span class=3D"elementToProof">We are using Groovy 3.0.12 with JDK 11 and s=
ee the following warning</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">WARNING: An illegal reflective access operat=
ion has occurred</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">WARNING: Illegal reflective access by org.co=
dehaus.groovy.vmplugin.v9.Java9</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">(file: .../groovy-3.0.12.jar) to field java.=
util.ArrayList.size</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">WARNING: Please consider reporting this to t=
he maintainers of org.codehaus.groovy.vmplugin.v9.Java9</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">WARNING: All illegal access operations will =
be denied in a future release</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">We also tested with Groovy 4.x and observed =
similar behavior.</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">Environment details:</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">Groovy: 3.0.12 (also tested 4.x)</span></div=
>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">Java: 1</span>1.0.29</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">Maven: 3.5.2</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">Could you please let us know:</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<br>
</div>
<ol style=3D"margin-top: 0px; margin-bottom: 0px; list-style-type: decimal;=
" data-editing-info=3D"{&quot;applyListStyleFromLevel&quot;:false,&quot;ord=
eredStyleType&quot;:1}" start=3D"1">
<li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, C=
alibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<div role=3D"presentation" class=3D"elementToProof"><span class=3D"elementT=
oProof">Has this been fixed in any newer Groovy 3.x or 4.x version?</span><=
/div>
</li><li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServi=
ce, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<div role=3D"presentation"><span class=3D"elementToProof">If yes, which ver=
sion should we upgrade to?</span></div>
</li><li style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontServi=
ce, Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<div role=3D"presentation" class=3D"elementToProof"><span class=3D"elementT=
oProof">Is there any recommended approach to avoid this without using --add=
-opens JVM options?</span></div>
</li></ol>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">Thank you for your help.</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<br>
</div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">Best regards,</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<span class=3D"elementToProof">Anjan</span></div>
<div style=3D"font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, =
Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" clas=
s=3D"elementToProof">
<br>
</div>
CONFIDENTIALITY NOTICE: The information contained in this electronic messag=
e is intended to be viewed only by the individual or entity to which it is =
addressed. It may contain information that is privileged, confidential, and=
 exempt from disclosure under applicable
 law. If the reader of this message is not the intended recipient, you are =
hereby notified that any dissemination, distribution or duplication of this=
 message is strictly prohibited. If this electronic message has been receiv=
ed in error, please notify sender
 immediately by return email and delete the original message and any copies=
 of it from your computer system. Thank you.
</body>
</html>

--_000_SA1PR22MB544568607FCFBF496C4693949968ASA1PR22MB5445namp_--