Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!weretis.net!feeder4.news.weretis.net!newsfeed.utanet.at!newsfeed2.utanet.at!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Newsgroups: comp.lang.java.programmer From: Andreas Leitgeb Subject: Re: calling own methods from constructor References: Reply-To: avl@logic.at User-Agent: slrn/pre0.9.9-111 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: Date: 08 Apr 2011 09:30:28 GMT Lines: 22 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1302255028 tunews.univie.ac.at 60386 128.130.175.3 X-Complaints-To: abuse@tuwien.ac.at Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2989 Daniele Futtorovic wrote: > On 08/04/2011 01:51, Daniele Futtorovic allegedly wrote: >> class BaseClass implements [...] { In principle this is the same kind of example as Tom's. It has already been established by now, that this calling of virtual methods from the c'tor *can* be used with caution such that it doesn't necessarily lead to bugs. Also, that alternatives exist, even though they may appear to be less convenient at times. What's left open and would interest me is, if this pattern is already used in any of the big Java-based projects. E.g. a publically accessible javadoc of the API of a lib documenting some protected method to be "called from some superclass constructor and thus the implementation should not assume 'this' instance to be initialized to any degree." Not that this existence or non-existence would have any real impact on Java's future, of course...