Class AbandonedResourceOrError

java.lang.Object
org.ek9lang.compiler.common.RuleSupport
org.ek9lang.compiler.phase5.AbandonedResourceOrError
All Implemented Interfaces:
Consumer<IScope>

final class AbandonedResourceOrError extends RuleSupport implements Consumer<IScope>
Checks for abandoned resources (Rule 2 - E81056) at scope exit. An abandoned resource is a closeable variable that was declared but never:
  • Closed via try-with-resources
  • Escaped (returned, stored in field/collection, passed to method)