Warning: overrideable method invoked from constructor
Open
migrated
Priority-High
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=183) created by **kevinb@google.com** on 2013-09-11 at 05:25 PM_
---
It's Very Bad News to invoke an overrideable method from a constructor. Anyone overriding that method would be dealing with a partly-constructed instance, so there's no limit to the bugs that can fall out of that.
Every instance method invoked on 'this' from the constructor should be either final or private, or of course the entire class should be private.
Contributor guide
Assessment
This issue has not been assessed yet.