Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.help Subject: Re: Sorry for disturbing this page.....I need help Again Date: Sat, 12 Nov 2011 10:01:23 -0800 (PST) Organization: http://groups.google.com Lines: 53 Message-ID: <20207007.1619.1321120883634.JavaMail.geo-discussion-forums@prdy11> References: <508339c1-3b13-4c0f-a2b4-d3af4be61ab6@e2g2000vbb.googlegroups.com> Reply-To: comp.lang.java.help@googlegroups.com NNTP-Posting-Host: 173.164.137.214 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1321121325 15755 127.0.0.1 (12 Nov 2011 18:08:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 12 Nov 2011 18:08:45 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.help:1331 John B. Matthews wrote: > [5] Dr. Dude, your site rocks. If it had a +1 button I'd click it. Heck, I'll just post about it on G+ myself. I only have one stylistic objection, to the use of 'this.' with function ca= lls. It provides no semantic or documentary advantage, as the method may b= e invoked on a supertype definition, same-type definition or subtype-defini= tion irrespective of the 'this.' qualifier. (JLS =A715.12) For Roedy: The cited JLS section is a candidate for "The Most Convoluted Wo= rding" award, and is very tricky to follow. I advise to let your mind glid= e over the details like, "Let m be a potentially applicable method (=A715.1= 2.2.1), let e1, ..., en be the actual argument expressions of the method in= vocation and let Ai be the type of ei, 1 <=3D i <=3D n." Your mental simpl= ification is just, "The argument types have to match." Then you skip over,= for now, the subparagraph that describes precisely how they have to match. Likewise you skip over, for now, the parts that deal with generics. Eventually you simplify that whole section down to, "The number and types o= f arguments have to match, the return type has to be at least a subtype of = the invocation's return type, and you have to reach as far down the inherit= ance chain as possible for it. If that confuses the compiler, you get a co= mpiler error. Generics make it more complicated." This is where study of the JLS pays off, even in the parts that are as diff= icult as one might fear. It's a matter of eliding the details in your mind= until you get a succinct yet complete summary of the rules in your head. = ("Complete" allows for certain handwaving like "Generics make it more compl= icated." That's because the situation is sufficiently cornerish to merit l= ooking it up again if there's confusion.) Another point - this is not a section for a single reading. Every single t= ime I run into a situation, be it a code problem or a Usenet post, that cal= ls upon understanding of this particular section, I reread the section. So= metimes I read it just for fun. Each time, I either re-summarize as above,= or I delve into one of those corners that I avoided in panic before. I mi= ght take an hour just to understand one phrase or sentence like,=20 "If m is a generic method as described above then Ul <: Bl[R1 =3D U1, ..., = Rp =3D Up], 1 <=3D l <=3D p." [Watch the ones and ells in the above; your typeface may vary.] It's time well spent. --=20 Lew