CQP Annotation, segment-category-value, can't delete some annotations
The write annotations step seems to fail when there are some superposed annotations (of different type)
Error log:
Enregistrement de 1 annotations...
[test2[198-199]=#del]
[]
Unexpected error while parsing file file:/home/xyz/runtime-rcpapplication.product/corpora/VOEUX/txm/VOEUX/0001.xml : javax.xml.stream.XMLStreamException: No element was found to write: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 10
Location line: 643 character: 31
javax.xml.stream.XMLStreamException: No element was found to write: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 10
at java.xml/com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeEndElement(XMLStreamWriterImpl.java:962)
at org.txm.importer.StaxIdentityParser.processEndElement(StaxIdentityParser.java:487)
at org.txm.annotation.kr.core.AnnotationInjector.processEndElement(AnnotationInjector.java:529)
at org.txm.importer.StaxIdentityParser.process(StaxIdentityParser.java:257)
at org.txm.importer.StaxIdentityParser.process(StaxIdentityParser.java:151)
at org.txm.importer.StaxIdentityParser.process(StaxIdentityParser.java:144)
at org.txm.annotation.kr.core.AnnotationWriter.writeAnnotationsInFile(AnnotationWriter.java:295)
at org.txm.annotation.kr.core.AnnotationWriter.writeAnnotations(AnnotationWriter.java:260)
at org.txm.annotation.kr.core.AnnotationManager.saveAnnotations(AnnotationManager.java:82)
at org.txm.annotation.kr.rccommands.SaveAnnotations$1.run(SaveAnnotations.java:72)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 10
at java.xml/com.sun.xml.internal.stream.writers.XMLStreamWriterImpl$ElementStack.pop(XMLStreamWriterImpl.java:2027)
at java.xml/com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeEndElement(XMLStreamWriterImpl.java:935)
... 10 more
Solution
Fix the AnnotationsWriter & AnnotationInjection class implementing the solution of https://groupes.renater.fr/wiki/txm-info/public/annotation/specs_manual_annotation/specs_store_annotation#sauvegarde_definitive “Encodage XML des annotations” section
(from redmine: issue id 3405, created on 2023/06/19 by Matthieu Decorde)