Class CloseableResourceAnalyzer
java.lang.Object
org.ek9lang.compiler.common.CodeFlowMap
org.ek9lang.compiler.common.CloseableResourceAnalyzer
- All Implemented Interfaces:
CodeFlowAnalyzer
Tracks closeable resources to detect abandoned resources (Rule 2 - E81056).
A resource is "properly managed" if it meets any of the following criteria:
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.
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 Summary
FieldsFields inherited from class CodeFlowMap
SAFE_ACCESS -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class CodeFlowMap
doesSymbolMeetAcceptableCriteria, getSymbolsNotMeetingAcceptableCriteria, markSymbolAsMeetingAcceptableCriteria, recordSymbol
-
Field Details
-
PROPERLY_MANAGED
- See Also:
-
-
Constructor Details
-
CloseableResourceAnalyzer
CloseableResourceAnalyzer()
-