Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: blmblm@myrealbox.com Newsgroups: comp.lang.java.programmer Subject: Re: generics puzzle Date: 18 Oct 2011 14:48:52 GMT Organization: None Lines: 49 Message-ID: <9g5hukFnnbU1@mid.individual.net> References: <9g2f24Fi0vU1@mid.individual.net> <33utm8-qs4.ln1@news.simpsonst.f2s.com> X-Trace: individual.net jAyxGhExHCKtReu6pylVKQO0BqdEP0xcRNbgDnHbvHs2MhqXsH X-Orig-Path: not-for-mail Cancel-Lock: sha1:JDKeh4Lez+AlFrLja3LEHPRvoGE= X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8951 In article <33utm8-qs4.ln1@news.simpsonst.f2s.com>, Steven Simpson wrote: > On 17/10/11 15:33, markspace wrote: > > 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()); > >> } Hm, yes, that works; thanks! > > > > I don't like the T here. While it compiles, this T is a different T > > than the other T. > > Ah, T time! ;-) > > > public class GThing { > > > > private static void setModified( GThing t ) { > > > > ...other T's stay the same. > > } > > I meant that the static method didn't belong in GThing at all. That was kind of my feeling, but -- I'm kind of ambivalent about it, because there are a couple of "call sites" (to use your term) where I seem to need this kind of thing. > The > author of the call site factors it out of his code, and keeps it near > the call site, in order to deal with an issue that arises very > specifically out of the design of that site. Ideally, it would be an > Ada-like local method, but he has to settle for a near-by static. The > author of GThing is unaware of it, and is not responsible for it. Wrong gender for the author of the call site here, but okay, pet peeve of mine, and off-topic, and IIRC discussed recently enough that we shouldn't repeat it .... -- B. L. Massingill ObDisclaimer: I don't speak for my employers; they return the favor.