Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the Resource Leak Checker, should we still ignore certain exception types even when there is an explicit catch block? #6264

Open
msridhar opened this issue Oct 25, 2023 · 0 comments

Comments

@msridhar
Copy link
Contributor

When adding the default ignored exception type functionality, in my mind I was primarily thinking about cases where the exceptional edge for the call went directly to the method exit, but not about cases where there is a matching catch block. Right now, for this code, I think the exceptional possibility from the call to method() will be ignored by the RLC:

r = alloc();
try {
  method();
} catch (RuntimeException e) {
  throw e;
}
r.close();

Somehow, the presence of a catch block to me implies that the developer cares more about the possibility of that exception being thrown; so maybe we should not ignore the possibility in the RLC?

Originally discussed by @msridhar in #6242 (comment)

@msridhar msridhar added this to the Medium milestone Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant