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.*;
6
import pro.verron.officestamper.utils.WmlFactory;
7
import pro.verron.officestamper.utils.WmlUtils;
8
9
import java.math.BigInteger;
10
import java.util.*;
11
import java.util.function.Consumer;
12
13
import static java.util.Arrays.stream;
14
import static java.util.stream.Collectors.joining;
15
import static pro.verron.officestamper.api.OfficeStamperException.throwing;
16
import static pro.verron.officestamper.utils.WmlUtils.getFirstParentWithClass;
17
18
/// Represents a wrapper for managing and manipulating DOCX paragraph elements.
19
/// This class provides methods to manipulate the underlying paragraph content,
20
/// process placeholders, and interact with runs within the paragraph.
21
public class StandardParagraph
22
        implements Paragraph {
23
24
    private static final Random RANDOM = new Random();
25
    private final DocxPart source;
26
    private final List<Object> contents;
27
    private final P p;
28
    private List<StandardRun> runs;
29
30
    /// Constructs a new instance of the StandardParagraph class.
31
    ///
32
    /// @param source           the source DocxPart that contains the paragraph content.
33
    /// @param paragraphContent the list of objects representing the paragraph content.
34
    /// @param p                the P object representing the paragraph's structure.
35
    private StandardParagraph(DocxPart source, List<Object> paragraphContent, P p) {
36
        this.source = source;
37
        this.contents = paragraphContent;
38
        this.p = p;
39
        this.runs = initializeRunList(contents);
40
    }
41
42
    /// Initializes a list of StandardRun objects based on the given list of objects.
43
    /// Iterates over the provided list of objects, identifies instances of type R,
44
    /// and constructs StandardRun objects while keeping track of their lengths.
45
    ///
46
    /// @param objects the list of objects to be iterated over and processed into StandardRun instances
47
    ///
48
    /// @return a list of StandardRun objects created from the given input list
49
    private static List<StandardRun> initializeRunList(List<Object> objects) {
50
        var currentLength = 0;
51
        var runList = new ArrayList<StandardRun>(objects.size());
52 2 1. initializeRunList : changed conditional boundary → KILLED
2. initializeRunList : negated conditional → KILLED
        for (int i = 0; i < objects.size(); i++) {
53
            var object = objects.get(i);
54 1 1. initializeRunList : negated conditional → KILLED
            if (object instanceof R run) {
55
                var currentRun = new StandardRun(currentLength, i, run);
56
                runList.add(currentRun);
57 1 1. initializeRunList : Replaced integer addition with subtraction → KILLED
                currentLength += currentRun.length();
58
            }
59
        }
60 1 1. initializeRunList : replaced return value with Collections.emptyList for pro/verron/officestamper/core/StandardParagraph::initializeRunList → KILLED
        return runList;
61
    }
62
63
    /// Creates a new instance of StandardParagraph using the provided DocxPart and P objects.
64
    ///
65
    /// @param source    the source DocxPart containing the paragraph.
66
    /// @param paragraph the P object representing the structure and content of the paragraph.
67
    ///
68
    /// @return a new instance of StandardParagraph constructed based on the provided source and paragraph.
69
    public static StandardParagraph from(DocxPart source, P paragraph) {
70 1 1. from : replaced return value with null for pro/verron/officestamper/core/StandardParagraph::from → KILLED
        return new StandardParagraph(source, paragraph.getContent(), paragraph);
71
    }
72
73
    /// Creates a new instance of StandardParagraph from the provided DocxPart and CTSdtContentRun objects.
74
    ///
75
    /// @param source    the source DocxPart containing the paragraph content.
76
    /// @param paragraph the CTSdtContentRun object representing the content of the paragraph.
77
    ///
78
    /// @return a new instance of StandardParagraph constructed based on the provided DocxPart and paragraph.
79
    public static StandardParagraph from(DocxPart source, CTSdtContentRun paragraph) {
80
        var parent = (SdtRun) paragraph.getParent();
81
        var parentParent = (P) parent.getParent();
82 1 1. from : replaced return value with null for pro/verron/officestamper/core/StandardParagraph::from → KILLED
        return new StandardParagraph(source, paragraph.getContent(), parentParent);
83
    }
84
85
    /// Creates a new instance of ProcessorContext for the current paragraph.
86
    /// This method generates a comment for the given placeholder and retrieves the first run from the contents,
87
    /// which are then used to construct the ProcessorContext.
88
    ///
89
    /// @param placeholder the placeholder being processed, used to generate the related comment.
90
    ///
91
    /// @return a new ProcessorContext instance containing the paragraph, first run, related comment, and placeholder.
92
    @Override
93
    public ProcessorContext processorContext(Placeholder placeholder) {
94
        var comment = comment(placeholder);
95
        var firstRun = (R) contents.getFirst();
96 1 1. processorContext : replaced return value with null for pro/verron/officestamper/core/StandardParagraph::processorContext → KILLED
        return new ProcessorContext(this, firstRun, comment, placeholder);
97
    }
98
99
    /// Replaces a set of paragraph elements with new ones within the current paragraph's siblings.
100
    /// Ensures that the elements to be removed are replaced in the appropriate position.
101
    ///
102
    /// @param toRemove the list of paragraph elements to be removed.
103
    /// @param toAdd    the list of paragraph elements to be added.
104
    ///
105
    /// @throws OfficeStamperException if the current paragraph object is not found in its siblings.
106
    @Override
107
    public void replace(List<P> toRemove, List<P> toAdd) {
108
        var siblings = siblings();
109
        int index = siblings.indexOf(p);
110 2 1. replace : changed conditional boundary → KILLED
2. replace : negated conditional → KILLED
        if (index < 0) throw new OfficeStamperException("Impossible");
111
        siblings.addAll(index, toAdd);
112
        siblings.removeAll(toRemove);
113
    }
114
115
    private List<Object> siblings() {
116 1 1. siblings : replaced return value with Collections.emptyList for pro/verron/officestamper/core/StandardParagraph::siblings → KILLED
        return this.parent(ContentAccessor.class, 1)
117
                   .orElseThrow(throwing("This paragraph direct parent is not a classic parent object"))
118
                   .getContent();
119
    }
120
121
    private <T> Optional<T> parent(Class<T> aClass, int depth) {
122 1 1. parent : replaced return value with Optional.empty for pro/verron/officestamper/core/StandardParagraph::parent → KILLED
        return getFirstParentWithClass(p, aClass, depth);
123
    }
124
125
    /// Removes the paragraph represented by the current instance.
126
    /// Delegates the removal process to a utility method that handles the underlying P object.
127
    @Override
128
    public void remove() {
129 1 1. remove : removed call to pro/verron/officestamper/utils/WmlUtils::remove → KILLED
        WmlUtils.remove(p);
130
    }
131
132
    /// Retrieves the P object representing the paragraph's structure.
133
    ///
134
    /// @return the P object associated with the paragraph.
135
    ///
136
    /// @deprecated use the inplace edition methods instead
137
    @Deprecated(since = "2.6", forRemoval = true)
138
    @Override
139
    public P getP() {
140 1 1. getP : replaced return value with null for pro/verron/officestamper/core/StandardParagraph::getP → NO_COVERAGE
        return p;
141
    }
142
143
    /// Replaces the given expression with the replacement object within the paragraph.
144
    /// The replacement object must be a valid DOCX4J Object.
145
    ///
146
    /// @param placeholder the expression to be replaced.
147
    /// @param replacement the object to replace the expression.
148
    @Override
149
    public void replace(Placeholder placeholder, Object replacement) {
150 1 1. replace : negated conditional → KILLED
        if (!WmlUtils.serializable(replacement))
151
            throw new AssertionError("The replacement object must be a valid DOCX4J Object");
152
        switch (replacement) {
153 1 1. replace : removed call to pro/verron/officestamper/core/StandardParagraph::replaceWithRun → KILLED
            case R run -> replaceWithRun(placeholder, run);
154 1 1. replace : removed call to pro/verron/officestamper/core/StandardParagraph::replaceWithBr → KILLED
            case Br br -> replaceWithBr(placeholder, br);
155
            default -> throw new AssertionError("Replacement must be a R or Br, but was a " + replacement.getClass());
156
        }
157
    }
158
159
    private void replaceWithRun(Placeholder placeholder, R replacement) {
160 1 1. replaceWithRun : removed call to pro/verron/officestamper/core/StandardParagraph::replaceExpressionWithRun → KILLED
        replaceExpressionWithRun(placeholder.expression(), replacement);
161
    }
162
163
    private void replaceExpressionWithRun(String full, R replacement) {
164
        var text = asString();
165
166
        int matchStartIndex = text.indexOf(full);
167 1 1. replaceExpressionWithRun : negated conditional → KILLED
        if (matchStartIndex == -1) {
168
            // nothing to replace
169
            return;
170
        }
171 1 1. replaceExpressionWithRun : Replaced integer addition with subtraction → KILLED
        int matchEndIndex = matchStartIndex + full.length();
172
        List<StandardRun> affectedRuns = getAffectedRuns(matchStartIndex, matchEndIndex);
173
174 1 1. replaceExpressionWithRun : removed call to pro/verron/officestamper/core/StandardParagraph::replace → KILLED
        replace(replacement, affectedRuns, full, matchStartIndex, matchEndIndex);
175
    }
176
177
    private void replace(
178
            R replacement,
179
            List<StandardRun> affectedRuns,
180
            String full,
181
            int matchStartIndex,
182
            int matchEndIndex
183
    ) {
184 1 1. replace : negated conditional → KILLED
        boolean singleRun = affectedRuns.size() == 1;
185
186 1 1. replace : negated conditional → KILLED
        if (singleRun) {
187
            StandardRun run = affectedRuns.getFirst();
188
189 1 1. replace : negated conditional → KILLED
            boolean expressionSpansCompleteRun = full.length() == run.length();
190 1 1. replace : negated conditional → KILLED
            boolean expressionAtStartOfRun = matchStartIndex == run.startIndex();
191 1 1. replace : negated conditional → KILLED
            boolean expressionAtEndOfRun = matchEndIndex == run.endIndex();
192 4 1. replace : changed conditional boundary → SURVIVED
2. replace : changed conditional boundary → SURVIVED
3. replace : negated conditional → KILLED
4. replace : negated conditional → KILLED
            boolean expressionWithinRun = matchStartIndex > run.startIndex() && matchEndIndex <= run.endIndex();
193
194 1 1. replace : removed call to org/docx4j/wml/R::setRPr → SURVIVED
            replacement.setRPr(run.getPr());
195
196 1 1. replace : negated conditional → KILLED
            if (expressionSpansCompleteRun) {
197
                contents.set(run.indexInParent(), replacement);
198
            }
199 1 1. replace : negated conditional → KILLED
            else if (expressionAtStartOfRun) {
200 1 1. replace : removed call to pro/verron/officestamper/core/StandardParagraph$StandardRun::replace → NO_COVERAGE
                run.replace(matchStartIndex, matchEndIndex, "");
201 1 1. replace : removed call to java/util/List::add → NO_COVERAGE
                contents.add(run.indexInParent(), replacement);
202
            }
203 1 1. replace : negated conditional → KILLED
            else if (expressionAtEndOfRun) {
204 1 1. replace : removed call to pro/verron/officestamper/core/StandardParagraph$StandardRun::replace → KILLED
                run.replace(matchStartIndex, matchEndIndex, "");
205 2 1. replace : removed call to java/util/List::add → KILLED
2. replace : Replaced integer addition with subtraction → KILLED
                contents.add(run.indexInParent() + 1, replacement);
206
            }
207 1 1. replace : negated conditional → KILLED
            else if (expressionWithinRun) {
208
                int startIndex = run.indexOf(full);
209 1 1. replace : Replaced integer addition with subtraction → KILLED
                int endIndex = startIndex + full.length();
210
                var newStartRun = RunUtil.create(run.substring(0, startIndex),
211
                        run.run()
212
                           .getRPr());
213
                var newEndRun = RunUtil.create(run.substring(endIndex),
214
                        run.run()
215
                           .getRPr());
216
                contents.remove(run.indexInParent());
217
                contents.addAll(run.indexInParent(), List.of(newStartRun, replacement, newEndRun));
218
            }
219
        }
220
        else {
221
            StandardRun firstRun = affectedRuns.getFirst();
222
            StandardRun lastRun = affectedRuns.getLast();
223 1 1. replace : removed call to org/docx4j/wml/R::setRPr → KILLED
            replacement.setRPr(firstRun.getPr());
224 1 1. replace : removed call to pro/verron/officestamper/core/StandardParagraph::removeExpression → KILLED
            removeExpression(firstRun, matchStartIndex, matchEndIndex, lastRun, affectedRuns);
225
            // add replacement run between first and last run
226 2 1. replace : removed call to java/util/List::add → KILLED
2. replace : Replaced integer addition with subtraction → KILLED
            contents.add(firstRun.indexInParent() + 1, replacement);
227
        }
228
        this.runs = initializeRunList(contents);
229
    }
230
231
    private void replaceWithBr(Placeholder placeholder, Br br) {
232
        for (StandardRun standardRun : runs) {
233
            var runContentIterator = standardRun.run()
234
                                                .getContent()
235
                                                .listIterator();
236 1 1. replaceWithBr : negated conditional → KILLED
            while (runContentIterator.hasNext()) {
237
                Object element = runContentIterator.next();
238 1 1. replaceWithBr : negated conditional → KILLED
                if (element instanceof JAXBElement<?> jaxbElement && !jaxbElement.getName()
239
                                                                                 .getLocalPart()
240 1 1. replaceWithBr : negated conditional → KILLED
                                                                                 .equals("instrText"))
241
                    element = jaxbElement.getValue();
242 2 1. replaceWithBr : removed call to pro/verron/officestamper/core/StandardParagraph::replaceWithBr → KILLED
2. replaceWithBr : negated conditional → KILLED
                if (element instanceof Text text) replaceWithBr(placeholder, br, text, runContentIterator);
243
            }
244
        }
245
    }
246
247
    private List<StandardRun> getAffectedRuns(int startIndex, int endIndex) {
248 1 1. getAffectedRuns : replaced return value with Collections.emptyList for pro/verron/officestamper/core/StandardParagraph::getAffectedRuns → KILLED
        return runs.stream()
249 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))
250
                   .toList();
251
    }
252
253
    private void removeExpression(
254
            StandardRun firstRun,
255
            int matchStartIndex,
256
            int matchEndIndex,
257
            StandardRun lastRun,
258
            List<StandardRun> affectedRuns
259
    ) {
260
        // remove the expression from the first run
261 1 1. removeExpression : removed call to pro/verron/officestamper/core/StandardParagraph$StandardRun::replace → KILLED
        firstRun.replace(matchStartIndex, matchEndIndex, "");
262
        // remove all runs between first and last
263
        for (StandardRun run : affectedRuns) {
264 2 1. removeExpression : negated conditional → KILLED
2. removeExpression : negated conditional → KILLED
            if (!Objects.equals(run, firstRun) && !Objects.equals(run, lastRun)) {
265
                contents.remove(run.run());
266
            }
267
        }
268
        // remove the expression from the last run
269 1 1. removeExpression : removed call to pro/verron/officestamper/core/StandardParagraph$StandardRun::replace → KILLED
        lastRun.replace(matchStartIndex, matchEndIndex, "");
270
    }
271
272
    @Override
273
    public void replace(Object from, Object to, R run) {
274
        var fromIndex = contents.indexOf(from);
275
        var toIndex = contents.indexOf(to);
276 2 1. replace : changed conditional boundary → SURVIVED
2. replace : negated conditional → KILLED
        if (fromIndex < 0) {
277
            var msg = "The start element (%s) is not in the paragraph (%s)";
278
            throw new OfficeStamperException(msg.formatted(from, this));
279
        }
280 2 1. replace : changed conditional boundary → SURVIVED
2. replace : negated conditional → KILLED
        if (toIndex < 0) {
281
            var msg = "The end element (%s) is not in the paragraph (%s)";
282
            throw new OfficeStamperException(msg.formatted(to, this));
283
        }
284 2 1. replace : changed conditional boundary → SURVIVED
2. replace : negated conditional → KILLED
        if (fromIndex > toIndex) {
285
            var msg = "The start element (%s) is after the end element (%s)";
286
            throw new OfficeStamperException(msg.formatted(to, this));
287
        }
288
        var expression = extractExpression(from, to);
289 1 1. replace : removed call to pro/verron/officestamper/core/StandardParagraph::replaceExpressionWithRun → KILLED
        replaceExpressionWithRun(expression, run);
290
    }
291
292
    private static void replaceWithBr(
293
            Placeholder placeholder,
294
            Br br,
295
            Text text,
296
            ListIterator<Object> runContentIterator
297
    ) {
298
        var value = text.getValue();
299 1 1. replaceWithBr : removed call to java/util/ListIterator::remove → KILLED
        runContentIterator.remove();
300
        var runLinebreakIterator = stream(value.split(placeholder.expression())).iterator();
301 1 1. replaceWithBr : negated conditional → KILLED
        while (runLinebreakIterator.hasNext()) {
302
            var subText = WmlFactory.newText(runLinebreakIterator.next());
303 1 1. replaceWithBr : removed call to java/util/ListIterator::add → KILLED
            runContentIterator.add(subText);
304 2 1. replaceWithBr : negated conditional → KILLED
2. replaceWithBr : removed call to java/util/ListIterator::add → KILLED
            if (runLinebreakIterator.hasNext()) runContentIterator.add(br);
305
        }
306
    }
307
308
    private String extractExpression(Object from, Object to) {
309
        var fromIndex = contents.indexOf(from);
310
        var toIndex = contents.indexOf(to);
311 1 1. extractExpression : Replaced integer addition with subtraction → KILLED
        var subContent = contents.subList(fromIndex, toIndex + 1);
312
313
        var subRuns = new ArrayList<>(runs);
314 2 1. lambda$extractExpression$0 : negated conditional → KILLED
2. lambda$extractExpression$0 : replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph::lambda$extractExpression$0 → KILLED
        subRuns.removeIf(run -> !subContent.contains(run.run()));
315 1 1. extractExpression : replaced return value with "" for pro/verron/officestamper/core/StandardParagraph::extractExpression → KILLED
        return subRuns.stream()
316
                      .map(StandardRun::getText)
317
                      .collect(joining());
318
    }
319
320
    /// Returns the aggregated text over all runs.
321
    ///
322
    /// @return the text of all runs.
323
    @Override
324
    public String asString() {
325 1 1. asString : replaced return value with "" for pro/verron/officestamper/core/StandardParagraph::asString → KILLED
        return runs.stream()
326
                   .map(StandardRun::getText)
327
                   .collect(joining());
328
    }
329
330
    /// Applies the given consumer to the paragraph represented by the current instance.
331
    /// This method facilitates custom processing by allowing the client to define
332
    /// specific operations to be performed on the paragraph's internal structure.
333
    ///
334
    /// @param pConsumer the consumer function to apply to the paragraph's structure.
335
    @Override
336
    public void apply(Consumer<P> pConsumer) {
337 1 1. apply : removed call to java/util/function/Consumer::accept → KILLED
        pConsumer.accept(p);
338
    }
339
340
    /// Retrieves the nearest parent of the specified type for the current paragraph.
341
    /// The search is performed starting from the current paragraph and traversing
342
    /// up to the root, with a default maximum depth of Integer.MAX_VALUE.
343
    ///
344
    /// @param aClass the class type of the parent to search for
345
    /// @param <T>    the generic type of the parent
346
    ///
347
    /// @return an Optional containing the parent of the specified type if found,
348
    ///         or an empty Optional if no parent of the given type exists
349
    @Override
350
    public <T> Optional<T> parent(Class<T> aClass) {
351 1 1. parent : replaced return value with Optional.empty for pro/verron/officestamper/core/StandardParagraph::parent → KILLED
        return parent(aClass, Integer.MAX_VALUE);
352
    }
353
354
    /// Retrieves the collection of comments associated with the current paragraph.
355
    ///
356
    /// @return a collection of [Comments.Comment] objects related to the paragraph.
357
    @Override
358
    public Collection<Comments.Comment> getComment() {
359 1 1. getComment : replaced return value with Collections.emptyList for pro/verron/officestamper/core/StandardParagraph::getComment → KILLED
        return CommentUtil.getCommentFor(contents, source.document());
360
    }
361
362
    private Comment comment(Placeholder placeholder) {
363
        var id = new BigInteger(16, RANDOM);
364 1 1. comment : replaced return value with null for pro/verron/officestamper/core/StandardParagraph::comment → KILLED
        return StandardComment.create(source.document(), p, placeholder, id);
365
    }
366
367
    /// Returns the string representation of the paragraph.
368
    /// This method delegates to the `asString` method to aggregate the text content of all runs.
369
    ///
370
    /// @return a string containing the combined text content of the paragraph's runs.
371
    @Override
372
    public String toString() {
373 1 1. toString : replaced return value with "" for pro/verron/officestamper/core/StandardParagraph::toString → NO_COVERAGE
        return asString();
374
    }
375
376
    /// Represents a run (i.e., a text fragment) in a paragraph. The run is indexed relative to the containing paragraph
377
    /// and also relative to the containing document.
378
    ///
379
    /// @param startIndex    the start index of the run relative to the containing paragraph.
380
    /// @param indexInParent the index of the run relative to the containing document.
381
    /// @param run           the run itself.
382
    ///
383
    /// @author Joseph Verron
384
    /// @author Tom Hombergs
385
    /// @version ${version}
386
    /// @since 1.0.0
387
    public record StandardRun(int startIndex, int indexInParent, R run) {
388
389
        /// Retrieves a substring from the text content of this run, starting at the specified begin index.
390
        ///
391
        /// @param beginIndex the beginning index, inclusive, for the substring.
392
        ///
393
        /// @return the substring of the run's text starting from the specified begin index to the end of the text.
394
        public String substring(int beginIndex) {
395 1 1. substring : replaced return value with "" for pro/verron/officestamper/core/StandardParagraph$StandardRun::substring → KILLED
            return getText().substring(beginIndex);
396
        }
397
398
        /// Retrieves a substring from the text content of this run, starting
399
        /// at the specified begin index and ending at the specified end index.
400
        ///
401
        /// @param beginIndex the beginning index, inclusive, for the substring.
402
        /// @param endIndex   the ending index, exclusive, for the substring.
403
        ///
404
        /// @return the substring of the run's text from the specified begin index to the specified end index.
405
        public String substring(int beginIndex, int endIndex) {
406 1 1. substring : replaced return value with "" for pro/verron/officestamper/core/StandardParagraph$StandardRun::substring → KILLED
            return getText().substring(beginIndex, endIndex);
407
        }
408
409
        /// Finds the index of the first occurrence of the specified substring in the text of the current run.
410
        ///
411
        /// @param full the substring to search for within the run's text.
412
        ///
413
        /// @return the index of the first occurrence of the specified substring,
414
        /// or &ndash;1 if the substring is not found.
415
        public int indexOf(String full) {
416 1 1. indexOf : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph$StandardRun::indexOf → KILLED
            return getText().indexOf(full);
417
        }
418
419
        /// Returns the text string of a run.
420
        ///
421
        /// @return [String] representation of the run.
422
        public String getText() {
423 1 1. getText : replaced return value with "" for pro/verron/officestamper/core/StandardParagraph$StandardRun::getText → KILLED
            return RunUtil.getText(run);
424
        }
425
426
        /// Retrieves the properties associated with this run.
427
        ///
428
        /// @return the [RPr] object representing the properties of the run.
429
        public RPr getPr() {
430 1 1. getPr : replaced return value with null for pro/verron/officestamper/core/StandardParagraph$StandardRun::getPr → KILLED
            return run.getRPr();
431
        }
432
433
        /// Determines whether the current run is affected by the specified range of global start and end indices.
434
        /// A run is considered "touched" if any part of it overlaps with the given range.
435
        ///
436
        /// @param globalStartIndex the global start index of the range.
437
        /// @param globalEndIndex   the global end index of the range.
438
        ///
439
        /// @return `true` if the current run is touched by the specified range; `false` otherwise.
440
        public boolean isTouchedByRange(int globalStartIndex, int globalEndIndex) {
441 3 1. isTouchedByRange : replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph$StandardRun::isTouchedByRange → KILLED
2. isTouchedByRange : negated conditional → KILLED
3. isTouchedByRange : negated conditional → KILLED
            return startsInRange(globalStartIndex, globalEndIndex) || endsInRange(globalStartIndex, globalEndIndex)
442 1 1. isTouchedByRange : negated conditional → KILLED
                   || englobesRange(globalStartIndex, globalEndIndex);
443
        }
444
445
        private boolean startsInRange(int globalStartIndex, int globalEndIndex) {
446 5 1. startsInRange : changed conditional boundary → SURVIVED
2. startsInRange : negated conditional → KILLED
3. startsInRange : replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph$StandardRun::startsInRange → KILLED
4. startsInRange : negated conditional → KILLED
5. startsInRange : changed conditional boundary → KILLED
            return globalStartIndex < startIndex && startIndex <= globalEndIndex;
447
        }
448
449
        private boolean endsInRange(int globalStartIndex, int globalEndIndex) {
450 5 1. endsInRange : changed conditional boundary → SURVIVED
2. endsInRange : negated conditional → KILLED
3. endsInRange : negated conditional → KILLED
4. endsInRange : changed conditional boundary → KILLED
5. endsInRange : replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph$StandardRun::endsInRange → KILLED
            return globalStartIndex < endIndex() && endIndex() <= globalEndIndex;
451
        }
452
453
        private boolean englobesRange(int globalStartIndex, int globalEndIndex) {
454 5 1. englobesRange : changed conditional boundary → SURVIVED
2. englobesRange : changed conditional boundary → SURVIVED
3. englobesRange : negated conditional → KILLED
4. englobesRange : negated conditional → KILLED
5. englobesRange : replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph$StandardRun::englobesRange → KILLED
            return startIndex <= globalStartIndex && globalEndIndex <= endIndex();
455
        }
456
457
        /// Calculates the end index of the current run based on its start index and length.
458
        ///
459
        /// @return the end index of the run.
460
        public int endIndex() {
461 2 1. endIndex : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph$StandardRun::endIndex → KILLED
2. endIndex : Replaced integer addition with subtraction → KILLED
            return startIndex + length();
462
        }
463
464
        /// Calculates the length of the text content of this run.
465
        ///
466
        /// @return the length of the text in the current run.
467
        public int length() {
468 1 1. length : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph$StandardRun::length → KILLED
            return getText().length();
469
        }
470
471
        /// Replaces the substring starting at the given index with the given replacement string.
472
        ///
473
        /// @param globalStartIndex the global index at which to start the replacement.
474
        /// @param globalEndIndex   the global index at which to end the replacement.
475
        /// @param replacement      the string to replace the substring at the specified global index.
476
        public void replace(int globalStartIndex, int globalEndIndex, String replacement) {
477
            int localStartIndex = globalIndexToLocalIndex(globalStartIndex);
478
            int localEndIndex = globalIndexToLocalIndex(globalEndIndex);
479
            var text = substring(0, localStartIndex);
480
            text += replacement;
481
            String runText = getText();
482 1 1. replace : negated conditional → KILLED
            if (!runText.isEmpty()) {
483
                text += substring(localEndIndex);
484
            }
485 1 1. replace : removed call to pro/verron/officestamper/core/RunUtil::setText → KILLED
            RunUtil.setText(run, text);
486
        }
487
488
        /// Converts a global index to a local index within the context of this run.
489
        /// (meaning the index relative to multiple aggregated runs)
490
        ///
491
        /// @param globalIndex the global index to convert.
492
        ///
493
        /// @return the local index corresponding to the given global index.
494
        private int globalIndexToLocalIndex(int globalIndex) {
495 2 1. globalIndexToLocalIndex : changed conditional boundary → SURVIVED
2. globalIndexToLocalIndex : negated conditional → KILLED
            if (globalIndex < startIndex) return 0;
496 3 1. globalIndexToLocalIndex : changed conditional boundary → SURVIVED
2. globalIndexToLocalIndex : negated conditional → KILLED
3. globalIndexToLocalIndex : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph$StandardRun::globalIndexToLocalIndex → KILLED
            else if (globalIndex > endIndex()) return length();
497 2 1. globalIndexToLocalIndex : replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph$StandardRun::globalIndexToLocalIndex → KILLED
2. globalIndexToLocalIndex : Replaced integer subtraction with addition → KILLED
            else return globalIndex - startIndex;
498
        }
499
    }
500
}

Mutations

52

1.1
Location : initializeRunList
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:#22]
changed conditional boundary → KILLED

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

54

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

57

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

60

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

70

1.1
Location : from
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:#22]
replaced return value with null for pro/verron/officestamper/core/StandardParagraph::from → KILLED

82

1.1
Location : from
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:#36]
replaced return value with null for pro/verron/officestamper/core/StandardParagraph::from → KILLED

96

1.1
Location : processorContext
Killed by : pro.verron.officestamper.test.SpelInjectionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.SpelInjectionTest]/[test-template:spelInjectionTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
replaced return value with null for pro/verron/officestamper/core/StandardParagraph::processorContext → KILLED

110

1.1
Location : replace
Killed by : pro.verron.officestamper.test.ProcessorRepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatParagraphTest]/[method:shouldAcceptSet()]
changed conditional boundary → KILLED

2.2
Location : replace
Killed by : pro.verron.officestamper.test.ProcessorRepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatParagraphTest]/[method:shouldAcceptSet()]
negated conditional → KILLED

116

1.1
Location : siblings
Killed by : pro.verron.officestamper.test.ProcessorRepeatParagraphTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatParagraphTest]/[method:shouldAcceptSet()]
replaced return value with Collections.emptyList for pro/verron/officestamper/core/StandardParagraph::siblings → KILLED

122

1.1
Location : parent
Killed by : pro.verron.officestamper.test.ProcessorDisplayIfTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorDisplayIfTest]/[test-template:conditionalDisplayOfTableRowsTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
replaced return value with Optional.empty for pro/verron/officestamper/core/StandardParagraph::parent → KILLED

129

1.1
Location : remove
Killed by : pro.verron.officestamper.test.ProcessorDisplayIfTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorDisplayIfTest]/[test-template:conditionalDisplayOfTableBug32Test(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
removed call to pro/verron/officestamper/utils/WmlUtils::remove → KILLED

140

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

150

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

153

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

154

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

160

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:#13]
removed call to pro/verron/officestamper/core/StandardParagraph::replaceExpressionWithRun → KILLED

167

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

171

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

174

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

184

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

186

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

189

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:#37]
negated conditional → KILLED

190

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:#37]
negated conditional → KILLED

191

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

192

1.1
Location : replace
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

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

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

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

194

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

196

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:#37]
negated conditional → KILLED

199

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:#37]
negated conditional → KILLED

200

1.1
Location : replace
Killed by : none
removed call to pro/verron/officestamper/core/StandardParagraph$StandardRun::replace → NO_COVERAGE

201

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

203

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

204

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:#37]
removed call to pro/verron/officestamper/core/StandardParagraph$StandardRun::replace → KILLED

205

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

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

207

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

209

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:#5]
Replaced integer addition with subtraction → KILLED

223

1.1
Location : replace
Killed by : pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#6]
removed call to org/docx4j/wml/R::setRPr → KILLED

224

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

226

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

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

236

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

238

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

242

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

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

248

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

249

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

261

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

264

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

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

269

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

276

1.1
Location : replace
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

2.2
Location : replace
Killed by : pro.verron.officestamper.test.ProcessorReplaceWithTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorReplaceWithTest]/[method:notWorking1()]
negated conditional → KILLED

280

1.1
Location : replace
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

2.2
Location : replace
Killed by : pro.verron.officestamper.test.ProcessorReplaceWithTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorReplaceWithTest]/[method:notWorking1()]
negated conditional → KILLED

284

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

2.2
Location : replace
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

289

1.1
Location : replace
Killed by : pro.verron.officestamper.test.ProcessorReplaceWithTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorReplaceWithTest]/[method:notWorking1()]
removed call to pro/verron/officestamper/core/StandardParagraph::replaceExpressionWithRun → KILLED

299

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

301

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

303

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

304

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

2.2
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:#32]
removed call to java/util/ListIterator::add → KILLED

311

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

314

1.1
Location : lambda$extractExpression$0
Killed by : pro.verron.officestamper.test.ProcessorReplaceWithTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorReplaceWithTest]/[method:notWorking1()]
negated conditional → KILLED

2.2
Location : lambda$extractExpression$0
Killed by : pro.verron.officestamper.test.ProcessorReplaceWithTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorReplaceWithTest]/[method:notWorking1()]
replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph::lambda$extractExpression$0 → KILLED

315

1.1
Location : extractExpression
Killed by : pro.verron.officestamper.test.ProcessorReplaceWithTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorReplaceWithTest]/[method:notWorking1()]
replaced return value with "" for pro/verron/officestamper/core/StandardParagraph::extractExpression → KILLED

325

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:#22]
replaced return value with "" for pro/verron/officestamper/core/StandardParagraph::asString → KILLED

337

1.1
Location : apply
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:#17]
removed call to java/util/function/Consumer::accept → KILLED

351

1.1
Location : parent
Killed by : pro.verron.officestamper.test.ProcessorDisplayIfTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorDisplayIfTest]/[test-template:conditionalDisplayOfTableRowsTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#2]
replaced return value with Optional.empty for pro/verron/officestamper/core/StandardParagraph::parent → KILLED

359

1.1
Location : getComment
Killed by : pro.verron.officestamper.test.FailOnUnresolvedPlaceholderTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.FailOnUnresolvedPlaceholderTest]/[test-template:fails(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
replaced return value with Collections.emptyList for pro/verron/officestamper/core/StandardParagraph::getComment → KILLED

364

1.1
Location : comment
Killed by : pro.verron.officestamper.test.SpelInjectionTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.SpelInjectionTest]/[test-template:spelInjectionTest(pro.verron.officestamper.test.ContextFactory)]/[test-template-invocation:#1]
replaced return value with null for pro/verron/officestamper/core/StandardParagraph::comment → KILLED

373

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

395

1.1
Location : substring
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 return value with "" for pro/verron/officestamper/core/StandardParagraph$StandardRun::substring → KILLED

406

1.1
Location : substring
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]
replaced return value with "" for pro/verron/officestamper/core/StandardParagraph$StandardRun::substring → KILLED

416

1.1
Location : indexOf
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$StandardRun::indexOf → KILLED

423

1.1
Location : getText
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:#22]
replaced return value with "" for pro/verron/officestamper/core/StandardParagraph$StandardRun::getText → KILLED

430

1.1
Location : getPr
Killed by : pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#3]
replaced return value with null for pro/verron/officestamper/core/StandardParagraph$StandardRun::getPr → KILLED

441

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

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

3.3
Location : isTouchedByRange
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:#13]
negated conditional → KILLED

442

1.1
Location : isTouchedByRange
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

446

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

2.2
Location : startsInRange
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

3.3
Location : startsInRange
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:#3]
replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph$StandardRun::startsInRange → KILLED

4.4
Location : startsInRange
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:#3]
negated conditional → KILLED

5.5
Location : startsInRange
Killed by : pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#3]
changed conditional boundary → KILLED

450

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

2.2
Location : endsInRange
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

3.3
Location : endsInRange
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:#13]
negated conditional → KILLED

4.4
Location : endsInRange
Killed by : pro.verron.officestamper.test.ProcessorRepeatTableRowTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.ProcessorRepeatTableRowTest]/[test-template:features(java.lang.String, pro.verron.officestamper.api.OfficeStamperConfiguration, java.lang.Object, java.io.InputStream, java.lang.String)]/[test-template-invocation:#3]
changed conditional boundary → KILLED

5.5
Location : endsInRange
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:#3]
replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph$StandardRun::endsInRange → KILLED

454

1.1
Location : englobesRange
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

2.2
Location : englobesRange
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

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

4.4
Location : englobesRange
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

5.5
Location : englobesRange
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:#3]
replaced boolean return with true for pro/verron/officestamper/core/StandardParagraph$StandardRun::englobesRange → KILLED

461

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

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

468

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

482

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:#3]
negated conditional → KILLED

485

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

495

1.1
Location : globalIndexToLocalIndex
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

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

496

1.1
Location : globalIndexToLocalIndex
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

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

3.3
Location : globalIndexToLocalIndex
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:#13]
replaced int return with 0 for pro/verron/officestamper/core/StandardParagraph$StandardRun::globalIndexToLocalIndex → KILLED

497

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

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

Active mutators

Tests examined


Report generated by PIT 1.21.0