Class CloseableResourceAnalyzer

java.lang.Object
org.ek9lang.compiler.common.CodeFlowMap
org.ek9lang.compiler.common.CloseableResourceAnalyzer
All Implemented Interfaces:
CodeFlowAnalyzer

final class CloseableResourceAnalyzer extends CodeFlowMap
Tracks closeable resources to detect abandoned resources (Rule 2 - E81056).
A resource is "properly managed" if it meets any of the following criteria:
  • Closed via close statement (which also triggers Rule 1 error E81055)
  • Escaped (returned, stored in field/collection, passed to method)
  • Declared in try-with-resources (automatically managed)

This analyzer extends CodeFlowMap using the "PROPERLY_MANAGED" metadata flag to track whether a closeable resource has been properly handled before going out of scope.
  • Field Details

  • Constructor Details

    • CloseableResourceAnalyzer

      CloseableResourceAnalyzer()