From: Markus KARG <markus@headcrashing.eu>
To: 'List' <pgsql-jdbc@postgresql.org>
Subject: Re: Pre-processing during build
Date: Tue, 16 Jun 2015 21:18:17 +0200
Message-ID: <003a01d0a869$3312b1c0$99381540$@eu> (raw)
In-Reply-To: <CAH7T-ap2yMyiCEEajffqd863Dpnjag_LVvWPnP5PuARpbbJ1UA@mail.gmail.com>
References: <000c01d0a7b6$97571ee0$c6055ca0$@eu>
<CADK3HHK9TUug9amtabv1a+27u_bb31FCsLBarWsPv_PD12JCcw@mail.gmail.com>
<CAH7T-ap2yMyiCEEajffqd863Dpnjag_LVvWPnP5PuARpbbJ1UA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
To make things a bit more clear: It is NOT about whether or not an interface method has a parameter of an unknown type. It is solely about whether that method is actually INVOKED at runtime. As a JDBC42 is unknown to a JDBC3 client, that client CANNOT invoke that method, hence NEVER a ClassNotFoundException can ever happen. Actually the cause of the exception is not even the method invocation but it is solely the instantiation of the parameter value which happens IN THE CALLER. We're pretty safe I think. So still I do not see any need for separate JARs for the purpose of serving multiple JDBC levels, as long as the byte code is Java 6 level.
From: Sehrope Sarkuni [mailto:sehrope@jackdb.com]
Sent: Dienstag, 16. Juni 2015 00:42
To: Dave Cramer
Cc: Markus KARG; List
Subject: Re: [JDBC] Pre-processing during build
On Mon, Jun 15, 2015 at 6:17 PM, Dave Cramer <pg@fastcrypt.com> wrote:
How can you use the same name and different bytecode versions ?
Short answer is you can't.
Longer answer is, as long as the classes don't use types that aren't defined in the newer interface, you can include implementations for methods that aren't defined in an older interface definition. It's only a problem if those methods use types that don't exist (ex: if a function signature used the new Java 8 time types). You'd also need to either compile with the older target bytecode version or actually build multiple versions off the same source.
I think a purely Maven based build with separate targets should be possible via a generated-sources plugin. Off the top of my head I'm not sure which plugins it would use though. It's been a while since I wrote anything like that though I do remember it being a bit of a pain to get right. On the plus side we only have to figure it out once right? :)
I'm a big fan of Mavenizing the build process. A lot of the value of it will come from how it will simplify things like adding tests. It eliminates a lot of the double and sometimes triple entry (i.e. add the test class, add it to a suite, add the suite to build.xml).
Regards,
-- Sehrope Sarkuni
Founder & CEO | JackDB, Inc. | https://www.jackdb.com/
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: markus@headcrashing.eu
Subject: Re: Pre-processing during build
In-Reply-To: <003a01d0a869$3312b1c0$99381540$@eu>
References: <000c01d0a7b6$97571ee0$c6055ca0$@eu> <CADK3HHK9TUug9amtabv1a+27u_bb31FCsLBarWsPv_PD12JCcw@mail.gmail.com> <CAH7T-ap2yMyiCEEajffqd863Dpnjag_LVvWPnP5PuARpbbJ1UA@mail.gmail.com> <003a01d0a869$3312b1c0$99381540$@eu>
* 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