Class CastExpressionOptimizer
java.lang.Object
org.codehaus.groovy.transform.sc.transformers.CastExpressionOptimizer
Simplifies casts and coercions that the static compiler can safely emit directly.
-
Constructor Summary
ConstructorsConstructorDescriptionCastExpressionOptimizer(StaticCompilationTransformer staticCompilationTransformer) Creates a cast optimizer backed by the owning static compilation transformer. -
Method Summary
Modifier and TypeMethodDescriptionRewrites a cast expression when the cast or coercion can be simplified.
-
Constructor Details
-
CastExpressionOptimizer
Creates a cast optimizer backed by the owning static compilation transformer.- Parameters:
staticCompilationTransformer- the shared transformer context
-
-
Method Details
-
transformCastExpression
Rewrites a cast expression when the cast or coercion can be simplified.- Parameters:
cast- the cast expression to transform- Returns:
- the optimized expression
-