Thread: PATCH: JDBC compile w/ jikes

PATCH: JDBC compile w/ jikes

From
Neil Conway
Date:
Hi all,

The JDBC2 driver included with PostgreSQL 7.1 doesn't compile
with jikes (1.13). Here's the errors you get:

    [javac] Compiling 41 source files to /home/nconway/postgresql-7.1/src/interfaces/jdbc/build
    [javac]
    [javac] Found 3 semantic errors compiling
"/home/nconway/postgresql-7.1/src/interfaces/jdbc/org/postgresql/jdbc2/DatabaseMetaData.java":
    [javac]
    [javac]   1691.     case 'r':
    [javac]                      <->
    [javac] *** Error: The type of this expression, "char", is not assignment-convertible to the type of the switch
statementexpression, "byte". 
    [javac]
    [javac]
    [javac]   1694.     case 'i':
    [javac]                      <->
    [javac] *** Error: The type of this expression, "char", is not assignment-convertible to the type of the switch
statementexpression, "byte". 
    [javac]
    [javac]
    [javac]   1697.     case 'S':
    [javac]                      <->
    [javac] *** Error: The type of this expression, "char", is not assignment-convertible to the type of the switch
statementexpression, "byte". 

I'm not sure if this is a bug with jikes, or if Sun's javac is just lax.

Attached is a trivial patch which fixes it for me (it compiles, at any rate).

Cheers,

Neil

--
Neil Conway <neilconway@home.com>
Get my GnuPG key from: http://klamath.dyndns.org/mykey.asc
Encrypted mail welcomed

Freedom of the press is limited to those who own one.
        -- A.J. Liebling

Attachment

Re: PATCH: JDBC compile w/ jikes

From
Peter T Mount
Date:
Quoting Neil Conway <nconway@klamath.dyndns.org>:

Sorry for the late reply, I'm about 7 days behind with emails at the moment.
Slowly catching up ;-)

> Hi all,
>
> The JDBC2 driver included with PostgreSQL 7.1 doesn't compile
> with jikes (1.13). Here's the errors you get:

[snip]

>     [javac]   1694.     case 'i':

> I'm not sure if this is a bug with jikes, or if Sun's javac is just
> lax.

Yes, it could be that jikes is more precise to the spec than javac is.

> Attached is a trivial patch which fixes it for me (it compiles, at any
> rate).

Looking at it, it looks ok.

Peter

--
Peter Mount peter@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/