AbstractCommentProcessor.java

1
package pro.verron.officestamper.api;
2
3
import org.docx4j.wml.P;
4
import org.docx4j.wml.R;
5
import org.springframework.lang.Nullable;
6
7
import java.util.Objects;
8
9
/**
10
 * AbstractCommentProcessor is an abstract base class for comment processors.
11
 * It implements the CommentProcessor interface.
12
 * It provides common functionality and fields that subclasses can use.
13
 */
14
public abstract class AbstractCommentProcessor
15
        implements CommentProcessor {
16
    /**
17
     * PlaceholderReplacer used to replace expressions in the comment text.
18
     */
19
    protected final ParagraphPlaceholderReplacer placeholderReplacer;
20
    private P paragraph;
21
    private R currentRun;
22
    private Comment currentComment;
23
24
    /**
25
     * Creates an instance of AbstractCommentProcessor with the given ParagraphPlaceholderReplacer.
26
     *
27
     * @param placeholderReplacer the ParagraphPlaceholderReplacer used to replace expressions in the comment text
28
     */
29
    protected AbstractCommentProcessor(ParagraphPlaceholderReplacer placeholderReplacer) {
30
        this.placeholderReplacer = placeholderReplacer;
31
    }
32
33
    /**
34
     * <p>Getter for the field <code>currentCommentWrapper</code>.</p>
35
     *
36
     * @return a {@link Comment} object
37
     */
38
    public Comment getCurrentCommentWrapper() {
39 1 1. getCurrentCommentWrapper : replaced return value with null for pro/verron/officestamper/api/AbstractCommentProcessor::getCurrentCommentWrapper → KILLED
        return currentComment;
40
    }
41
42
    /**
43
     * {@inheritDoc}
44
     */
45
    @Override
46
    public void setCurrentCommentWrapper(Comment currentComment) {
47
        Objects.requireNonNull(currentComment.getCommentRangeStart());
48
        Objects.requireNonNull(currentComment.getCommentRangeEnd());
49
        this.currentComment = currentComment;
50
    }
51
52
    /**
53
     * <p>Getter for the field <code>paragraph</code>.</p>
54
     *
55
     * @return a {@link P} object
56
     */
57
    public P getParagraph() {
58 1 1. getParagraph : replaced return value with null for pro/verron/officestamper/api/AbstractCommentProcessor::getParagraph → KILLED
        return paragraph;
59
    }
60
61
    /**
62
     * {@inheritDoc}
63
     */
64
    @Override
65
    public void setParagraph(P paragraph) {
66
        this.paragraph = paragraph;
67
    }
68
69
    /**
70
     * <p>Getter for the field <code>currentRun</code>.</p>
71
     *
72
     * @return a {@link R} object
73
     */
74
    public R getCurrentRun() {
75 1 1. getCurrentRun : replaced return value with null for pro/verron/officestamper/api/AbstractCommentProcessor::getCurrentRun → KILLED
        return currentRun;
76
    }
77
78
    /**
79
     * {@inheritDoc}
80
     */
81
    @Override
82
    public void setCurrentRun(@Nullable R run) {
83
        this.currentRun = run;
84
    }
85
}

Mutations

39

1.1
Location : getCurrentCommentWrapper
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:#14]
replaced return value with null for pro/verron/officestamper/api/AbstractCommentProcessor::getCurrentCommentWrapper → KILLED

58

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

75

1.1
Location : getCurrentRun
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:#30]
replaced return value with null for pro/verron/officestamper/api/AbstractCommentProcessor::getCurrentRun → KILLED

Active mutators

Tests examined


Report generated by PIT 1.17.0