Path: csiph.com!usenet.pasdenom.info!aioe.org!.POSTED!not-for-mail From: "javax.swing.JSnarker" Newsgroups: comp.lang.java.programmer Subject: Re: "Small" Program Challenge. Date: Thu, 21 Jun 2012 20:28:50 -0400 Organization: media lab? Lines: 35 Message-ID: References: <7kIDr.12088$Bp1.3039@newsfe10.iad> <4291u795eegvb0j8b09lvqkng3hh13t336@4ax.com> <4732eeb4-9d34-4765-ba6d-c098f0528038@googlegroups.com> <32b02496-3dcd-4043-ba07-09f649e6c835@googlegroups.com> NNTP-Posting-Host: QMvkqwgQTSa35o56g4Mhjg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: NewsTap/3.5.5 (iPhone/iPod Touch) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:15501 On 21/06/2012 6:30 PM, Lew wrote: > javax.swing.JSnarker wrote: >> Andreas Leitgeb wrote: >>> compile both (with Java 6), run B: >>> B static init >>> B static main >>> A static init >>> A static foo >>> Then comment out the method "foo()" from A, >>> recompile only A, run B: >>> B static init >>> B static main >>> Exception in thread "main" java.lang.NoSuchMethodError: A.foo()V >>> at B.main(B.java:4) >>> Note: no initialization of A, even with Java 6. >> >> So, even Java 6 has a version of the bug. Interesting. I don't see how >> the remark about "declared by T" is relevant here, since foo clearly is >> declared by A in your example that reproduces the bug. > > Of what bug do you speak? > > Since no static method of 'A' was called in the second run, There was a call to A.foo(). That the call did not *succeed* doesn't mean that it didn't *exist*. If the call didn't exist, what threw the exception, and why? -- public final class JSnarker extends JComponent A JSnarker is an NNTP-aware component that asynchronously provides snarky output when the Ego.needsPuncturing() event is fired in cljp.