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: Wed, 20 Jun 2012 21:22:30 -0400 Organization: media lab? Lines: 38 Message-ID: References: <7kIDr.12088$Bp1.3039@newsfe10.iad> <4291u795eegvb0j8b09lvqkng3hh13t336@4ax.com> <4732eeb4-9d34-4765-ba6d-c098f0528038@googlegroups.com> NNTP-Posting-Host: y4noUEMC8u/SvRWFa5JPRw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; 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:15478 On 20/06/2012 6:34 AM, Andreas Leitgeb wrote: > Lew wrote: >> Leif Roar Moldskred wrote: >>> javax.swing.JSnarker wrote: >>>> Not relevant here, unless you're claiming you've seen in real code where >>>> a static method began to be invoked and the class was *still* not >>>> initialized. > > It all boils down to the true definition of "invocation". > > Is it the moment when the instruction pointer hits the bytecode for > invokestatic and starts doing it, Obviously, and more or less by definition of "invokestatic". > JVM7-behaviour implies the latter. The spec implies the former, though with sufficient ambiguity as to have confused the hell out of Leif and Lew. And the name of the opcode "invokestatic" also implies the former, as does the behavior of JVM6, JVM5, ... > Anyway, between these two moments, there's plenty time for the JVM > to load the class, check availability of the method, and only if ok > then initialize the class and proceed with the callee's code, > otherwise skip initialization and just throw some exception. > And for a certain definition of "invocation", initialization > would still always precede it. A kooky definition. -- 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.