XSSFRichTextString does not implement equals, but HSSFRichTextString does. This makes it inconsistent to work with the shared Interface RichTextString.
What sort of equality did you have in mind? * XSSFRichTextString comparable to other XSSFRichTextString (only) * XSSFRichTextString comparable to HSSFRichTextString It looks like the HSSF equality is in terms of the string characters themselves, and not the fonts. i.e. it's roughly equivalent to comparing getString() values. Potentially we could make both sorts comparable on the basis of getString().
(In reply to David North from comment #1) > What sort of equality did you have in mind? > > * XSSFRichTextString comparable to other XSSFRichTextString (only) > * XSSFRichTextString comparable to HSSFRichTextString > > It looks like the HSSF equality is in terms of the string characters > themselves, and not the fonts. i.e. it's roughly equivalent to comparing > getString() values. > > Potentially we could make both sorts comparable on the basis of getString(). I had XSSFRichTextString comparable to other XSSFRichTextString (only) in mind. I am not sure if XSSFRichTextString comparable to HSSFRichTextString would be usefull. In my concrete case the problem is, that the following assertion works for HSSF but not XSSF: Cell cell = ... RichTextString richTextString = ... cell.setCellValue(richTextString) assert cell.getRichStringCellValue().equals(richTextString)
Shouldn't H/XSSFRichTextString equals method be a rich text compare? If the user wants plain text compare, they can always do H/XSSFRichTextString.getString().equals.