Deprecated API
Contents
-
Terminally Deprecated ElementsElementDescriptionsince 5.0.0, use
TryCatchStatement.addCatch(CatchStatement); planned for removal in Groovy 7since 5.0.0, useTryCatchStatement.addResource(ExpressionStatement); planned for removal in Groovy 7You shouldn't call this method because it is inherently unreliable.Use #parameterizeType insteadThis constant is no longer used and will be removed in a future version.UseBooleanClosureForMapPredicateinstead.UseBooleanClosurePredicateinstead.UseBooleanClosureWrapperinstead.No production callers remain; kept only for binary compatibility.UseBeanUtils.capitalize(java.lang.String)insteadsince 5.0.0since 5.0.0this method is unused, replaced withDelegatesToinference.UseJava17instead. Groovy 6.0 requires JDK 17+.UseJava17instead. Groovy 6.0 requires JDK 17+.UseJava17instead. Groovy 6.0 requires JDK 17+.UseJava17instead. Groovy 6.0 requires JDK 17+.
-
Deprecated ClassesClassDescriptionSuperseded by the quirk-free DSLs:
org.apache.groovy.dateutil.TimeCategory(and itsjava.util.Date-based duration classes) ororg.apache.groovy.datetime.TimeCategory(producingjava.timetypes). This legacy class is retained, unchanged, for backward compatibility.Superseded byorg.apache.groovy.dateutil.DatumDependentDuration(the dequirkedjava.util.Dateflavor) orjava.time.Period. This legacy class is retained, unchanged, for backward compatibility.Superseded byorg.apache.groovy.dateutil.Duration(the dequirkedjava.util.Dateflavor) orjava.time.Duration/java.time.Period. This legacy class is retained, unchanged, for backward compatibility.Use one of the quirk-free replacements instead:org.apache.groovy.datetime.TimeCategory(producesjava.timetypes) ororg.apache.groovy.dateutil.TimeCategory(producesjava.util.Date). This legacy category is retained, unchanged, for backward compatibility.Superseded byorg.apache.groovy.dateutil.TimeDatumDependentDuration(the dequirkedjava.util.Dateflavor) or thejava.timeDSL inorg.apache.groovy.datetime.TimeCategory. This legacy class is retained, unchanged, for backward compatibility.Superseded byorg.apache.groovy.dateutil.TimeDuration(the dequirkedjava.util.Dateflavor) orjava.time.Duration. This legacy class is retained, unchanged, for backward compatibility.retained only so Groovy 4 compiled bytecode keeps linking; not emitted by any current transform and not intended for direct usestatic mixins have been deprecated in favour of traits (trait keyword).Since 6.0.0, useStaticTypesBinaryExpressionMultiTypeDispatcherinstead; indy array access is no longer used in static compilation.UseBooleanClosureForMapPredicateinstead.UseBooleanClosurePredicateinstead.UseBooleanClosureWrapperinstead.No production callers remain; kept only for binary compatibility.UseJava17instead. Groovy 6.0 requires JDK 17+.UseJava17instead. Groovy 6.0 requires JDK 17+.UseJava17instead. Groovy 6.0 requires JDK 17+.UseJava17instead. Groovy 6.0 requires JDK 17+.
-
Deprecated Annotation InterfacesAnnotation InterfaceDescriptionStatic mixins have been deprecated in favour of traits.
-
Deprecated FieldsFieldDescriptionUse
GroovyLexer.VOCABULARYinstead.UseGroovyParser.VOCABULARYinstead.Use direct closure invocation insteadThis constant is no longer used and will be removed in a future version.UseExtensionModuleScanner.MODULE_META_INF_FILEinsteadsince 5.0.0since 5.0.0
-
Deprecated MethodsMethodDescriptionthis flag is retained for compatibilityUse
Sql.buildSqlWithIndexedProps(String)insteaduse setKeepIgnorableWhitespaceThis method is not in use anymore. UseGroovyc.makeCompileUnit(GroovyClassLoader)instead.for removal since 5.0.0; useClassNode.getField(String)orClassNode.getDeclaredField(String)insteadUseCompileUnit.getClassesToCompile()insteadUseCompileUnit.getClassesToCompile()insteadUseStatement.getStatementLabels()instead for access to all labelssince 5.0.0, useTryCatchStatement.addCatch(CatchStatement); planned for removal in Groovy 7since 5.0.0, useTryCatchStatement.addResource(ExpressionStatement); planned for removal in Groovy 7use MethodNodeUtils#methodDescriptorWithoutReturnType(MethodNode) insteadYou shouldn't call this method because it is inherently unreliable.Use #parameterizeType insteadUseCompileStack.pushState()directly.Use bridge metadata on the declaring class instead of probing outer-class nesting manually.org.codehaus.groovy.classgen.asm.util.LoggableTextifier.visitMethodInsn(int, String, String, String) UseWriterController.getClassVisitor()instead for clarityUseReturnAdder.visitMethod(MethodNode)instead.not used anymorenot used anymore, has no effectUseBeanUtils.capitalize(java.lang.String)insteadsince 6.0.0; the nativeStream.toList()(JDK 16+) shadows this and returns an unmodifiable list. If you need a mutable list, callStreamGroovyMethods.toMutableList(Stream); otherwise usestream.toList()directly (faster than this extension because it skips theCollectorspath).since 2.3.0 - Java's auto-boxing is sufficient for this operationsince 2.3.0 - Java's auto-boxing is sufficient for this operationsince 2.3.0 - Java's auto-boxing is sufficient for this operationsince 2.3.0 - Java's auto-boxing is sufficient for this operationsince 2.3.0 - Java's auto-boxing is sufficient for this operationsince 2.3.0 - Java's auto-boxing is sufficient for this operationsince 2.3.0 - Java's auto-boxing is sufficient for this operationsince 2.3.0 - Java's auto-boxing is sufficient for this operationsince 2.3.0 - useShortTypeHandling.castToChar(Object)insteadthis method is unused, replaced withDelegatesToinference.Use the new bootHandle-based approach instead.Use the new bootHandle-based approach instead.
-
Deprecated ConstructorsConstructorDescriptionUse
ParameterTypes(Class[])insteadThetoolparameter is unused; useGroovyRootDocBuilder(String[], List, Properties)instead.
-
Deprecated Enum Constants
ClassNode.getField(String)orClassNode.getDeclaredField(String)instead