google / google/error-prone

Could you make `@MustBeClosed` to have `ElementType.TYPE` in its `@Target`?

Open
#1,708 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

### Description of the problem / feature request:

Could you make `@MustBeClosed` to have `ElementType.TYPE` in its `@Target` and support it?

### Feature requests: what underlying problem are you trying to solve with this feature?

We have our own interface which must be closed when it's used. https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/common/util/SafeCloseable.java
If we can annotate the class with the `@MustBeClosed`, we don't have to put the annotation all over the places where it's used.

### What version of Error Prone are you using?

2.4.0

### Have you found anything relevant by searching the web?

I couldn't. 😄

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.