Re: getTypeMap() returns null - bug?

From: Dave Cramer <davecramer(at)postgres(dot)rocks>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: rob stone <floriparob(at)gmail(dot)com>, javadesigner <javadesigner(at)yahoo(dot)com>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: getTypeMap() returns null - bug?
Date: 2020-05-12 10:00:25
Message-ID: CADK3HHKUD2EcSesJR21BGiS9BrsyVY4N511NPpm6OSXh+qxpew@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tue, 12 May 2020 at 00:26, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
wrote:

> On Monday, May 11, 2020, rob stone <floriparob(at)gmail(dot)com> wrote:
>
>>
>>
>> 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.
>
>
>>
> No, it wasn’t (its since been modified in between your two posts - you
> should skim the whole thread). Feel free to read the source code if you
> don’t believe the OP.
>
>
>> Highly likely it
>> contains hex zeroes. It could contain the string "empty" but that does
>> not sound reasonable
>
>
>>
> This would be the English idiom “speaking out of one’s a**” :)
>
>
>> 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.
>>
>
> Create an empty HashMap in Java and then print it out - that’s what we
> expected. Not “null” which only prints if the variable being printed is
> null.
>
> David J.
>

David,

Apparently you were correct. Throwing a notImplemented exception would be
better as this whole discussion is moot until being able to actually do
something with the typemap is implemented.

Dave Cramer
www.postgres.rocks

>
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Mark Rotteveel 2020-05-12 12:42:57 Re: getTypeMap() returns null - bug?
Previous Message David G. Johnston 2020-05-12 04:26:15 Re: getTypeMap() returns null - bug?