Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!feeder2.ecngs.de!ecngs!feeder.ecngs.de!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 23 Apr 2013 10:37:17 -0500 Date: Tue, 23 Apr 2013 16:37:15 +0100 From: lipska the kat <"nospam at neversurrender dot co dot uk"> Organization: Trollbusters 3 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 Newsgroups: comp.lang.java.programmer Subject: Re: References: <9h4i4a-kvp.ln1@tempest.fredriksson.dy.fi> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 27 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-ECUpXcAy2woVqO/aTFgdZrZF9DEcxE9zNOeFcjYxSUaDhgKTT9wm6QSX+pxQ4RqrEQHk4ifXLYwyqyN!8TWLHjf+EgbDo6YZx4rxjiid+8jxd+91RHyZVRIpOnhopyYybl6/3sUqu+Hy3IkkmnFyhJbi7Dc= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2821 Xref: csiph.com comp.lang.java.programmer:23587 On 23/04/13 14:55, Steven Simpson wrote: > On 23/04/13 11:31, Donkey Hottie wrote: >> 23.04.2013 12:48, Steven Simpson kirjoitti: >>> public static String generateWindowsArgument(List >>> args) { >> java.lang.String is final, so nothing can extend it. >> > > It's a matter of habit drawn from the general principle that if I don't > need to modify the list, I don't impose the additional, unnecessary > constraint on the caller, regardless of the element type. I don't understand this. In the first place List says nothing about your ability to modify the list, you can add and remove Strings to your hearts content, secondly the only type you can pass as argument to generateWindowsArgument is List so the construct is redundant anyway In fact, given that >>extends String<< is effectively meaningless I'm surprised the compiler doesn't at least issue a warning. I suppose you get away with it because compile time type erasure gets rid of any type arguments and as there can be only one type of argument anyway a warning would be superfluous. lipska -- Lipska the KatŠ: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun