[josm-dev] Jumbo Patch
Dave Hansen
dave at sr71.net
Sat Dec 15 19:58:20 GMT 2007
On Sat, 2007-12-15 at 10:56 +0100, Gabriel Ebner wrote:
>
> As we're speeding up way-on-node lookups one way or another anyhow,
> couldn't
> we just filter out the unwanted errors? I.e. something like this:
>
> @Override
> public void endTest()
> {
> for(List<OsmPrimitive> duplicated : nodes.values() )
> {
> if( duplicated.size() > 1)
> {
> boolean wantedError = false;
>
> Set<String> types = new HashSet<String>();
> for (OsmPrimitive p : duplicated) {
> Set<String> nodeTypes = new HashSet<String>();
> for (Way w : waysForNode((Node) p)) {
> String type = getType(w);
> if (types.contains(type)) {
> wantedError = true;
> }
> nodeTypes.add(type);
> }
> types.addAll(nodeTypes);
> }
>
> if (!wantedError) continue;
>
> TestError testError = new TestError(this, Severity.ERROR, tr("Duplicated nodes"), duplicated);
> errors.add( testError );
> }
> }
> nodes = null;
> }
I was looking through this in more detail, and I can't figure out quite
what you're trying to do.
Could you clarify it with a few commands, and clarify the types and
nodeTypes variable names? I swear nodeTypes should be wayTypes.
-- Dave
More information about the josm-dev
mailing list