Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: markspace <-@.> Newsgroups: comp.lang.java.programmer Subject: Re: generics puzzle Date: Mon, 17 Oct 2011 07:33:09 -0700 Organization: A noiseless patient Spider Lines: 23 Message-ID: References: <9g2f24Fi0vU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 17 Oct 2011 14:33:11 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="XjIWM99mD7Ijfdu600oVPA"; logging-data="23524"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qmRmwqQ/GbobSKHhx9SK76tC2VbXZrrY=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: Cancel-Lock: sha1:BI4wDxMuml7g5j8Tddl1bsb/yfs= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8912 On 10/17/2011 5:14 AM, Steven Simpson wrote: > On 17/10/11 11:41, blmblm@myrealbox.com wrote: >> One fix is to just introduce a method setFromModified() in GThing, >> but that doesn't appeal to me. > > Instead of adding it to GThing, create a static method: > > private static void setModified(GThing t) { > t.set(t.modified()); > } I don't like the T here. While it compiles, this T is a different T than the other T. public class GThing { private static void setModified( GThing t ) { ...other T's stay the same. }