Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!newsfeed.utanet.at!newscore.univie.ac.at!aconews-feed.univie.ac.at!aconews.univie.ac.at!not-for-mail Newsgroups: comp.lang.java.programmer From: Andreas Leitgeb Subject: Re: eclipse and un-generics References: Reply-To: avl@logic.at User-Agent: slrn/pre0.9.9-111 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: Date: 22 Oct 2011 23:04:42 GMT Lines: 29 NNTP-Posting-Host: gamma.logic.tuwien.ac.at X-Trace: 1319324682 tunews.univie.ac.at 10322 128.130.175.3 X-Complaints-To: abuse@tuwien.ac.at Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9096 Joshua Cranmer wrote: > On 10/20/2011 12:11 PM, Andreas Leitgeb wrote: >> My attempt to use Class as argument type in the implementing >> class failed, and I'm not sure I understand the deeper reasons of >> why this has to fail. I.e. why it doesn't just see it as an override >> instead of complaining about a bad overload. > While Class is often treated as being the generic equivalent of > Class, they're not quite the same thing. Logically, "Class" means "a > class of anything", while "Class" means "a class of some unknown type". I see the relevance for e.g. List versus List where the former (unlike the latter) could not be add()ed an Object-typed item. I don't see, how it could make a difference for Class versus Class, of which no method takes any "T"-typed arguments, nor do any methods of the ""-parameterized return-value-types (like e.g. Constructor). But then again, I do see, that the JLS just doesn't go that far into analysis of where does make a difference, and where it doesn't. > Indeed, if anything, "Class" is probably closer in typing terms to > "Class", although there are a slew of special rules to account > for the fact that "Class" is probably very rarely meant. I'll try on Monday (to be sure), but I really don't expect (Class clazz) to be valid arguments for an overRIDE of a superclass's method taking (Class clazz). Anyway, I appreciate your response, making me aware that isn't semantically the closest to the bare type, afterall.