Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
The public setLength() is defined in java.lang.AbstractStringBuilder, whose visibility is package, the following error happened if accessing setLength() via java.lang.StringBuilder, which is derived from java.lang.AbstractStringBuilder
TraitsSpecificationTest > testStackableTraits FAILED groovy.lang.MissingMethodException: No signature of method: java.lang.StringBuilder.setLength() is applicable for argument types: (Integer) values: [0] Possible solutions: setLength(int), length() at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70) at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:47) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139) at TraitsSpecificationTest$PrintCategory.reset(TraitsSpecificationTest.groovy:838) at org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:318)
Attachments
Issue Links
- relates to
-
GROOVY-10429 StringBuilder misses setLength method in Java17
- Closed
-
GROOVY-10594 Unable to Call StringBuilder.substring() method (JDK17, Groovy 3)
- Closed
-
GROOVY-11035 Inferred type is Object when having a complex inheritance chain of interfaces
- Closed