Re: Issue with PSQL JDBC Driver Null Pointer

From: Bhavesh Mistry <bhavesh(dot)mistry13(at)gmail(dot)com>
To: Dave Cramer <davecramer(at)postgres(dot)rocks>
Cc: Discuss List Postgres <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Issue with PSQL JDBC Driver Null Pointer
Date: 2021-07-29 21:12:12
Message-ID: CAD1effjUeaPHq7y_bCxFJNSWtWBuHHsxFbfgvA5KUz1YAe9njg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks for fixing it.

Thanks,

Bhavesh

On Thu, Jul 29, 2021 at 12:49 PM Dave Cramer <davecramer(at)postgres(dot)rocks>
wrote:

>
>
> On Thu, 29 Jul 2021 at 15:44, Bhavesh Mistry <bhavesh(dot)mistry13(at)gmail(dot)com>
> wrote:
>
>> Hi Dave,
>>
>> It still does not address the NPE issue. If an alias is NULL. What
>> should be the behavior?
>>
>>
>> public String getTypeForAlias(String alias) {
>> String type = TYPE_ALIASES.get(alias);
>> if (type != null) {
>> return type;
>> }
>> type = TYPE_ALIASES.get(alias.toLowerCase()) *// NPE STILL HERE*;
>> if (type == null) {
>> type = alias;
>> }
>> //populate for future use
>> TYPE_ALIASES.put(alias, type);
>> return type;
>> }
>>
>
> Very good question. I guess we should return null in this case.
>
> I'll fix that
>
> Dave
>

--
Thanks,

Bhavesh

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2021-07-30 16:04:39 Re: Have I found an interval arithmetic bug?
Previous Message Edson Carlos Ericksson Richter 2021-07-29 20:41:14 Re: Issue with PSQL JDBC Driver Null Pointer