Re: Pre-processing during build

From: "Markus KARG" <markus(at)headcrashing(dot)eu>
To: "'List'" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Pre-processing during build
Date: 2015-06-17 20:09:09
Message-ID: 002601d0a939$793152d0$6b93f870$@eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Mark,

the chapters you describe list explicitly the exceptions that can happen, and the causes. None of them covers "a class is referenced that has a non-referenced method that has a non-existent class".

Even with early resolution, the JLS does not cover the case we have, which is containing non-existent classes in non-referenced methods of referenced classes!

The devil's in the details, right? ;-)

Hence we're still safe.

If that won't work, nobody could write a Java EE program and compile and test it agains the official javaee.jar, as that one not even contains ANY byte code but SOLELY declarations. And that one's an official JAR from the makers of Java!

Regards
-Markus

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org [mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Mark Rotteveel
Sent: Mittwoch, 17. Juni 2015 09:03
To: List
Subject: Re: [JDBC] Pre-processing during build

On Tue, 16 Jun 2015 21:26:12 +0200, "Markus KARG" <markus(at)headcrashing(dot)eu>
wrote:
> So it boils down to verification and I doubt that the bytecode
> verifier will try to actually load java.sql.Type class. Have you
> really tried
this
> out or do you have another link where it is written that the byte code
> verifier will CHECK the existence of a parameter class when it
> verifies
the
> loaded class?

It looks like the JLS and JVM specification allow for resolution of symbolic references at classloading or "first use" and a JVM implementation is free to choose: see
http://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.1.2 and
http://docs.oracle.com/javase/specs/jls/se8/html/jls-12.html#jls-12.3

Although I am not entirely sure about this, I interpret this that loading a class that has a method whose signature includes a type that is not available (like SQLType on Java 7 or lower) could work on one JVM implementation (late resolution), but not on others (early resolution).

Mark

--
Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org) To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Markus KARG 2015-06-17 20:36:42 Re: Pre-processing during build
Previous Message Dave Cramer 2015-06-17 18:47:48 Re: Pre-processing during build