RemoveProofErrors.java

1
package pro.verron.officestamper.preset.preprocessors.prooferror;
2
3
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
4
import org.docx4j.wml.ContentAccessor;
5
import org.docx4j.wml.ProofErr;
6
import pro.verron.officestamper.api.PreProcessor;
7
8
import static pro.verron.officestamper.core.DocumentUtil.visitDocument;
9
10
public class RemoveProofErrors
11
        implements PreProcessor {
12
13
    /**
14
     * {@inheritDoc}
15
     */
16
    @Override
17
    public void process(WordprocessingMLPackage document) {
18
        var visitor = new ProofErrVisitor();
19 1 1. process : removed call to pro/verron/officestamper/core/DocumentUtil::visitDocument → KILLED
        visitDocument(document, visitor);
20
        for (ProofErr proofErr : visitor.getProofErrs()) {
21
            var proofErrParent = proofErr.getParent();
22 1 1. process : negated conditional → KILLED
            if (proofErrParent instanceof ContentAccessor parent) {
23
                var parentContent = parent.getContent();
24
                parentContent.remove(proofErr);
25
            }
26
        }
27
    }
28
29
}

Mutations

19

1.1
Location : process
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#2]
removed call to pro/verron/officestamper/core/DocumentUtil::visitDocument → KILLED

22

1.1
Location : process
Killed by : pro.verron.officestamper.test.DefaultTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.DefaultTests]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#2]
negated conditional → KILLED

Active mutators

Tests examined


Report generated by PIT 1.20.0