Hi,
Aspose Words for Java (tested v15.12.0.0) has issue with the compare and reject feature.
The resulting file is not equal to the original document, see attached image.
The following code was used to create the files:
DocumentBuilder v1 = new DocumentBuilder();
v1.getDocument().getStyles().getByStyleIdentifier(StyleIdentifier.HEADING_1).getFont().setColor(Color.GRAY);
v1.getParagraphFormat().setStyleIdentifier(StyleIdentifier.HEADING_1);
v1.write("Technical");
v1.getDocument().save("v1.rtf");
DocumentBuilder v2 = new DocumentBuilder();
v2.getFont().setColor(Color.GREEN);
v2.writeln("This is");
v2.getFont().clearFormatting();
v2.getFont().setUnderline(Underline.SINGLE);
v2.getFont().setColor(Color.GREEN);
v2.writeln("Underlined");
v2.getFont().clearFormatting();
v2.getFont().setSuperscript(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("superscript");
v2.getFont().clearFormatting();
v2.getFont().setSubscript(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("hello");
v2.getFont().clearFormatting();
v2.getFont().setStrikeThrough(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("change");
v2.getFont().clearFormatting();
v2.getFont().setItalic(true);
v2.getFont().setColor(Color.GREEN);
v2.writeln("italic");
v2.getFont().clearFormatting();
v2.getDocument().getStyles().getByStyleIdentifier(StyleIdentifier.HEADING_1).getFont().setColor(Color.GRAY);
v2.getParagraphFormat().setStyleIdentifier(StyleIdentifier.HEADING_1);
v2.writeln("Technical");
v2.getDocument().save("v2.rtf");
v1.getDocument().compare(v2.getDocument(), "author", new Date());
v1.getDocument().save("diffAspose.rtf");
Document diffReject = new Document("diffAspose.rtf");
diffReject.getRevisions().rejectAll();
diffReject.save("diffReject.rtf");
Thanks
Romain