Class TryWithResourcesASTTransformation

  • public class TryWithResourcesASTTransformation
    extends Object
    Transform try-with-resources to try-catch-finally Reference JLS "14.20.3. try-with-resources"(
    • Constructor Detail

      • TryWithResourcesASTTransformation

        public TryWithResourcesASTTransformation​(AstBuilder astBuilder)
    • Method Detail

      • transform

        public Statement transform​(TryCatchStatement tryCatchStatement)
        Reference JLS "14.20.3. try-with-resources"(
        tryCatchStatement - the try-with-resources statement to transform
        try-catch-finally statement, which contains no resources clause
      • transformResourceAccess

        public BinaryExpression transformResourceAccess​(Expression variableAccessExpression)
        See Basic try-with-resources If a basic try-with-resource statement is of the form: try (VariableAccess ...) Block then the resource is first converted to a local variable declaration by the following translation: try (T #r = VariableAccess ...) { Block }