Re: Pre-processing during build - Mailing list pgsql-jdbc

From Markus KARG
Subject Re: Pre-processing during build
Date
Msg-id 003a01d0a869$3312b1c0$99381540$@eu
Whole thread Raw
In response to Re: Pre-processing during build  (Sehrope Sarkuni <sehrope@jackdb.com>)
Responses Re: Pre-processing during build
List pgsql-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/

 

pgsql-jdbc by date:

Previous
From: "Markus KARG"
Date:
Subject: Re: Pre-processing during build
Next
From: "Markus KARG"
Date:
Subject: Re: Pre-processing during build