Project

Profile

Help

Revision 000e58a2

Added by Michael Kay over 12 years ago

fix bug 2787726 - Two xsl:key declarations with same name

View differences:

latest9.1/bj/net/sf/saxon/trans/KeyManager.java
368 368
                    // not ideal for performance, but it's very unusual to have more than
369 369
                    // one key definition for a key.
370 370
                    LocalOrderComparer comparer = LocalOrderComparer.getInstance();
371
                    boolean found = false;
371 372
                    for (int i=0; i<nodes.size(); i++) {
372 373
                        int d = comparer.compare(curr, (NodeInfo)nodes.get(i));
373 374
                        if (d<=0) {
......
377 378
                                // add the node at this position
378 379
                                nodes.add(i, curr);
379 380
                            }
380
                            return;
381
                            found = true;
382
                            break;
381 383
                        }
382 384
                        // else continue round the loop
383 385
                    }
384 386
                    // if we're still here, add the new node at the end
385
                    nodes.add(curr);
387
                    if (!found) {
388
                        nodes.add(curr);
389
                    }
386 390
                }
387 391
            }
388 392
        }

Also available in: Unified diff