Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z5q6f-0002p3-1s for pgsql-jdbc@arkaria.postgresql.org; Fri, 19 Jun 2015 06:48:53 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z5q6e-0006b3-15 for pgsql-jdbc@arkaria.postgresql.org; Fri, 19 Jun 2015 06:48:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Z5q6d-0006ax-Dy for pgsql-jdbc@postgresql.org; Fri, 19 Jun 2015 06:48:51 +0000 Received: from smtp.procolix.com ([95.215.185.30]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1Z5q6a-0007Ab-KP for pgsql-jdbc@postgresql.org; Fri, 19 Jun 2015 06:48:50 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp.procolix.com (Postfix) with ESMTP id 1DC5643E78 for ; Fri, 19 Jun 2015 08:48:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smtp.procolix.com Received: from smtp.procolix.com ([127.0.0.1]) by localhost (host436.procolix.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J4j8Gcnk-N0i for ; Fri, 19 Jun 2015 08:48:45 +0200 (CEST) Received: from webmail.procolix.com (webmail.procolix.com [95.215.185.106]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mark@lawinegevaar.nl) by smtp.procolix.com (Postfix) with ESMTPSA id DA41543DC6 for ; Fri, 19 Jun 2015 08:48:45 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: Fri, 19 Jun 2015 08:48:45 +0200 From: Mark Rotteveel To: List Subject: Re: Pre-processing during build In-Reply-To: <00bc01d0a9e7$595d4a50$0c17def0$@eu> References: <000c01d0a7b6$97571ee0$c6055ca0$@eu> <005101d0a86a$f18ffe90$d4affbb0$@eu> <60b20bb834cf54db8232239b9c27fcc2@imap.procolix.com> <002901d0a93d$52152100$f63f6300$@eu> <00ac01d0a947$c3191f00$494b5d00$@eu> <00bc01d0a9e7$595d4a50$0c17def0$@eu> Message-ID: <6682dee0335b1b04284ec1a060684d1a@imap.procolix.com> X-Sender: mark@lawinegevaar.nl User-Agent: RoundCube Webmail/0.2 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On Thu, 18 Jun 2015 18:53:49 +0200, "Markus KARG" wrote: > Regarding your questions and just for couriosity, even being irrelevant > due to the reflection topic meanwhile: My example also fails even without > (!) reflection once you remove the inner class and simply have the Java 8 > method implemented directly by the main class. Hence it proofs the special > restriction for main classes. That restriction is the difference between > 12.1 (= how an initial class is loaded) and 12.2 (= how other classes are > loaded). It is an optional implementation choice of the Oracle JVM to do > so: It demands that ALL references from main class to other classes MUST > have existing byte code. This demand does not exists for classes NOT > directly references but loaded lazily at a later time (following 12.2 rules > ONLY but not 12.1 rules). Just change my example and you'll see the effect > - it fails immediately as soon as there is no wrapping inner class anymore > decoupling the missing classes from the main class. JLS 12.1 is defined in terms of the normal class loading and initialization that is described in later sections. They even say "We now outline the steps the Java Virtual Machine may take to execute Test, as an example of the loading, linking, and initialization processes that are described further in later sections.". The only difference I see is section 12.1.4: invoking the main method. If you see other difference I'd like you to point them out. If you look at the stacktrace when method is directly in the main class, you'll notice that the JVM itself uses reflection to obtain and execute the main method. And that use of reflection is what causes it to fail immediately as opposed to the case with a separate class. Mark -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc