Re: Issue with PSQL JDBC Driver Null Pointer

From: Dave Cramer <davecramer(at)postgres(dot)rocks>
To: Bhavesh Mistry <bhavesh(dot)mistry13(at)gmail(dot)com>
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 19:48:44
Message-ID: CADK3HHL2A=KJ8pZr9eNnf2+5FAjEspAVsTAmobAB0To2UUxNHQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Edson Carlos Ericksson Richter 2021-07-29 20:41:14 Re: Issue with PSQL JDBC Driver Null Pointer
Previous Message Bhavesh Mistry 2021-07-29 19:44:30 Re: Issue with PSQL JDBC Driver Null Pointer