Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Z4wNG-0001fL-Cb for pgsql-jdbc@arkaria.postgresql.org; Tue, 16 Jun 2015 19:18:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Z4wNF-0002nd-SZ for pgsql-jdbc@arkaria.postgresql.org; Tue, 16 Jun 2015 19:18:17 +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 1Z4wNE-0002lt-FW for pgsql-jdbc@postgresql.org; Tue, 16 Jun 2015 19:18:16 +0000 Received: from smtprelay04.ispgateway.de ([80.67.31.38]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Z4wNA-0006D7-MR for pgsql-jdbc@postgresql.org; Tue, 16 Jun 2015 19:18:15 +0000 Received: from [88.66.7.101] (helo=Zauselmaus) by smtprelay04.ispgateway.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84) (envelope-from ) id 1Z4wN7-0004hc-Vh for pgsql-jdbc@postgresql.org; Tue, 16 Jun 2015 21:18:10 +0200 From: "Markus KARG" To: "'List'" References: <000c01d0a7b6$97571ee0$c6055ca0$@eu> In-Reply-To: Subject: Re: Pre-processing during build Date: Tue, 16 Jun 2015 21:18:17 +0200 Organization: Markus KARG, Staatl. gepr. Inf. Message-ID: <003a01d0a869$3312b1c0$99381540$@eu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_003B_01D0A879.F69B81C0" X-Mailer: Microsoft Office Outlook 12.0 Content-Language: de Thread-Index: AdCnvIYkvR8LdSZjRFio3LIzA7bWjwArAaeg X-AVK-Virus-Check: AVA 25.1869;71FD75 X-AVK-Spam-Check: 1; str=0001.0A0C0202.55807671.02B8,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0; F1206 X-Df-Sender: bWFya3VzQGhlYWRjcmFzaGluZy5ldQ== X-Pg-Spam-Score: -2.6 (--) 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 This is a multi-part message in MIME format. ------=_NextPart_000_003B_01D0A879.F69B81C0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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. =20 From: Sehrope Sarkuni [mailto:sehrope@jackdb.com]=20 Sent: Dienstag, 16. Juni 2015 00:42 To: Dave Cramer Cc: Markus KARG; List Subject: Re: [JDBC] Pre-processing during build =20 On Mon, Jun 15, 2015 at 6:17 PM, Dave Cramer wrote: How can you use the same name and different bytecode versions ? =20 Short answer is you can't. =20 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. =20 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? :) =20 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). =20 Regards, -- Sehrope Sarkuni Founder & CEO | JackDB, Inc. | https://www.jackdb.com/ =20 ------=_NextPart_000_003B_01D0A879.F69B81C0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

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/

=

 

------=_NextPart_000_003B_01D0A879.F69B81C0--