Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.shlink.de!news.iphh.net!iphh.net!nntp.ilk.net!noris.net!newsfeed.straub-nv.de!texta.sil.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: 07 Apr 2011 12:24:28 GMT Lines: 20 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1302179068 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:2929 Lew wrote: > On 04/07/2011 04:44 AM, Andreas Leitgeb wrote: >> Lew wrote: >>> Andreas Leitgeb wrote: >>>>> Is there any *good* use of having the constructor call a method that >>>>> actually *can* be overridden in a subclass? I mean, are there >>>>> (non-anti)patterns of explicitly allowing subclasses to hook into >>>>> base-class's construction? >>> private final Logger logger = getLogger( getClass() ); >> I thought, I made it clear, that calling static methods was not relevant >> to my question. So, kind of thanks for pointing out that I should have >> written non-static in the very line of the question, rather than consider >> that clear from the other (snipped by you) paragraphs of my post... > > I did not realize that 'getClass()' was static. I did not realize that getClass() was overidable - a property I even explicitly repeated in my question. For this, I assumed you were talking of getLogger().