MutableAttributeSet mutable = createLargeAttributeSet(old); mutable.removeAttribute(name); SmallAttributeSet small = createSmallAttributeSet(mutable); if (sharedAttributeSets.containsKey(small)) small = (SmallAttributeSet) sharedAttributeSets.get(small); else sharedAttributeSets.put(small,small); return small;
MutableAttributeSet mas = getMutableAttributeSet(old); mas.removeAttribute(name); ret = mas;
  public AttributeSet removeAttribute(AttributeSet old, Object name)  {    if (old instanceof MutableAttributeSet)      {        ((MutableAttributeSet)old).removeAttribute(name);        if (old.getAttributeCount() < getCompressionThreshold())          {            SmallAttributeSet small = createSmallAttributeSet(old);            if (!sharedAttributeSets.containsKey(small))              sharedAttributeSets.put(small,small);            old = (AttributeSet) sharedAttributeSets.get(small);          }        return old;      }    else       {                  MutableAttributeSet mutable = createLargeAttributeSet(old);        mutable.removeAttribute(name);        SmallAttributeSet small = createSmallAttributeSet(mutable);        if (sharedAttributeSets.containsKey(small))          small = (SmallAttributeSet) sharedAttributeSets.get(small);        else          sharedAttributeSets.put(small,small);        return small;      }  }