DecimalFormat keeps a list of FieldPosition attributes for use by formatToCharacterIterator(). However, all format() methods add attributes to this list, even if they are not needed. Also, the list is only cleared by formatToCharacterIterator() (which might not be called at all).
Fix this by only recording attribute information when required, and clearing the list immediately after use.
DecimalFormat keeps a list of FieldPosition attributes for use by formatToCharacterIterator(). However, all format() methods add attributes to this list, even if they are not needed. Also, the list is only cleared by formatToCharacterIterator() (which might not be called at all).
Fix this by only recording attribute information when required, and clearing the list immediately after use.
Fixes #28 (BZ#30977)