public QName checkDuplicatesNS(){
  if (fLength <= SIZE_LIMIT) {
    for (int i=0; i < fLength - 1; ++i) {
      Attribute att1=fAttributes[i];
      for (int j=i + 1; j < fLength; ++j) {
        Attribute att2=fAttributes[j];
        if (att1.name.localpart == att2.name.localpart && att1.name.uri == att2.name.uri) {
          return att2.name;
        }
      }
    }
  }
 else {
    fIsTableViewConsistent=false;
    prepareTableView();
    Attribute attr;
    int bucket;
    for (int i=fLength - 1; i >= 0; --i) {
      attr=fAttributes[i];
      bucket=getTableViewBucket(attr.name.localpart,attr.name.uri);
      if (fAttributeTableViewChainState[bucket] != fLargeCount) {
        fAttributeTableViewChainState[bucket]=fLargeCount;
        attr.next=null;
        fAttributeTableView[bucket]=attr;
      }
 else {
        Attribute found=fAttributeTableView[bucket];
        while (found != null) {
          if (found.name.localpart == attr.name.localpart && found.name.uri == attr.name.uri) {
            return attr.name;
          }
          found=found.next;
        }
        attr.next=fAttributeTableView[bucket];
        fAttributeTableView[bucket]=attr;
      }
    }
  }
  return null;
}

public QName checkDuplicatesNS ( ) { if ( fLength <= SIZE_LIMIT ) { for ( int i = 0 ; i < fLength - 1 ; ++ i ) { Attribute att1 = fAttributes [ i ] ; for ( int j = i + 1 ; j < fLength ; ++ j ) { Attribute att2 = fAttributes [ j ] ; if ( att1 . name . localpart == att2 . name . localpart && att1 . name . uri == att2 . name . uri ) { return att2 . name ; } } } } else { fIsTableViewConsistent = false ; prepareTableView ( ) ; Attribute attr ; int bucket ; for ( int i = fLength - 1 ; i >= 0 ; -- i ) { attr = fAttributes [ i ] ; bucket = getTableViewBucket ( attr . name . localpart , attr . name . uri ) ; if ( fAttributeTableViewChainState [ bucket ] != fLargeCount ) { fAttributeTableViewChainState [ bucket ] = fLargeCount ; attr . next = null ; fAttributeTableView [ bucket ] = attr ; } else { Attribute found = fAttributeTableView [ bucket ] ; while ( found != null ) { if ( found . name . localpart == attr . name . localpart && found . name . uri == attr . name . uri ) { return attr . name ; } found = found . next ; } attr . next = fAttributeTableView [ bucket ] ; fAttributeTableView [ bucket ] = attr ; } } } return null ; }
checks for duplicate expanded names ( local part and namespace name pairs ) in the attribute specification . if a duplicate is found its name is returned . < p / > this should be called once all the in - scope namespaces for the element enclosing these attributes is known , and after all the attributes have gone through namespace binding .
