Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Java generics and type erasure Date: Thu, 26 May 2011 07:45:51 -0400 Organization: albasani.net Lines: 20 Message-ID: References: <9d4c2b16-beb5-40b1-87a2-f03e971efeed@k17g2000vbn.googlegroups.com> <4dde10b0$0$67777$c30e37c6@exi-reader.telstra.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net gMxVgl5WcAEfL7kMNug4lzNjm+p0C8M4ffcuxwgDvxhhrNxO8FbMuAuuuVddeVe3kL4tsRGXpUqoWPuPs1eLYUrCQpcq5UVsy0yTgpxNfhksT6twBH4oSqggsWl0iarL NNTP-Posting-Date: Thu, 26 May 2011 11:45:14 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="r3PnfH0TWu/y+ygYoC8zJL9OXkYulBVOGhHGbbL+F1N05WA0UCNEt76VA9QPDChwWLo5zeD2sya0Sfuu1+AXM7G5ecxyHAAPlHfvXmZwDLoch9iIWue8s5mw/zuONz2/"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 In-Reply-To: <4dde10b0$0$67777$c30e37c6@exi-reader.telstra.net> Cancel-Lock: sha1:D4HvNNm9ltNsgzsuAyJHECR3dX8= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4595 On 05/26/2011 04:34 AM, Esmond Pitt wrote: > On 26/05/2011 4:48 PM, Lawrence D'Oliveiro wrote: >>> No -- presumably, it would have caused problems compiling 1.4 source code >>> against 1.5's libraries, not running existing 1.4 bytecode linked to 1.5 >>> libraries. >> >> In Java terms, what’s the difference? > > The difference is that generic type-signatures are present in .class files for > compilation purposes even though generics are erased to their lower bounds at > runtime, so that the compiler can enforce the semantics of generics. This contradicts the statement that Ian Shef made upthread that type erasure occurs in compilation. It seems I was correct after all, and that it really does happen at runtime. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg