google / google/error-prone

Find resource leaks (AutoCloseables that should have been closed)

Open
#264 7 comments 1 reaction 0 assignees View on GitHub
migrated Priority-Medium Type-NewCheck
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

_[Original issue](https://code.google.com/p/error-prone/issues/detail?id=264) created by **cushon@google.com** on 2014-10-30 at 04:01 PM_

---

Originally reported by kevinb9n:

Many ways of obtaining an AutoCloseable instance imply responsibility on the obtainer to close that instance (e.g. by obtaining it inside try-with-resources), and many don't. For error-prone to be able to detect resource leaks it would need some way to differentiate. How?

eaftan notes:

We can use dataflow to determine how the instance was obtained. Is it always the case that knowing the provenance of the instance is enough to know whether it needs to be closed? Can you provide examples other than try-with-resources?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.