Re: getTypeMap() returns null - bug? - Mailing list pgsql-jdbc

From rob stone
Subject Re: getTypeMap() returns null - bug?
Date
Msg-id c242e29538102940cdf6f398a6666dd7ff033e83.camel@gmail.com
Whole thread Raw
In response to Re: getTypeMap() returns null - bug?  (javadesigner <javadesigner@yahoo.com>)
Responses Re: getTypeMap() returns null - bug?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: getTypeMap() returns null - bug?  (Mark Rotteveel <mark@lawinegevaar.nl>)
List pgsql-jdbc

On Mon, 2020-05-11 at 02:28 -0400, javadesigner wrote:
> empty is not the same as null in java. this is a java specific 
> discussion btw.
> 

Vraimente.

java.util.Map map = con.getTypeMap();

So, the variable "map" is now an empty map object. Highly likely it
contains hex zeroes. It could contain the string "empty" but that does
not sound reasonable. Maybe there is no memory address and memory is
only allocated with the first "put".

System.out.println("map:"+map);

So, println accesses the memory occupied by the object and assuming it
contains unprintable hex zeroes, it can either display "null", or
convert to printable zeroes or ignore it and display nothing.

What output did you expect from  "System.out.println("map:"+map);"??
That is the question.






pgsql-jdbc by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: getTypeMap() returns null - bug?
Next
From: "David G. Johnston"
Date:
Subject: Re: getTypeMap() returns null - bug?