Re: [mkgmap-dev] Commit r4448: fix possible NPE introduced with r4432

2020-02-15 Thread Mike Baggaley
Hi Gerd, as I understand it, exceptions are passed up the call stack until a
handler is found. If no handler is found by the time main is reached, then
the program crashes. There is no need for a re-throw. See
https://www.geeksforgeeks.org/exceptions-in-java/

Cheers,
Mike

-Original Message-
From: Gerd Petermann [mailto:gpetermann_muenc...@hotmail.com] 
Sent: 15 February 2020 12:34
To: Development list for mkgmap 
Subject: Re: [mkgmap-dev] Commit r4448: fix possible NPE introduced with
r4432

Hi Mike,

the re-throw is the difference. The exception is now passed to the caller.

Gerd


Von: mkgmap-dev  im Auftrag von Mike
Baggaley 
Gesendet: Donnerstag, 13. Februar 2020 11:09
An: 'Development list for mkgmap'
Betreff: Re: [mkgmap-dev] Commit r4448: fix possible NPE introduced with
r4432

>Version mkgmap-r4448 was committed by gerd on Thu, 13 Feb 2020
>
>fix possible NPE introduced with r4432
>FileNotFoundException was ignored. May result in a NullPointerException
when input file is not in the expected format. e.g. with
>java -jar mkgmap.jar .

Hi Gerd, I can't see how this update can make any difference. The change
catches the FileNotFoundException and immediately re-throws it, so it
effectively does nothing. Looking at the call hierarchy,
FileNotFoundException is caught in createRawData, makeMap and loadCoastlines
so all the functions that call the load function directly or indirectly
catch the exception.

Regards,
Mike

___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] Commit r4448: fix possible NPE introduced with r4432

2020-02-15 Thread Mike Baggaley
>Version mkgmap-r4448 was committed by gerd on Thu, 13 Feb 2020
>
>fix possible NPE introduced with r4432
>FileNotFoundException was ignored. May result in a NullPointerException
when input file is not in the expected format. e.g. with
>java -jar mkgmap.jar .

Hi Gerd, I can't see how this update can make any difference. The change
catches the FileNotFoundException and immediately re-throws it, so it
effectively does nothing. Looking at the call hierarchy,
FileNotFoundException is caught in createRawData, makeMap and loadCoastlines
so all the functions that call the load function directly or indirectly
catch the exception.

Regards,
Mike

___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


[mkgmap-dev] Commit r4448: fix possible NPE introduced with r4432

2020-02-13 Thread svn commit
Version mkgmap-r4448 was committed by gerd on Thu, 13 Feb 2020

fix possible NPE introduced with r4432
FileNotFoundException was ignored. May result in a NullPointerException when 
input file is not in the expected format. e.g. with
java -jar mkgmap.jar .

http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap=4448
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev