Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

patch to avoid a NullPointerException

13 views
Skip to first unread message

Derrick Hudson

unread,
Feb 16, 2013, 12:15:45 AM2/16/13
to
I have observed a NullPointerException raised in PGobject.equals().
The attached patch checks for a null value and avoids raising an
exception.

I am working with an application which makes extensive use of
user-defined types, particularly enums, and also uses EclipseLink. I
found it necessary to create EclipseLink converters to convert from
the Java representation of the user-defined types to a PGobject so
that PgJDBC sends the correct type information to the PostgreSQL
server. It appears to be necessary to create an PGobject instance
with the correct type label and a null value in order to store a NULL
in a column with a user-defined type. However, this results in a
NullPointerException when EclipseLink tests the two PGobject instances
for equality.

-Derrick

patch

Dave Cramer

unread,
Feb 20, 2013, 7:01:00 AM2/20/13
to
Derrick,

Thanks, applied

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


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


Kris Jurka

unread,
Feb 20, 2013, 2:36:34 PM2/20/13
to


On Wed, 20 Feb 2013, Dave Cramer wrote:

> Derrick,
> Thanks, applied
>

Shouldn't this be backpatched to all stable branches?

Kris Jurka

Dave Cramer

unread,
Feb 20, 2013, 2:49:02 PM2/20/13
to
Ya, I would think so too. I'm just trying to knock what I can in my limited available time.



Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca


Kris Jurka

unread,
Mar 26, 2013, 8:48:46 AM3/26/13
to


On Wed, 20 Feb 2013, Dave Cramer wrote:

> Ya, I would think so too. I'm just trying to knock what I can in my limited
> available time.
>

I have backpatched this to all relevant versions.
0 new messages