Dear Aspose,
I am trying to delete a numbering style from a .dotx (see inside SDWEB-4981_style_delete_fail.zip (19.0 KB)), however getting a ‘ConcurrentModificationException’ while saving the document.
Following code reproduces the issue with Aspose Words (Java) 21.4
InputStream docxInputStream = getDocument("SDWEB-4981_style_delete_fail.dotx");
Document docx = new Document(docxInputStream);
StyleCollection styles = docx.getStyles();
Style wshList = styles.get("PRK list style Aai_1");
wshList.remove();
docx.save("ListStyleRemoval_done.dotx");
java.util.ConcurrentModificationException
at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1042)
at java.base/java.util.ArrayList$Itr.next(ArrayList.java:996)
at com.aspose.words.zzZCH.zzZ0F(Unknown Source)
at com.aspose.words.zzZCH.zzi3(Unknown Source)
at com.aspose.words.zz3I.zzM(Unknown Source)
at com.aspose.words.zz3I.visitDocumentEnd(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
at com.aspose.words.CompositeNode.acceptCore(Unknown Source)
at com.aspose.words.Document.accept(Unknown Source)
at com.aspose.words.zz3I.zzX(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)