Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!fx30.iad.POSTED!not-for-mail From: Daniel Pitts User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: can this be done with generics? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Lines: 13 Message-ID: <5KJpu.155652$uW4.7754@fx30.iad> X-Complaints-To: abuse@newsrazor.net NNTP-Posting-Date: Tue, 10 Dec 2013 19:14:09 UTC Date: Tue, 10 Dec 2013 11:14:11 -0800 X-Received-Bytes: 1326 X-Received-Body-CRC: 526320057 Xref: csiph.com comp.lang.java.programmer:26829 On 12/7/13 11:20 AM, Andreas Leitgeb wrote: > Daniel Pitts wrote: >> Yes, this *can* be done with generics, but its relatively ugly and hard >> to maintain. > > Thanks for the answer, but you're a bit late to the party, and both the > getThis()-approach as well as a slightly "dirtier"(with unchecked casts) > solution that also works with instanciable non-leaf-classes have already > been posted. :) > Yeah, I saw that after I posted :-) Cheers.