StandardParagraph.java

1
package pro.verron.officestamper.core;
2
3
import jakarta.xml.bind.JAXBElement;
4
import org.docx4j.wml.*;
5
import pro.verron.officestamper.api.Paragraph;
6
import pro.verron.officestamper.api.Placeholder;
7
8
import java.util.ArrayList;
9
import java.util.Arrays;
10
import java.util.List;
11
import java.util.Objects;
12
13
import static java.util.stream.Collectors.joining;
14
15
/**
16
 * <p>A "Run" defines a region of text within a docx document with a common set of properties. Word processors are
17
 * relatively free in splitting a paragraph of text into multiple runs, so there is no strict rule to say over how many
18
 * runs a word or a string of words is spread.</p>
19
 * <p>This class aggregates multiple runs so they can be treated as a single text, no matter how many runs the text
20
 * spans.
21
 * Call {@link #add(R, int)} to add all runs that should be aggregated. Then, call
22
 * methods to modify the aggregated text. Finally, call {@link #asString()} to get the modified text.
23
 *
24
 * @author Joseph Verron
25
 * @author Tom Hombergs
26
 * @version ${version}
27
 * @since 1.0.8
28
 */
29
public class StandardParagraph
30
        implements Paragraph {
31
32
    private final List<IndexedRun> runs = new ArrayList<>();
33
    private final List<Object> contents;
34
    private final PPr paragraphPr;
35
    private final P paragraph;
36
    private int currentPosition = 0;
37
38
    /**
39
     * Constructs a new ParagraphWrapper for the given paragraph.
40
     *
41
     * @param paragraph the paragraph to wrap.
42
     */
43
    public StandardParagraph(P paragraph) {
44
        this.paragraph = paragraph;
45
        this.contents = this.paragraph.getContent();
46
        this.paragraphPr = paragraph.getPPr();
47 1 1. <init> : removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → KILLED
        recalculateRuns();
48
    }
49
50
    /**
51
     * Recalculates the runs of the paragraph. This method is called automatically by the constructor, but can also be
52
     * called manually to recalculate the runs after a modification to the paragraph was done.
53
     */
54
    private void recalculateRuns() {
55
        currentPosition = 0;
56 1 1. recalculateRuns : removed call to java/util/List::clear → KILLED
        this.runs.clear();
57
        add(0, contents);
58
    }
59
60
    private int add(int index, List<Object> objects) {
61
        for (Object object : objects)
62
            index = add(index, object);
63 1 1. add : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → SURVIVED
        return index;
64
    }
65
66
    private int add(int index, Object object) {
67 1 1. add : negated conditional → KILLED
        if (object instanceof R r)
68 1 1. add : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → KILLED
            return add(r, index);
69 1 1. add : negated conditional → KILLED
        else if (object instanceof SdtRun sdtRun)
70 1 1. add : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → SURVIVED
            return add(index, sdtRun);
71 1 1. add : negated conditional → KILLED
        else if (object instanceof JAXBElement<?> jaxbElement)
72 1 1. add : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → KILLED
            return add(index, jaxbElement.getValue());
73
        else
74 2 1. add : Replaced integer addition with subtraction → KILLED
2. add : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → KILLED
            return index + 1;
75
    }
76
77
    private int add(int index, SdtRun sdtRun) {
78 1 1. add : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → SURVIVED
        return add(index, sdtRun.getSdtContent());
79
    }
80
81
    private int add(int index, SdtContent sdtContent) {
82 1 1. add : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → SURVIVED
        return this.add(index, sdtContent.getContent());
83
    }
84
85
    /**
86
     * Adds a run to the aggregation.
87
     *
88
     * @param run the run to add.
89
     */
90
    private int add(R run, int index) {
91 1 1. add : Replaced integer addition with subtraction → KILLED
        int endPosition = currentPosition + RunUtil.getLength(run);
92
        runs.add(new IndexedRun(currentPosition, endPosition, index, run));
93
        currentPosition = endPosition;
94 2 1. add : Replaced integer addition with subtraction → KILLED
2. add : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → KILLED
        return index + 1;
95
    }
96
97
    /**
98
     * Replaces the given expression with the replacement object within
99
     * the paragraph.
100
     * The replacement object must be a valid DOCX4J Object.
101
     *
102
     * @param placeholder the expression to be replaced.
103
     * @param replacement the object to replace the expression.
104
     */
105
    @Override
106
    public void replace(Placeholder placeholder, Object replacement) {
107 1 1. replace : negated conditional → KILLED
        if (replacement instanceof R run) {
108 1 1. replace : removed call to pro/verron/officestamper/core/StandardParagraph::replaceWithRun → KILLED
            replaceWithRun(placeholder, run);
109
        }
110 1 1. replace : negated conditional → KILLED
        else if (replacement instanceof Br br) {
111 1 1. replace : removed call to pro/verron/officestamper/core/StandardParagraph::replaceWithBr → KILLED
            replaceWithBr(placeholder, br);
112
        }
113
        else {
114
            throw new AssertionError("replacement must be a R");
115
        }
116
    }
117
118
    private void replaceWithRun(Placeholder placeholder, R replacement) {
119
        var text = asString();
120
        String full = placeholder.expression();
121
122
        int matchStartIndex = text.indexOf(full);
123 1 1. replaceWithRun : negated conditional → KILLED
        if (matchStartIndex == -1) {
124
            // nothing to replace
125
            return;
126
        }
127 1 1. replaceWithRun : Replaced integer addition with subtraction → KILLED
        int matchEndIndex = matchStartIndex + full.length();
128
        List<IndexedRun> affectedRuns = getAffectedRuns(matchStartIndex, matchEndIndex);
129
130 1 1. replaceWithRun : negated conditional → KILLED
        boolean singleRun = affectedRuns.size() == 1;
131
132 1 1. replaceWithRun : negated conditional → KILLED
        if (singleRun) {
133
            IndexedRun run = affectedRuns.get(0);
134
135 1 1. replaceWithRun : negated conditional → KILLED
            boolean expressionSpansCompleteRun = full.length() == run.length();
136 1 1. replaceWithRun : negated conditional → KILLED
            boolean expressionAtStartOfRun = matchStartIndex == run.startIndex();
137 1 1. replaceWithRun : negated conditional → KILLED
            boolean expressionAtEndOfRun = matchEndIndex == run.endIndex();
138 4 1. replaceWithRun : changed conditional boundary → SURVIVED
2. replaceWithRun : changed conditional boundary → SURVIVED
3. replaceWithRun : negated conditional → KILLED
4. replaceWithRun : negated conditional → KILLED
            boolean expressionWithinRun = matchStartIndex > run.startIndex() && matchEndIndex <= run.endIndex();
139
140 1 1. replaceWithRun : removed call to org/docx4j/wml/R::setRPr → KILLED
            replacement.setRPr(run.getPr());
141
142 1 1. replaceWithRun : negated conditional → KILLED
            if (expressionSpansCompleteRun) {
143
                contents.remove(run.run());
144 1 1. replaceWithRun : removed call to java/util/List::add → KILLED
                contents.add(run.indexInParent(), replacement);
145 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → SURVIVED
                recalculateRuns();
146
            }
147 1 1. replaceWithRun : negated conditional → KILLED
            else if (expressionAtStartOfRun) {
148 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/IndexedRun::replace → NO_COVERAGE
                run.replace(matchStartIndex, matchEndIndex, "");
149 1 1. replaceWithRun : removed call to java/util/List::add → NO_COVERAGE
                contents.add(run.indexInParent(), replacement);
150 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → NO_COVERAGE
                recalculateRuns();
151
            }
152 1 1. replaceWithRun : negated conditional → KILLED
            else if (expressionAtEndOfRun) {
153 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/IndexedRun::replace → KILLED
                run.replace(matchStartIndex, matchEndIndex, "");
154 2 1. replaceWithRun : Replaced integer addition with subtraction → KILLED
2. replaceWithRun : removed call to java/util/List::add → KILLED
                contents.add(run.indexInParent() + 1, replacement);
155 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → SURVIVED
                recalculateRuns();
156
            }
157 1 1. replaceWithRun : negated conditional → KILLED
            else if (expressionWithinRun) {
158
                int startIndex = run.indexOf(full);
159 1 1. replaceWithRun : Replaced integer addition with subtraction → KILLED
                int endIndex = startIndex + full.length();
160
                R run1 = RunUtil.create(run.substring(0, startIndex), paragraphPr);
161
                R run2 = RunUtil.create(run.substring(endIndex), paragraphPr);
162 1 1. replaceWithRun : removed call to java/util/List::add → KILLED
                contents.add(run.indexInParent(), run2);
163 1 1. replaceWithRun : removed call to java/util/List::add → KILLED
                contents.add(run.indexInParent(), replacement);
164 1 1. replaceWithRun : removed call to java/util/List::add → KILLED
                contents.add(run.indexInParent(), run1);
165
                contents.remove(run.run());
166 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → SURVIVED
                recalculateRuns();
167
            }
168
        }
169
        else if (affectedRuns.get(0)
170
                             .run()
171 1 1. replaceWithRun : negated conditional → KILLED
                             .getParent() == paragraph) {
172
            IndexedRun firstRun = affectedRuns.get(0);
173 1 1. replaceWithRun : Replaced integer subtraction with addition → KILLED
            IndexedRun lastRun = affectedRuns.get(affectedRuns.size() - 1);
174 1 1. replaceWithRun : removed call to org/docx4j/wml/R::setRPr → KILLED
            replacement.setRPr(firstRun.getPr());
175
            // remove the expression from first and last run
176 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/IndexedRun::replace → KILLED
            firstRun.replace(matchStartIndex, matchEndIndex, "");
177 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/IndexedRun::replace → KILLED
            lastRun.replace(matchStartIndex, matchEndIndex, "");
178
179
            // remove all runs between first and last
180
            for (IndexedRun run : affectedRuns) {
181 1 1. replaceWithRun : negated conditional → KILLED
                if (!Objects.equals(run, firstRun)
182 1 1. replaceWithRun : negated conditional → KILLED
                    && !Objects.equals(run, lastRun)) {
183
                    contents.remove(run.run());
184
                }
185
            }
186
187
            // add replacement run between first and last run
188 2 1. replaceWithRun : removed call to java/util/List::add → KILLED
2. replaceWithRun : Replaced integer addition with subtraction → KILLED
            contents.add(firstRun.indexInParent() + 1, replacement);
189
190 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → KILLED
            recalculateRuns();
191
        }
192
        else {
193
            IndexedRun firstRun = affectedRuns.get(0);
194 1 1. replaceWithRun : Replaced integer subtraction with addition → KILLED
            IndexedRun lastRun = affectedRuns.get(affectedRuns.size() - 1);
195
196
            var siblings = ((ContentAccessor) firstRun.run()
197
                                                      .getParent()).getContent();
198 1 1. replaceWithRun : removed call to org/docx4j/wml/R::setRPr → SURVIVED
            replacement.setRPr(firstRun.getPr());
199
            // remove the expression from first and last run
200 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/IndexedRun::replace → KILLED
            firstRun.replace(matchStartIndex, matchEndIndex, "");
201 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/IndexedRun::replace → KILLED
            lastRun.replace(matchStartIndex, matchEndIndex, "");
202
203
            // remove all runs between first and last
204
            for (IndexedRun run : affectedRuns) {
205 1 1. replaceWithRun : negated conditional → KILLED
                if (!Objects.equals(run, firstRun)
206 1 1. replaceWithRun : negated conditional → KILLED
                    && !Objects.equals(run, lastRun)) {
207
                    siblings.remove(run.run());
208
                }
209
            }
210
211
            // add replacement run between first and last run
212 2 1. replaceWithRun : removed call to java/util/List::add → KILLED
2. replaceWithRun : Replaced integer addition with subtraction → KILLED
            siblings.add(siblings.indexOf(firstRun) + 1, replacement);
213
214 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → SURVIVED
            recalculateRuns();
215
        }
216
    }
217
218
    private void replaceWithBr(Placeholder placeholder, Br br) {
219
        for (IndexedRun indexedRun : runs) {
220
            var run = indexedRun.run();
221
            var content = run.getContent();
222
            var iterator = content.listIterator();
223 1 1. replaceWithBr : negated conditional → KILLED
            while (iterator.hasNext()) {
224
                Object element = iterator.next();
225 1 1. replaceWithBr : negated conditional → KILLED
                if (element instanceof JAXBElement<?> jaxbElement) {
226
                    element = jaxbElement.getValue();
227
                }
228 1 1. replaceWithBr : negated conditional → KILLED
                if (element instanceof Text text) {
229
                    var value = text.getValue();
230 1 1. replaceWithBr : negated conditional → KILLED
                    if (value.contains(placeholder.expression())) {
231 1 1. replaceWithBr : removed call to java/util/ListIterator::remove → KILLED
                        iterator.remove();
232
                        var iterator1 = Arrays.stream(value.split(placeholder.expression()))
233
234
                                              .iterator();
235
                        while (iterator1.hasNext()) {
236
                            var next = iterator1.next();
237
                            var text1 = new Text();
238 1 1. replaceWithBr : removed call to org/docx4j/wml/Text::setValue → KILLED
                            text1.setValue(next);
239 1 1. replaceWithBr : removed call to java/util/ListIterator::add → KILLED
                            iterator.add(text1);
240 1 1. replaceWithBr : negated conditional → KILLED
                            if (iterator1.hasNext())
241 1 1. replaceWithBr : removed call to java/util/ListIterator::add → KILLED
                                iterator.add(br);
242
                        }
243
                    }
244
                }
245
            }
246
        }
247
    }
248
249
    /**
250
     * Returns the aggregated text over all runs.
251
     *
252
     * @return the text of all runs.
253
     */
254
    @Override
255
    public String asString() {
256 1 1. asString : replaced return value with "" for pro/verron/officestamper/core/StandardParagraph::asString → KILLED
        return runs.stream()
257
                   .map(IndexedRun::run)
258
                   .map(RunUtil::getText)
259
                   .collect(joining());
260
    }
261
262
    private List<IndexedRun> getAffectedRuns(int startIndex, int endIndex) {
263 1 1. getAffectedRuns : replaced return value with Collections.emptyList for pro/verron/officestamper/core/StandardParagraph::getAffectedRuns → KILLED
        return runs.stream()
264 2 1. lambda$getAffectedRuns$0 : replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph::lambda$getAffectedRuns$0 → KILLED
2. lambda$getAffectedRuns$0 : replaced boolean return with false for pro/verron/officestamper/core/StandardParagraph::lambda$getAffectedRuns$0 → KILLED
                   .filter(run -> run.isTouchedByRange(startIndex, endIndex))
265
                   .toList();
266
    }
267
268
    /**
269
     * {@inheritDoc}
270
     */
271
    @Override
272
    public String toString() {
273 1 1. toString : replaced return value with "" for pro/verron/officestamper/core/StandardParagraph::toString → NO_COVERAGE
        return asString();
274
    }
275
276
}

Mutations

47

1.1
Location : <init>
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#17]
removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → KILLED

56

1.1
Location : recalculateRuns
Killed by : pro.verron.officestamper.test.RepeatDocPartBadPlaceholderTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.RepeatDocPartBadPlaceholderTest]/[method:testBadExpressionShouldNotBlockCallerThread()]
removed call to java/util/List::clear → KILLED

63

1.1
Location : add
Killed by : none
replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → SURVIVED
Covering tests

67

1.1
Location : add
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#17]
negated conditional → KILLED

68

1.1
Location : add
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:#5]
replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → KILLED

69

1.1
Location : add
Killed by : pro.verron.officestamper.test.SpelInjectionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.SpelInjectionTest]/[method:spelInjectionTest()]
negated conditional → KILLED

70

1.1
Location : add
Killed by : none
replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → SURVIVED
Covering tests

71

1.1
Location : add
Killed by : pro.verron.officestamper.test.SpelInjectionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.SpelInjectionTest]/[method:spelInjectionTest()]
negated conditional → KILLED

72

1.1
Location : add
Killed by : pro.verron.officestamper.test.CustomFunctionTests.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.CustomFunctionTests]/[method:features()]
replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → KILLED

74

1.1
Location : add
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:#29]
Replaced integer addition with subtraction → KILLED

2.2
Location : add
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:#39]
replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → KILLED

78

1.1
Location : add
Killed by : none
replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → SURVIVED
Covering tests

82

1.1
Location : add
Killed by : none
replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → SURVIVED
Covering tests

91

1.1
Location : add
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:#25]
Replaced integer addition with subtraction → KILLED

94

1.1
Location : add
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:#16]
Replaced integer addition with subtraction → KILLED

2.2
Location : add
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:#5]
replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph::add → KILLED

107

1.1
Location : replace
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:#34]
negated conditional → KILLED

108

1.1
Location : replace
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:#25]
removed call to pro/verron/officestamper/core/StandardParagraph::replaceWithRun → KILLED

110

1.1
Location : replace
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:#34]
negated conditional → KILLED

111

1.1
Location : replace
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:#34]
removed call to pro/verron/officestamper/core/StandardParagraph::replaceWithBr → KILLED

123

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

127

1.1
Location : replaceWithRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#9]
Replaced integer addition with subtraction → KILLED

130

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

132

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

135

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

136

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

137

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

138

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

2.2
Location : replaceWithRun
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:#25]
negated conditional → KILLED

3.3
Location : replaceWithRun
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

4.4
Location : replaceWithRun
Killed by : none
changed conditional boundary → SURVIVED Covering tests

140

1.1
Location : replaceWithRun
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:#32]
removed call to org/docx4j/wml/R::setRPr → KILLED

142

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

144

1.1
Location : replaceWithRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testStaticResolution(java.lang.String, boolean, boolean, boolean, java.lang.String, java.lang.String)]/[test-template-invocation:#2]
removed call to java/util/List::add → KILLED

145

1.1
Location : replaceWithRun
Killed by : none
removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → SURVIVED
Covering tests

147

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

148

1.1
Location : replaceWithRun
Killed by : none
removed call to pro/verron/officestamper/core/IndexedRun::replace → NO_COVERAGE

149

1.1
Location : replaceWithRun
Killed by : none
removed call to java/util/List::add → NO_COVERAGE

150

1.1
Location : replaceWithRun
Killed by : none
removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → NO_COVERAGE

152

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

153

1.1
Location : replaceWithRun
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:#37]
removed call to pro/verron/officestamper/core/IndexedRun::replace → KILLED

154

1.1
Location : replaceWithRun
Killed by : pro.verron.officestamper.test.NullPointerResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.NullPointerResolutionTest]/[method:nullPointerResolutionTest_testThrowingCase()]
Replaced integer addition with subtraction → KILLED

2.2
Location : replaceWithRun
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:#37]
removed call to java/util/List::add → KILLED

155

1.1
Location : replaceWithRun
Killed by : none
removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → SURVIVED
Covering tests

157

1.1
Location : replaceWithRun
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:#25]
negated conditional → KILLED

159

1.1
Location : replaceWithRun
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:#25]
Replaced integer addition with subtraction → KILLED

162

1.1
Location : replaceWithRun
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:#25]
removed call to java/util/List::add → KILLED

163

1.1
Location : replaceWithRun
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:#25]
removed call to java/util/List::add → KILLED

164

1.1
Location : replaceWithRun
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:#25]
removed call to java/util/List::add → KILLED

166

1.1
Location : replaceWithRun
Killed by : none
removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → SURVIVED
Covering tests

171

1.1
Location : replaceWithRun
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:#5]
negated conditional → KILLED

173

1.1
Location : replaceWithRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#9]
Replaced integer subtraction with addition → KILLED

174

1.1
Location : replaceWithRun
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:#28]
removed call to org/docx4j/wml/R::setRPr → KILLED

176

1.1
Location : replaceWithRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#9]
removed call to pro/verron/officestamper/core/IndexedRun::replace → KILLED

177

1.1
Location : replaceWithRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#9]
removed call to pro/verron/officestamper/core/IndexedRun::replace → KILLED

181

1.1
Location : replaceWithRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#9]
negated conditional → KILLED

182

1.1
Location : replaceWithRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#9]
negated conditional → KILLED

188

1.1
Location : replaceWithRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#8]
removed call to java/util/List::add → KILLED

2.2
Location : replaceWithRun
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#9]
Replaced integer addition with subtraction → KILLED

190

1.1
Location : replaceWithRun
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:#7]
removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → KILLED

194

1.1
Location : replaceWithRun
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:#39]
Replaced integer subtraction with addition → KILLED

198

1.1
Location : replaceWithRun
Killed by : none
removed call to org/docx4j/wml/R::setRPr → SURVIVED
Covering tests

200

1.1
Location : replaceWithRun
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:#39]
removed call to pro/verron/officestamper/core/IndexedRun::replace → KILLED

201

1.1
Location : replaceWithRun
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:#39]
removed call to pro/verron/officestamper/core/IndexedRun::replace → KILLED

205

1.1
Location : replaceWithRun
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:#39]
negated conditional → KILLED

206

1.1
Location : replaceWithRun
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:#39]
negated conditional → KILLED

212

1.1
Location : replaceWithRun
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:#39]
removed call to java/util/List::add → KILLED

2.2
Location : replaceWithRun
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:#39]
Replaced integer addition with subtraction → KILLED

214

1.1
Location : replaceWithRun
Killed by : none
removed call to pro/verron/officestamper/core/StandardParagraph::recalculateRuns → SURVIVED
Covering tests

223

1.1
Location : replaceWithBr
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:#34]
negated conditional → KILLED

225

1.1
Location : replaceWithBr
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:#34]
negated conditional → KILLED

228

1.1
Location : replaceWithBr
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:#34]
negated conditional → KILLED

230

1.1
Location : replaceWithBr
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:#34]
negated conditional → KILLED

231

1.1
Location : replaceWithBr
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:#34]
removed call to java/util/ListIterator::remove → KILLED

238

1.1
Location : replaceWithBr
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:#34]
removed call to org/docx4j/wml/Text::setValue → KILLED

239

1.1
Location : replaceWithBr
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:#34]
removed call to java/util/ListIterator::add → KILLED

240

1.1
Location : replaceWithBr
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:#34]
negated conditional → KILLED

241

1.1
Location : replaceWithBr
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:#34]
removed call to java/util/ListIterator::add → KILLED

256

1.1
Location : asString
Killed by : pro.verron.officestamper.test.ResolutionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ResolutionTest]/[test-template:testCustomResolution(java.lang.String, boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, java.lang.String)]/[test-template-invocation:#17]
replaced return value with "" for pro/verron/officestamper/core/StandardParagraph::asString → KILLED

263

1.1
Location : getAffectedRuns
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:#25]
replaced return value with Collections.emptyList for pro/verron/officestamper/core/StandardParagraph::getAffectedRuns → KILLED

264

1.1
Location : lambda$getAffectedRuns$0
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:#16]
replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph::lambda$getAffectedRuns$0 → KILLED

2.2
Location : lambda$getAffectedRuns$0
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:#25]
replaced boolean return with false for pro/verron/officestamper/core/StandardParagraph::lambda$getAffectedRuns$0 → KILLED

273

1.1
Location : toString
Killed by : none
replaced return value with "" for pro/verron/officestamper/core/StandardParagraph::toString → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.17.0