Project

Profile

Help

Revision a563efd0

Added by Michael Kay over 12 years ago

Further changes for bug 2688838 (XQuery Update test suite)

View differences:

latest9.1/bj/net/sf/saxon/tree/ElementImpl.java
391 391
                    return;
392 392
                }
393 393
                if ((namespaceList[i]&0xffff0000) == (nscode&0xffff0000)) {
394
                    if (externalCall) {
394
                    if ((namespaceList[i]&0x0000ffff) == 0) {
395
                        // this is an undeclaration; replace it with the new declaration
396
                        namespaceList[i] = nscode;
397
                    } else if (externalCall) {
395 398
                        throw new IllegalArgumentException("New namespace conflicts with existing namespace binding");
396 399
                    } else {
397 400
                        return;
......
591 594
        if (namespaceList!=null) {
592 595
            for (int i=0; i<namespaceList.length; i++) {
593 596
                if ((namespaceList[i]>>16) == prefixCode) {
594
                    return (short)(namespaceList[i] & 0xffff);
597
                    short u = (short)(namespaceList[i] & 0xffff);
598
                    return (u==0 && prefixCode!=0 ? (short)-1 : u);
595 599
                }
596 600
            }
597 601
        }
latest9.1/bj/net/sf/saxon/tree/NodeImpl.java
203 203
      * not implement the correct semantics.
204 204
      */
205 205

  
206
     public int hashCode() {
207
         FastStringBuffer buff = new FastStringBuffer(20);
208
         generateId(buff);
209
         return buff.toString().hashCode();
210
     }
206
//     public int hashCode() {
207
//         FastStringBuffer buff = new FastStringBuffer(20);
208
//         generateId(buff);
209
//         return buff.toString().hashCode();
210
//     }
211 211

  
212 212
    /**
213 213
     * Get the nameCode of the node. This is used to locate the name in the NamePool
......
428 428
     */
429 429

  
430 430
    public NodeInfo getPreviousSibling() {
431
        if (parent == null) {
432
            return null;
433
        }
431 434
        return parent.getNthChild(index - 1);
432 435
    }
433 436

  
......
440 443
     */
441 444

  
442 445
    public NodeInfo getNextSibling() {
446
        if (parent == null) {
447
            return null;
448
        }
443 449
        return parent.getNthChild(index + 1);
444 450
    }
445 451

  
......
812 818
        // Overridden for attribute nodes
813 819
        if (parent != null) {
814 820
            parent.removeChild(this);
815
            parent = null;
821
            DocumentImpl newRoot = new DocumentImpl();
822
            newRoot.setConfiguration(parent.getConfiguration());
823
            newRoot.setImaginary(true);
824
            parent = newRoot;
816 825
        }
826
        index = -1;
817 827
    }
818 828

  
829

  
819 830
    /**
820 831
     * Remove an attribute from this element node
821 832
     *

Also available in: Unified diff