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

Improvement: Add error-prone check that forbids extending java.lang.Error #1379

Merged
merged 6 commits into from
Jun 3, 2020

Conversation

robert3005
Copy link
Contributor

Before this PR

We would allow extending Error. While there are niche cases where this is useful in vast majority of cases it can lead to more confusing and bugs than value.

After this PR

==COMMIT_MSG==
Add error-prone check that forbids extending java.lang.Error (reports ERROR). Provides a fix to replace extends Error with extends RuntimeException for clearer contract to the consumers.
==COMMIT_MSG==

Possible downsides?

The refactoring will get applied automatically but it might require human attention to merge. Cases where people would } catch (Error e) { are what we want to fix so those who do that might require to adjust their catch clauses after libraries pick up this check.

Robert Kruszewski added 2 commits June 2, 2020 23:29
@ferozco
Copy link
Contributor

ferozco commented Jun 3, 2020

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants