PowerpointParagraph.java

1
package pro.verron.officestamper.experimental;
2
3
import org.docx4j.dml.CTRegularTextRun;
4
import org.docx4j.dml.CTTextCharacterProperties;
5
import org.docx4j.dml.CTTextParagraph;
6
import org.docx4j.wml.Comments;
7
import org.docx4j.wml.ContentAccessor;
8
import org.docx4j.wml.P;
9
import org.docx4j.wml.R;
10
import pro.verron.officestamper.api.*;
11
import pro.verron.officestamper.core.CommentUtil;
12
import pro.verron.officestamper.core.ObjectDeleter;
13
import pro.verron.officestamper.core.StandardComment;
14
import pro.verron.officestamper.utils.WmlFactory;
15
import pro.verron.officestamper.utils.WmlUtils;
16
17
import java.math.BigInteger;
18
import java.util.*;
19
import java.util.function.Consumer;
20
21
import static java.util.stream.Collectors.joining;
22
import static pro.verron.officestamper.api.OfficeStamperException.throwing;
23
24
/**
25
 * <p>A "Run" defines a region of text within a docx document with a common set of properties. Word processors are
26
 * relatively free in splitting a paragraph of text into multiple runs, so there is no strict rule to say over how many
27
 * runs a word or a string of words is spread.</p>
28
 * <p>This class aggregates multiple runs so they can be treated as a single text, no matter how many runs the text
29
 * spans.
30
 *
31
 * @author Joseph Verron
32
 * @author Tom Hombergs
33
 * @version ${version}
34
 * @since 1.0.8
35
 */
36
public class PowerpointParagraph
37
        implements Paragraph {
38
39
    private static final Random RANDOM = new Random();
40
    private final DocxPart source;
41
    private final List<PowerpointRun> runs = new ArrayList<>();
42
    private final CTTextParagraph paragraph;
43
    private int currentPosition = 0;
44
45
    /**
46
     * Constructs a new ParagraphWrapper for the given paragraph.
47
     *
48
     * @param paragraph the paragraph to wrap.
49
     */
50
    public PowerpointParagraph(PptxPart source, CTTextParagraph paragraph) {
51
        this.source = source;
52
        this.paragraph = paragraph;
53 1 1. <init> : removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → KILLED
        recalculateRuns();
54
    }
55
56
    /**
57
     * Recalculates the runs of the paragraph. This method is called automatically by the constructor, but can also be
58
     * called manually to recalculate the runs after a modification to the paragraph was done.
59
     */
60
    private void recalculateRuns() {
61
        currentPosition = 0;
62 1 1. recalculateRuns : removed call to java/util/List::clear → SURVIVED
        this.runs.clear();
63
        int index = 0;
64
        for (Object contentElement : paragraph.getEGTextRun()) {
65 1 1. recalculateRuns : negated conditional → KILLED
            if (contentElement instanceof CTRegularTextRun r && !r.getT()
66 1 1. recalculateRuns : negated conditional → KILLED
                                                                  .isEmpty()) {
67 1 1. recalculateRuns : removed call to pro/verron/officestamper/experimental/PowerpointParagraph::addRun → KILLED
                this.addRun(r, index);
68
            }
69 1 1. recalculateRuns : Changed increment from 1 to -1 → SURVIVED
            index++;
70
        }
71
    }
72
73
    /**
74
     * Adds a run to the aggregation.
75
     *
76
     * @param run the run to add.
77
     */
78
    private void addRun(CTRegularTextRun run, int index) {
79
        int startIndex = currentPosition;
80
        int endIndex = currentPosition + run.getT()
81 2 1. addRun : Replaced integer subtraction with addition → KILLED
2. addRun : Replaced integer addition with subtraction → KILLED
                                            .length() - 1;
82
        runs.add(new PowerpointRun(startIndex, endIndex, index, run));
83 1 1. addRun : Replaced integer addition with subtraction → SURVIVED
        currentPosition = endIndex + 1;
84
    }
85
86
    @Override public ProcessorContext processorContext(Placeholder placeholder) {
87
        var comment = comment(placeholder);
88
        var firstRun = (R) paragraph.getEGTextRun()
89
                                    .getFirst();
90 1 1. processorContext : replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::processorContext → NO_COVERAGE
        return new ProcessorContext(this, firstRun, comment, placeholder);
91
    }
92
93
    @Override public void replace(List<P> toRemove, List<P> toAdd) {
94
        int index = siblings().indexOf(getP());
95 2 1. replace : negated conditional → NO_COVERAGE
2. replace : changed conditional boundary → NO_COVERAGE
        if (index < 0) throw new OfficeStamperException("Impossible");
96
97
        siblings().addAll(index, toAdd);
98
        siblings().removeAll(toRemove);
99
    }
100
101
    private List<Object> siblings() {
102 1 1. siblings : replaced return value with Collections.emptyList for pro/verron/officestamper/experimental/PowerpointParagraph::siblings → NO_COVERAGE
        return this.parent(ContentAccessor.class, 1)
103
                   .orElseThrow(throwing("Not a standard Child with common parent"))
104
                   .getContent();
105
    }
106
107
    private <T> Optional<T> parent(Class<T> aClass, int depth) {
108 1 1. parent : replaced return value with Optional.empty for pro/verron/officestamper/experimental/PowerpointParagraph::parent → NO_COVERAGE
        return WmlUtils.getFirstParentWithClass(getP(), aClass, depth);
109
    }
110
111
    @Override public void remove() {
112 1 1. remove : removed call to pro/verron/officestamper/core/ObjectDeleter::deleteParagraph → NO_COVERAGE
        ObjectDeleter.deleteParagraph(getP());
113
    }
114
115
    @Override public P getP() {
116
        var p = WmlFactory.newParagraph(paragraph.getEGTextRun());
117 1 1. getP : removed call to org/docx4j/wml/P::setParent → NO_COVERAGE
        p.setParent(paragraph.getParent());
118 1 1. getP : replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::getP → NO_COVERAGE
        return p;
119
    }
120
121
    /**
122
     * Replaces the given expression with the replacement object within
123
     * the paragraph.
124
     * The replacement object must be a valid DOCX4J Object.
125
     *
126
     * @param placeholder the expression to be replaced.
127
     * @param replacement the object to replace the expression.
128
     */
129
    @Override public void replace(Placeholder placeholder, Object replacement) {
130 1 1. replace : negated conditional → KILLED
        if (!(replacement instanceof CTRegularTextRun replacementRun))
131
            throw new AssertionError("replacement is not a CTRegularTextRun");
132
        String text = asString();
133
        String full = placeholder.expression();
134
        int matchStartIndex = text.indexOf(full);
135 1 1. replace : negated conditional → KILLED
        if (matchStartIndex == -1) {
136
            // nothing to replace
137
            return;
138
        }
139 2 1. replace : Replaced integer subtraction with addition → SURVIVED
2. replace : Replaced integer addition with subtraction → KILLED
        int matchEndIndex = matchStartIndex + full.length() - 1;
140
        List<PowerpointRun> affectedRuns = getAffectedRuns(matchStartIndex, matchEndIndex);
141
142 1 1. replace : negated conditional → KILLED
        boolean singleRun = affectedRuns.size() == 1;
143
144
        List<Object> runs = this.paragraph.getEGTextRun();
145 1 1. replace : negated conditional → KILLED
        if (singleRun) {
146
            PowerpointRun run = affectedRuns.getFirst();
147
148
            boolean expressionSpansCompleteRun = full.length() == run.run()
149
                                                                     .getT()
150 1 1. replace : negated conditional → NO_COVERAGE
                                                                     .length();
151 1 1. replace : negated conditional → NO_COVERAGE
            boolean expressionAtStartOfRun = matchStartIndex == run.startIndex();
152 1 1. replace : negated conditional → NO_COVERAGE
            boolean expressionAtEndOfRun = matchEndIndex == run.endIndex();
153 4 1. replace : negated conditional → NO_COVERAGE
2. replace : changed conditional boundary → NO_COVERAGE
3. replace : negated conditional → NO_COVERAGE
4. replace : changed conditional boundary → NO_COVERAGE
            boolean expressionWithinRun = matchStartIndex > run.startIndex() && matchEndIndex < run.endIndex();
154
155 1 1. replace : removed call to org/docx4j/dml/CTRegularTextRun::setRPr → NO_COVERAGE
            replacementRun.setRPr(run.run()
156
                                     .getRPr());
157
158 1 1. replace : negated conditional → NO_COVERAGE
            if (expressionSpansCompleteRun) {
159
                runs.remove(run.run());
160 1 1. replace : removed call to java/util/List::add → NO_COVERAGE
                runs.add(run.indexInParent(), replacement);
161 1 1. replace : removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → NO_COVERAGE
                recalculateRuns();
162
            }
163 1 1. replace : negated conditional → NO_COVERAGE
            else if (expressionAtStartOfRun) {
164 1 1. replace : removed call to pro/verron/officestamper/experimental/PowerpointRun::replace → NO_COVERAGE
                run.replace(matchStartIndex, matchEndIndex, "");
165 1 1. replace : removed call to java/util/List::add → NO_COVERAGE
                runs.add(run.indexInParent(), replacement);
166 1 1. replace : removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → NO_COVERAGE
                recalculateRuns();
167
            }
168 1 1. replace : negated conditional → NO_COVERAGE
            else if (expressionAtEndOfRun) {
169 1 1. replace : removed call to pro/verron/officestamper/experimental/PowerpointRun::replace → NO_COVERAGE
                run.replace(matchStartIndex, matchEndIndex, "");
170 2 1. replace : Replaced integer addition with subtraction → NO_COVERAGE
2. replace : removed call to java/util/List::add → NO_COVERAGE
                runs.add(run.indexInParent() + 1, replacement);
171 1 1. replace : removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → NO_COVERAGE
                recalculateRuns();
172
            }
173 1 1. replace : negated conditional → NO_COVERAGE
            else if (expressionWithinRun) {
174
                String runText = run.run()
175
                                    .getT();
176
                int startIndex = runText.indexOf(full);
177 1 1. replace : Replaced integer addition with subtraction → NO_COVERAGE
                int endIndex = startIndex + full.length();
178
                String substring1 = runText.substring(0, startIndex);
179
                CTRegularTextRun run1 = create(substring1, this.paragraph);
180
                String substring2 = runText.substring(endIndex);
181
                CTRegularTextRun run2 = create(substring2, this.paragraph);
182 1 1. replace : removed call to java/util/List::add → NO_COVERAGE
                runs.add(run.indexInParent(), run2);
183 1 1. replace : removed call to java/util/List::add → NO_COVERAGE
                runs.add(run.indexInParent(), replacement);
184 1 1. replace : removed call to java/util/List::add → NO_COVERAGE
                runs.add(run.indexInParent(), run1);
185
                runs.remove(run.run());
186 1 1. replace : removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → NO_COVERAGE
                recalculateRuns();
187
            }
188
        }
189
        else {
190
            PowerpointRun firstRun = affectedRuns.getFirst();
191
            PowerpointRun lastRun = affectedRuns.getLast();
192 1 1. replace : removed call to org/docx4j/dml/CTRegularTextRun::setRPr → SURVIVED
            replacementRun.setRPr(firstRun.run()
193
                                          .getRPr());
194
            // remove the expression from first and last run
195 1 1. replace : removed call to pro/verron/officestamper/experimental/PowerpointRun::replace → KILLED
            firstRun.replace(matchStartIndex, matchEndIndex, "");
196 1 1. replace : removed call to pro/verron/officestamper/experimental/PowerpointRun::replace → KILLED
            lastRun.replace(matchStartIndex, matchEndIndex, "");
197
198
            // remove all runs between first and last
199
            for (PowerpointRun run : affectedRuns) {
200 2 1. replace : negated conditional → KILLED
2. replace : negated conditional → KILLED
                if (!Objects.equals(run, firstRun) && !Objects.equals(run, lastRun)) {
201
                    runs.remove(run.run());
202
                }
203
            }
204
205
            // add replacement run between first and last run
206 2 1. replace : Replaced integer addition with subtraction → KILLED
2. replace : removed call to java/util/List::add → KILLED
            runs.add(firstRun.indexInParent() + 1, replacement);
207
208 1 1. replace : removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → SURVIVED
            recalculateRuns();
209
        }
210
    }
211
212
    /**
213
     * Returns the aggregated text over all runs.
214
     *
215
     * @return the text of all runs.
216
     */
217
    @Override public String asString() {
218 1 1. asString : replaced return value with "" for pro/verron/officestamper/experimental/PowerpointParagraph::asString → KILLED
        return runs.stream()
219
                   .map(PowerpointRun::run)
220
                   .map(CTRegularTextRun::getT)
221
                   .collect(joining()) + "\n";
222
    }
223
224
    @Override public void apply(Consumer<P> pConsumer) {
225 1 1. apply : removed call to java/util/function/Consumer::accept → NO_COVERAGE
        pConsumer.accept(getP());
226
    }
227
228
    @Override public <T> Optional<T> parent(Class<T> aClass) {
229 1 1. parent : replaced return value with Optional.empty for pro/verron/officestamper/experimental/PowerpointParagraph::parent → NO_COVERAGE
        return parent(aClass, Integer.MAX_VALUE);
230
    }
231
232
    @Override public Optional<Comments.Comment> getComment() {
233 1 1. getComment : replaced return value with Optional.empty for pro/verron/officestamper/experimental/PowerpointParagraph::getComment → NO_COVERAGE
        return CommentUtil.getCommentFor(paragraph.getEGTextRun(), source.document());
234
    }
235
236
    private List<PowerpointRun> getAffectedRuns(int startIndex, int endIndex) {
237 1 1. getAffectedRuns : replaced return value with Collections.emptyList for pro/verron/officestamper/experimental/PowerpointParagraph::getAffectedRuns → KILLED
        return runs.stream()
238 2 1. lambda$getAffectedRuns$0 : replaced boolean return with true for pro/verron/officestamper/experimental/PowerpointParagraph::lambda$getAffectedRuns$0 → SURVIVED
2. lambda$getAffectedRuns$0 : replaced boolean return with false for pro/verron/officestamper/experimental/PowerpointParagraph::lambda$getAffectedRuns$0 → KILLED
                   .filter(run -> run.isTouchedByRange(startIndex, endIndex))
239
                   .toList();
240
    }
241
242
    private static CTRegularTextRun create(
243
            String text, CTTextParagraph parentParagraph
244
    ) {
245
        CTRegularTextRun run = new CTRegularTextRun();
246 1 1. create : removed call to org/docx4j/dml/CTRegularTextRun::setT → NO_COVERAGE
        run.setT(text);
247 1 1. create : removed call to pro/verron/officestamper/experimental/PowerpointParagraph::applyParagraphStyle → NO_COVERAGE
        applyParagraphStyle(parentParagraph, run);
248 1 1. create : replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::create → NO_COVERAGE
        return run;
249
    }
250
251
    private static void applyParagraphStyle(
252
            CTTextParagraph p, CTRegularTextRun run
253
    ) {
254
        var properties = p.getPPr();
255 1 1. applyParagraphStyle : negated conditional → NO_COVERAGE
        if (properties == null) return;
256
257
        var textCharacterProperties = properties.getDefRPr();
258 1 1. applyParagraphStyle : negated conditional → NO_COVERAGE
        if (textCharacterProperties == null) return;
259
260 1 1. applyParagraphStyle : removed call to org/docx4j/dml/CTRegularTextRun::setRPr → NO_COVERAGE
        run.setRPr(apply(textCharacterProperties));
261
    }
262
263
    private static CTTextCharacterProperties apply(
264
            CTTextCharacterProperties source
265
    ) {
266 1 1. apply : replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::apply → NO_COVERAGE
        return apply(source, new CTTextCharacterProperties());
267
    }
268
269
    private static CTTextCharacterProperties apply(
270
            CTTextCharacterProperties source, CTTextCharacterProperties destination
271
    ) {
272 2 1. apply : negated conditional → NO_COVERAGE
2. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setAltLang → NO_COVERAGE
        if (source.getAltLang() != null) destination.setAltLang(source.getAltLang());
273 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setBaseline → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getBaseline() != null) destination.setBaseline(source.getBaseline());
274 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setBmk → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getBmk() != null) destination.setBmk(source.getBmk());
275 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setBlipFill → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getBlipFill() != null) destination.setBlipFill(source.getBlipFill());
276 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setCap → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getCap() != null) destination.setCap(source.getCap());
277 2 1. apply : negated conditional → NO_COVERAGE
2. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setCs → NO_COVERAGE
        if (source.getCs() != null) destination.setCs(source.getCs());
278 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setGradFill → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getGradFill() != null) destination.setGradFill(source.getGradFill());
279 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setGrpFill → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getGrpFill() != null) destination.setGrpFill(source.getGrpFill());
280 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setHighlight → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getHighlight() != null) destination.setHighlight(source.getHighlight());
281 2 1. apply : negated conditional → NO_COVERAGE
2. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setHlinkClick → NO_COVERAGE
        if (source.getHlinkClick() != null) destination.setHlinkClick(source.getHlinkClick());
282 2 1. apply : negated conditional → NO_COVERAGE
2. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setHlinkMouseOver → NO_COVERAGE
        if (source.getHlinkMouseOver() != null) destination.setHlinkMouseOver(source.getHlinkMouseOver());
283 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setKern → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getKern() != null) destination.setKern(source.getKern());
284 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setLang → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getLang() != null) destination.setLang(source.getLang());
285 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setLn → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getLn() != null) destination.setLn(source.getLn());
286 2 1. apply : negated conditional → NO_COVERAGE
2. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setLatin → NO_COVERAGE
        if (source.getLatin() != null) destination.setLatin(source.getLatin());
287 2 1. apply : negated conditional → NO_COVERAGE
2. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setNoFill → NO_COVERAGE
        if (source.getNoFill() != null) destination.setNoFill(source.getNoFill());
288 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setPattFill → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getPattFill() != null) destination.setPattFill(source.getPattFill());
289 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setSpc → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getSpc() != null) destination.setSpc(source.getSpc());
290 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setSym → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getSym() != null) destination.setSym(source.getSym());
291 2 1. apply : negated conditional → NO_COVERAGE
2. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setStrike → NO_COVERAGE
        if (source.getStrike() != null) destination.setStrike(source.getStrike());
292 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setSz → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getSz() != null) destination.setSz(source.getSz());
293 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setSmtId → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getSmtId() != 0) destination.setSmtId(source.getSmtId());
294 2 1. apply : negated conditional → NO_COVERAGE
2. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setU → NO_COVERAGE
        if (source.getU() != null) destination.setU(source.getU());
295 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setUFill → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getUFill() != null) destination.setUFill(source.getUFill());
296 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setUFillTx → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getUFillTx() != null) destination.setUFillTx(source.getUFillTx());
297 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setULn → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getULn() != null) destination.setULn(source.getULn());
298 2 1. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setULnTx → NO_COVERAGE
2. apply : negated conditional → NO_COVERAGE
        if (source.getULnTx() != null) destination.setULnTx(source.getULnTx());
299 2 1. apply : negated conditional → NO_COVERAGE
2. apply : removed call to org/docx4j/dml/CTTextCharacterProperties::setULnTx → NO_COVERAGE
        if (source.getULnTx() != null) destination.setULnTx(source.getULnTx());
300 1 1. apply : replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::apply → NO_COVERAGE
        return destination;
301
    }
302
303
    private Comment comment(Placeholder placeholder) {
304
        var parent = getP();
305
        var id = new BigInteger(16, RANDOM);
306 1 1. comment : replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::comment → NO_COVERAGE
        return StandardComment.create(source.document(), parent, placeholder, id);
307
    }
308
309
    /**
310
     * {@inheritDoc}
311
     */
312
    @Override public String toString() {
313 1 1. toString : replaced return value with "" for pro/verron/officestamper/experimental/PowerpointParagraph::toString → NO_COVERAGE
        return asString();
314
    }
315
}

Mutations

53

1.1
Location : <init>
Killed by : pro.verron.officestamper.test.BasicPowerpointTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.BasicPowerpointTest]/[method:testStamper()]
removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → KILLED

62

1.1
Location : recalculateRuns
Killed by : none
removed call to java/util/List::clear → SURVIVED
Covering tests

65

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

66

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

67

1.1
Location : recalculateRuns
Killed by : pro.verron.officestamper.test.BasicPowerpointTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.BasicPowerpointTest]/[method:testStamper()]
removed call to pro/verron/officestamper/experimental/PowerpointParagraph::addRun → KILLED

69

1.1
Location : recalculateRuns
Killed by : none
Changed increment from 1 to -1 → SURVIVED
Covering tests

81

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

2.2
Location : addRun
Killed by : pro.verron.officestamper.test.BasicPowerpointTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.BasicPowerpointTest]/[method:testStamper()]
Replaced integer addition with subtraction → KILLED

83

1.1
Location : addRun
Killed by : none
Replaced integer addition with subtraction → SURVIVED
Covering tests

90

1.1
Location : processorContext
Killed by : none
replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::processorContext → NO_COVERAGE

95

1.1
Location : replace
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : replace
Killed by : none
changed conditional boundary → NO_COVERAGE

102

1.1
Location : siblings
Killed by : none
replaced return value with Collections.emptyList for pro/verron/officestamper/experimental/PowerpointParagraph::siblings → NO_COVERAGE

108

1.1
Location : parent
Killed by : none
replaced return value with Optional.empty for pro/verron/officestamper/experimental/PowerpointParagraph::parent → NO_COVERAGE

112

1.1
Location : remove
Killed by : none
removed call to pro/verron/officestamper/core/ObjectDeleter::deleteParagraph → NO_COVERAGE

117

1.1
Location : getP
Killed by : none
removed call to org/docx4j/wml/P::setParent → NO_COVERAGE

118

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

130

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

135

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

139

1.1
Location : replace
Killed by : none
Replaced integer subtraction with addition → SURVIVED
Covering tests

2.2
Location : replace
Killed by : pro.verron.officestamper.test.BasicPowerpointTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.BasicPowerpointTest]/[method:testStamper()]
Replaced integer addition with subtraction → KILLED

142

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

145

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

150

1.1
Location : replace
Killed by : none
negated conditional → NO_COVERAGE

151

1.1
Location : replace
Killed by : none
negated conditional → NO_COVERAGE

152

1.1
Location : replace
Killed by : none
negated conditional → NO_COVERAGE

153

1.1
Location : replace
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : replace
Killed by : none
changed conditional boundary → NO_COVERAGE

3.3
Location : replace
Killed by : none
negated conditional → NO_COVERAGE

4.4
Location : replace
Killed by : none
changed conditional boundary → NO_COVERAGE

155

1.1
Location : replace
Killed by : none
removed call to org/docx4j/dml/CTRegularTextRun::setRPr → NO_COVERAGE

158

1.1
Location : replace
Killed by : none
negated conditional → NO_COVERAGE

160

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

161

1.1
Location : replace
Killed by : none
removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → NO_COVERAGE

163

1.1
Location : replace
Killed by : none
negated conditional → NO_COVERAGE

164

1.1
Location : replace
Killed by : none
removed call to pro/verron/officestamper/experimental/PowerpointRun::replace → NO_COVERAGE

165

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

166

1.1
Location : replace
Killed by : none
removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → NO_COVERAGE

168

1.1
Location : replace
Killed by : none
negated conditional → NO_COVERAGE

169

1.1
Location : replace
Killed by : none
removed call to pro/verron/officestamper/experimental/PowerpointRun::replace → NO_COVERAGE

170

1.1
Location : replace
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

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

171

1.1
Location : replace
Killed by : none
removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → NO_COVERAGE

173

1.1
Location : replace
Killed by : none
negated conditional → NO_COVERAGE

177

1.1
Location : replace
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

182

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

183

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

184

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

186

1.1
Location : replace
Killed by : none
removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → NO_COVERAGE

192

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

195

1.1
Location : replace
Killed by : pro.verron.officestamper.test.BasicPowerpointTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.BasicPowerpointTest]/[method:testStamper()]
removed call to pro/verron/officestamper/experimental/PowerpointRun::replace → KILLED

196

1.1
Location : replace
Killed by : pro.verron.officestamper.test.BasicPowerpointTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.BasicPowerpointTest]/[method:testStamper()]
removed call to pro/verron/officestamper/experimental/PowerpointRun::replace → KILLED

200

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

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

206

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

2.2
Location : replace
Killed by : pro.verron.officestamper.test.BasicPowerpointTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.BasicPowerpointTest]/[method:testStamper()]
removed call to java/util/List::add → KILLED

208

1.1
Location : replace
Killed by : none
removed call to pro/verron/officestamper/experimental/PowerpointParagraph::recalculateRuns → SURVIVED
Covering tests

218

1.1
Location : asString
Killed by : pro.verron.officestamper.test.BasicPowerpointTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.BasicPowerpointTest]/[method:testStamper()]
replaced return value with "" for pro/verron/officestamper/experimental/PowerpointParagraph::asString → KILLED

225

1.1
Location : apply
Killed by : none
removed call to java/util/function/Consumer::accept → NO_COVERAGE

229

1.1
Location : parent
Killed by : none
replaced return value with Optional.empty for pro/verron/officestamper/experimental/PowerpointParagraph::parent → NO_COVERAGE

233

1.1
Location : getComment
Killed by : none
replaced return value with Optional.empty for pro/verron/officestamper/experimental/PowerpointParagraph::getComment → NO_COVERAGE

237

1.1
Location : getAffectedRuns
Killed by : pro.verron.officestamper.test.BasicPowerpointTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.BasicPowerpointTest]/[method:testStamper()]
replaced return value with Collections.emptyList for pro/verron/officestamper/experimental/PowerpointParagraph::getAffectedRuns → KILLED

238

1.1
Location : lambda$getAffectedRuns$0
Killed by : none
replaced boolean return with true for pro/verron/officestamper/experimental/PowerpointParagraph::lambda$getAffectedRuns$0 → SURVIVED
Covering tests

2.2
Location : lambda$getAffectedRuns$0
Killed by : pro.verron.officestamper.test.BasicPowerpointTest.[engine:junit-jupiter]/[class:pro.verron.officestamper.test.BasicPowerpointTest]/[method:testStamper()]
replaced boolean return with false for pro/verron/officestamper/experimental/PowerpointParagraph::lambda$getAffectedRuns$0 → KILLED

246

1.1
Location : create
Killed by : none
removed call to org/docx4j/dml/CTRegularTextRun::setT → NO_COVERAGE

247

1.1
Location : create
Killed by : none
removed call to pro/verron/officestamper/experimental/PowerpointParagraph::applyParagraphStyle → NO_COVERAGE

248

1.1
Location : create
Killed by : none
replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::create → NO_COVERAGE

255

1.1
Location : applyParagraphStyle
Killed by : none
negated conditional → NO_COVERAGE

258

1.1
Location : applyParagraphStyle
Killed by : none
negated conditional → NO_COVERAGE

260

1.1
Location : applyParagraphStyle
Killed by : none
removed call to org/docx4j/dml/CTRegularTextRun::setRPr → NO_COVERAGE

266

1.1
Location : apply
Killed by : none
replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::apply → NO_COVERAGE

272

1.1
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setAltLang → NO_COVERAGE

273

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setBaseline → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

274

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setBmk → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

275

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setBlipFill → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

276

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setCap → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

277

1.1
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setCs → NO_COVERAGE

278

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setGradFill → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

279

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setGrpFill → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

280

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setHighlight → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

281

1.1
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setHlinkClick → NO_COVERAGE

282

1.1
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setHlinkMouseOver → NO_COVERAGE

283

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setKern → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

284

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setLang → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

285

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setLn → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

286

1.1
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setLatin → NO_COVERAGE

287

1.1
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setNoFill → NO_COVERAGE

288

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setPattFill → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

289

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setSpc → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

290

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setSym → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

291

1.1
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setStrike → NO_COVERAGE

292

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setSz → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

293

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setSmtId → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

294

1.1
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setU → NO_COVERAGE

295

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setUFill → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

296

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setUFillTx → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

297

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setULn → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

298

1.1
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setULnTx → NO_COVERAGE

2.2
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

299

1.1
Location : apply
Killed by : none
negated conditional → NO_COVERAGE

2.2
Location : apply
Killed by : none
removed call to org/docx4j/dml/CTTextCharacterProperties::setULnTx → NO_COVERAGE

300

1.1
Location : apply
Killed by : none
replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::apply → NO_COVERAGE

306

1.1
Location : comment
Killed by : none
replaced return value with null for pro/verron/officestamper/experimental/PowerpointParagraph::comment → NO_COVERAGE

313

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

Active mutators

Tests examined


Report generated by PIT 1.17.1