logo separator

[mkgmap-dev] Commit: r1566: Drop all tags from the osm file that are not used

From Marko Mäkelä marko.makela at iki.fi on Thu Feb 11 19:11:22 GMT 2010

On Thu, Feb 11, 2010 at 07:59:01PM +0100, WanMil wrote:
> The Osm5XMLHandler sometimes throw a NullPointerException in line 397. 
> This is the key.equals("highway") part:
> 
> if((val.equals("motorway_junction") ||
> 	val.equals("services")) &&
> 	key.equals("highway"))
> {
> 	exits.add(currentNode);
> 	currentNode.addTag("osm:id", "" + currentElementId);
> }
> 
> It might be fixed by changing it to "highway".equals(key).

Right, java.lang.Object.equals(Object other) specifically says that you can
pass other=null and the result will be false.  On the other hand, invoking
a method on a null reference will throw a NullPointerException.

	Marko



More information about the mkgmap-dev mailing list