cushon / issues-import

0 stars 0 forks source link

Warning: overrideable method invoked from constructor #183

Open cushon opened 9 years ago

cushon commented 9 years ago

Original issue 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.