logo separator

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

From Mike Baggaley mike at tvage.co.uk on Sat Feb 15 16:03:23 GMT 2020

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_muenchen at hotmail.com] 
Sent: 15 February 2020 12:34
To: Development list for mkgmap <mkgmap-dev at lists.mkgmap.org.uk>
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 <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Mike
Baggaley <mike.baggaley at basfordltc.co.uk>
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 at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev




More information about the mkgmap-dev mailing list