﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
17680	Suspicious code in Geometry.addIntersections()	GerdP	team	"The javadoc says
{{{
#!java
    /**
     * Will find all intersection and add nodes there for list of given ways.
     * Handles self-intersections too.
     * And makes commands to add the intersection points to ways.
     *
     * Prerequisite: no two nodes have the same coordinates.
     *
     * @param ways  a list of ways to test
     * @param test  if false, do not build list of Commands, just return nodes
     * @param cmds  list of commands, typically empty when handed to this method.
     *              Will be filled with commands that add intersection nodes to
     *              the ways.
     * @return list of new nodes
     */
}}}
I tried to use this method with a list of multipolygon ways like this
`Set<Node> selfIntersections = Geometry.addIntersections(ways, false, null);`

I got a NPE because in line 218 there is no check if test is set or not:
{{{
#!java
if (intNode == newNode) {
    cmds.add(new AddCommand(dataset, intNode));
}
}}}
I wonder if JoinAreasAction needs this or if it sometimes fails because of this. It uses the method like this:
{{{
    Set<Node> nodes = Geometry.addIntersections(allStartingWays, false, cmds);
}}}
"	defect	closed	minor	19.05	Core		fixed	javadoc	
