pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Rotteveel <mark@lawinegevaar.nl>
To: List <pgsql-jdbc@postgresql.org>
Subject: Re: Pre-processing during build
Date: Fri, 19 Jun 2015 08:48:45 +0200
Message-ID: <6682dee0335b1b04284ec1a060684d1a@imap.procolix.com> (raw)
In-Reply-To: <00bc01d0a9e7$595d4a50$0c17def0$@eu>
References: <000c01d0a7b6$97571ee0$c6055ca0$@eu>
	<CADK3HHK9TUug9amtabv1a+27u_bb31FCsLBarWsPv_PD12JCcw@mail.gmail.com>
	<CAB=Je-FC6NE7z=OMpfGRyOPk--Fw6Uci9iFbu+JQ1THfeuhgHA@mail.gmail.com>
	<CADK3HHJo=bjA9z=ZBzk-vqxfu+0Eh4UmLd0WJUhngKAVYogz8w@mail.gmail.com>
	<005101d0a86a$f18ffe90$d4affbb0$@eu>
	<CAB=Je-G1+7x4LabgB6A4cF_RY0CV1RwbDryFXa0GioB_vg7o=g@mail.gmail.com>
	<60b20bb834cf54db8232239b9c27fcc2@imap.procolix.com>
	<002901d0a93d$52152100$f63f6300$@eu>
	<CAB=Je-GNyaieUKzi-NCXrkRVyOGpXvMnfG3ry9RL4Tn-kTPf5w@mail.gmail.com>
	<00ac01d0a947$c3191f00$494b5d00$@eu>
	<CAB=Je-F62gyrkUE-iaHmqsxGtjynJZ-XVpX=Tu5dek1Hwd8N2A@mail.gmail.com>
	<00bc01d0a9e7$595d4a50$0c17def0$@eu>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

On Thu, 18 Jun 2015 18:53:49 +0200, "Markus KARG" <markus@headcrashing.eu>
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



view thread (92+ messages)  latest in thread

Message-ID: <6682dee0335b1b04284ec1a060684d1a@imap.procolix.com>
Permalink:  ../6682dee0335b1b04284ec1a060684d1a@imap.procolix.com/
Also on:    postgresql.org/message-id/6682dee0335b1b04284ec1a060684d1a@imap.procolix.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mark@lawinegevaar.nl
  Subject: Re: Pre-processing during build
  In-Reply-To: <6682dee0335b1b04284ec1a060684d1a@imap.procolix.com>
  References: <000c01d0a7b6$97571ee0$c6055ca0$@eu> <CADK3HHK9TUug9amtabv1a+27u_bb31FCsLBarWsPv_PD12JCcw@mail.gmail.com> <CAB=Je-FC6NE7z=OMpfGRyOPk--Fw6Uci9iFbu+JQ1THfeuhgHA@mail.gmail.com> <CADK3HHJo=bjA9z=ZBzk-vqxfu+0Eh4UmLd0WJUhngKAVYogz8w@mail.gmail.com> <005101d0a86a$f18ffe90$d4affbb0$@eu> <CAB=Je-G1+7x4LabgB6A4cF_RY0CV1RwbDryFXa0GioB_vg7o=g@mail.gmail.com> <60b20bb834cf54db8232239b9c27fcc2@imap.procolix.com> <002901d0a93d$52152100$f63f6300$@eu> <CAB=Je-GNyaieUKzi-NCXrkRVyOGpXvMnfG3ry9RL4Tn-kTPf5w@mail.gmail.com> <00ac01d0a947$c3191f00$494b5d00$@eu> <CAB=Je-F62gyrkUE-iaHmqsxGtjynJZ-XVpX=Tu5dek1Hwd8N2A@mail.gmail.com> <00bc01d0a9e7$595d4a50$0c17def0$@eu> <6682dee0335b1b04284ec1a060684d1a@imap.procolix.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox