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

Mutations

40

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

49

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

52

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

53

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

54

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

56

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

68

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

70

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

83

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

88

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

92

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

96

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

99

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

106

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

107

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

108

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

109

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

111

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

114

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

116

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

117

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

119

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

120

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

121

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

122

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

124

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

125

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

126

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

127

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

129

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

133

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

138

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

139

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

140

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

142

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

147

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

148

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

151

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

152

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

156

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

165

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 java/util/List::add → KILLED

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

167

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

189

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

196

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

197

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

206

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

207

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

208

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

216

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

219

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

221

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

227

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

234

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

235

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

236

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

237

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

238

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

239

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

240

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

241

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

242

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

243

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

244

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

245

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

246

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

247

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

248

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

249

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

250

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

251

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

252

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

253

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

254

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

255

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

256

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

257

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

258

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

259

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

260

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

261

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

262

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

263

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

264

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

265

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

266

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

267

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

268

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

269

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

270

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

271

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

272

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

273

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

274

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

275

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

276

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

277

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

278

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

279

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

280

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

281

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

282

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

283

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

284

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

285

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

286

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

287

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

288

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

289

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

290

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

298

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.0