Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: "Small" Program Challenge. Date: Thu, 21 Jun 2012 15:30:31 -0700 (PDT) Organization: http://groups.google.com Lines: 26 Message-ID: <32b02496-3dcd-4043-ba07-09f649e6c835@googlegroups.com> References: <7kIDr.12088$Bp1.3039@newsfe10.iad> <4291u795eegvb0j8b09lvqkng3hh13t336@4ax.com> <4732eeb4-9d34-4765-ba6d-c098f0528038@googlegroups.com> NNTP-Posting-Host: 69.28.149.29 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1340317831 14922 127.0.0.1 (21 Jun 2012 22:30:31 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 21 Jun 2012 22:30:31 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Received-Bytes: 2660 Xref: csiph.com comp.lang.java.programmer:15499 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, the condition to initialize the class was not met. -- Lew