code: public int addDefaultAttribute(String localName, String uri, String prefix,
                                     String value) throws XMLStreamException
      {
          int attrIndex = mAttrCount;
          if (attrIndex < 1) {
              /* had no explicit attributes... better initialize now, then.
               * Let's just use hash area of 4, and 
               */
              initHashArea();
          }
  
          /* Ok, first, since we do want to verify that we can not accidentally
           * add duplicates, let's first try to add entry to Map, since that
           * will catch dups.
           */
          int hash = localName.hashCode();
          if (uri != null && uri.length() > 0) {
              hash ^= uri.hashCode();
          }
          int index = hash & (mAttrHashSize - 1);
          int[] map = mAttrMap;
          if (map[index] == 0) { // whoa, have room...
              map[index] = attrIndex+1; // add 1 to get 1-based index (0 is empty marker)
          } else { // nah, collision...
              int currIndex = map[index]-1; // Index of primary collision entry
              int spillIndex = mAttrSpillEnd;
              map = spillAttr(uri, localName, map, currIndex, spillIndex,
                              hash, mAttrHashSize);
              if (map == null) { // dup!
                  return -1; // could return negation (-(index+1)) of the prev index?
              }
              map[++spillIndex] = attrIndex; // no need to specifically avoid 0
              mAttrMap = map;
              mAttrSpillEnd = ++spillIndex;
          }
  
          /* Can reuse code; while we don't really need the builder,
           * we need to add/reset attribute
           */
          getAttrBuilder(prefix, localName);
          Attribute attr = mAttributes[mAttrCount-1];
          attr.mNamespaceURI = uri;
          attr.setValue(value);
          // attribute count has been updated; index is one less than count
          return (mAttrCount-1);
      }
docs: Method called by validator to insert an attribute that has a default
  value and wasn't yet included in collector's attribute set.
  
  @return Index of the newly added attribute, if added; -1 to indicate
  this was a duplicate