Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.9
-
None
-
None
-
Java11, Java17, Windows 10
Description
The following code will break on Groovy 3.0.9 with Java 17 but works with Java 11:
def sb = new StringBuilder() sb << 'a' sb << 'b' println sb.toString() sb.setLength(0)
The error is
groovy.lang.MissingMethodException: No signature of method: java.lang.StringBuilder.setLength() is applicable for argument types: (Integer) values: [0]
This error can be reproduced in Groovy Console.
The doc for Java's StringBuilder.setLength method
https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/StringBuilder.html#setLength(int)
Attachments
Issue Links
- is related to
-
GROOVY-10109 IllegalAccessError with package-access base class
- Closed
-
GROOVY-10136 [JDK16] Failed to find `public` method derived from `package` super class
- Closed
- relates to
-
GROOVY-10594 Unable to Call StringBuilder.substring() method (JDK17, Groovy 3)
- Closed