CompiledNode.java

1
/*******************************************************************************
2
 * Copyright (C) 2026, Leo Galambos
3
 * All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions are met:
7
 *
8
 * 1. Redistributions of source code must retain the above copyright notice,
9
 *    this list of conditions and the following disclaimer.
10
 *
11
 * 2. Redistributions in binary form must reproduce the above copyright notice,
12
 *    this list of conditions and the following disclaimer in the documentation
13
 *    and/or other materials provided with the distribution.
14
 *
15
 * 3. Neither the name of the copyright holder nor the names of its contributors
16
 *    may be used to endorse or promote products derived from this software
17
 *    without specific prior written permission.
18
 *
19
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
 * POSSIBILITY OF SUCH DAMAGE.
30
 ******************************************************************************/
31
package org.egothor.stemmer.trie;
32
33
import java.util.Arrays;
34
import java.util.Objects;
35
36
/**
37
 * Immutable compiled trie node optimized for read access.
38
 *
39
 * <p>
40
 * The returned arrays are the internal backing storage of the compiled node.
41
 * They are exposed for efficient access by closely related trie infrastructure
42
 * and therefore must never be modified by callers. The node itself is still
43
 * immutable from the public API perspective because construction wires these
44
 * arrays once and all lookup operations thereafter treat them as read-only.
45
 *
46
 * @param <V> value type
47
 */
48
public final class CompiledNode<V> {
49
50
    /**
51
     * Default dense child lookup span in characters used when an explicit override
52
     * is not provided.
53
     */
54
    public static final int DEFAULT_MAX_EXPANDED_INDEX = 512;
55
56
    /**
57
     * Number of child edges where linear scan is cheaper than binary search.
58
     */
59
    private static final int LINEAR_CHILD_COUNT_THRESHOLD = 4;
60
61
    /**
62
     * Edge labels in sorted ascending order.
63
     */
64
    private final char[] edgeLabels;
65
66
    /**
67
     * Sparse child array aligned with {@link #edgeLabels}.
68
     */
69
    private final CompiledNode<V>[] children;
70
71
    /**
72
     * Dense child lookup table used when labels fit into a compact char interval.
73
     * <p>
74
     * The table enables direct O(1) indexing for child lookup and is allocated only
75
     * when the character span of this node's edges is within the configured
76
     * threshold.
77
     * </p>
78
     */
79
    private final CompiledNode<V>[] denseChildren;
80
81
    /**
82
     * Normalized minimum edge value for the dense lookup table.
83
     */
84
    private final int denseEdgeMin;
85
86
    /**
87
     * Values stored at this node in local order.
88
     */
89
    private final V[] orderedValues;
90
91
    /**
92
     * Occurrence counts aligned with {@link #orderedValues}.
93
     */
94
    private final int[] orderedCounts;
95
96
    /**
97
     * Whether this node accepts any remaining lookup input.
98
     */
99
    private final boolean acceptsRemainingInput;
100
101
    /**
102
     * Creates one validated compiled node using {@link #DEFAULT_MAX_EXPANDED_INDEX}
103
     * for dense lookup sizing.
104
     *
105
     * @throws NullPointerException     if any array argument is {@code null}
106
     * @throws IllegalArgumentException if the edge-related arrays or value-related
107
     *                                  arrays do not have matching lengths
108
     */
109
    public CompiledNode(final char[] edgeLabels, final CompiledNode<V>[] children, final V[] orderedValues,
110
            final int... orderedCounts) {
111
        this(edgeLabels, children, orderedValues, DEFAULT_MAX_EXPANDED_INDEX, orderedCounts);
112
    }
113
114
    /**
115
     * Creates one validated compiled node.
116
     *
117
     * @param maxExpandedIndex upper bound for the dense lookup interval size; zero
118
     *                         disables dense lookup. Larger values improve
119
     *                         direct-index likelihood while increasing dense table
120
     *                         memory in compact-label nodes.
121
     * @throws NullPointerException     if any array argument is {@code null}
122
     * @throws IllegalArgumentException if the edge-related arrays or value-related
123
     *                                  arrays do not have matching lengths or the
124
     *                                  dense interval size is negative
125
     */
126
    public CompiledNode(final char[] edgeLabels, final CompiledNode<V>[] children, final V[] orderedValues,
127
            final int maxExpandedIndex, final int... orderedCounts) {
128
        this(edgeLabels, children, orderedValues, false, maxExpandedIndex, orderedCounts);
129
    }
130
131
    /**
132
     * Creates one validated compiled node.
133
     *
134
     * @param acceptsRemainingInput whether this node accepts any remaining lookup
135
     *                              input
136
     * @param maxExpandedIndex      upper bound for the dense lookup interval size
137
     * @throws NullPointerException     if any array argument is {@code null}
138
     * @throws IllegalArgumentException if the edge-related arrays or value-related
139
     *                                  arrays do not have matching lengths, the
140
     *                                  dense interval size is negative, or an
141
     *                                  accepting node has children
142
     */
143
    public CompiledNode(final char[] edgeLabels, final CompiledNode<V>[] children, final V[] orderedValues,
144
            final boolean acceptsRemainingInput, final int maxExpandedIndex, final int... orderedCounts) {
145
        Objects.requireNonNull(edgeLabels, "edgeLabels");
146
        Objects.requireNonNull(children, "children");
147
        Objects.requireNonNull(orderedValues, "orderedValues");
148
        Objects.requireNonNull(orderedCounts, "orderedCounts");
149
150 2 1. <init> : negated conditional → KILLED
2. <init> : changed conditional boundary → KILLED
        if (maxExpandedIndex < 0) {
151
            throw new IllegalArgumentException("maxExpandedIndex must be non-negative.");
152
        }
153
154 1 1. <init> : negated conditional → KILLED
        if (edgeLabels.length != children.length) {
155
            throw new IllegalArgumentException("edgeLabels and children must have the same length.");
156
        }
157 1 1. <init> : negated conditional → KILLED
        if (orderedValues.length != orderedCounts.length) {
158
            throw new IllegalArgumentException("orderedValues and orderedCounts must have the same length.");
159
        }
160 2 1. <init> : negated conditional → KILLED
2. <init> : negated conditional → KILLED
        if (acceptsRemainingInput && edgeLabels.length != 0) {
161
            throw new IllegalArgumentException("Accepting nodes cannot have child edges.");
162
        }
163 2 1. <init> : negated conditional → KILLED
2. <init> : negated conditional → KILLED
        if (acceptsRemainingInput && orderedValues.length == 0) {
164
            throw new IllegalArgumentException("Accepting nodes must store at least one value.");
165
        }
166
167
        this.edgeLabels = edgeLabels;
168
        this.children = children;
169
        this.orderedValues = orderedValues;
170
        this.orderedCounts = orderedCounts;
171
        this.acceptsRemainingInput = acceptsRemainingInput;
172
173 2 1. <init> : negated conditional → KILLED
2. <init> : negated conditional → KILLED
        if (edgeLabels.length == 0 || maxExpandedIndex == 0) {
174
            this.denseChildren = null;
175
            this.denseEdgeMin = 0;
176
            return;
177
        }
178
179
        final int minEdge = edgeLabels[0];
180 1 1. <init> : Replaced integer subtraction with addition → KILLED
        final int maxEdge = edgeLabels[edgeLabels.length - 1];
181 1 1. <init> : Replaced integer subtraction with addition → SURVIVED
        final int span = maxEdge - minEdge;
182
183 4 1. <init> : changed conditional boundary → SURVIVED
2. <init> : changed conditional boundary → SURVIVED
3. <init> : negated conditional → KILLED
4. <init> : negated conditional → KILLED
        if (span < 0 || span > maxExpandedIndex) {
184
            this.denseChildren = null;
185
            this.denseEdgeMin = 0;
186
            return;
187
        }
188
189
        @SuppressWarnings("unchecked")
190 1 1. <init> : Replaced integer addition with subtraction → KILLED
        final CompiledNode<V>[] dense = new CompiledNode[span + 1];
191 2 1. <init> : changed conditional boundary → KILLED
2. <init> : negated conditional → KILLED
        for (int edgeIndex = 0; edgeIndex < edgeLabels.length; edgeIndex++) {
192 1 1. <init> : Replaced integer subtraction with addition → KILLED
            dense[edgeLabels[edgeIndex] - minEdge] = children[edgeIndex];
193
        }
194
195
        this.denseChildren = dense;
196
        this.denseEdgeMin = minEdge;
197
    }
198
199
    /**
200
     * Returns the internal edge-label array.
201
     *
202
     * <p>
203
     * The returned array is not copied for performance reasons and must be treated
204
     * as read-only.
205
     *
206
     * @return internal edge-label array
207
     */
208
    @SuppressWarnings("PMD.MethodReturnsInternalArray")
209
    public char[] edgeLabels() {
210 1 1. edgeLabels : replaced return value with null for org/egothor/stemmer/trie/CompiledNode::edgeLabels → KILLED
        return this.edgeLabels;
211
    }
212
213
    /**
214
     * Returns the internal child-node array.
215
     *
216
     * <p>
217
     * The returned array is not copied for performance reasons and must be treated
218
     * as read-only by external callers.
219
     *
220
     * @return internal child-node array
221
     */
222
    @SuppressWarnings("PMD.MethodReturnsInternalArray")
223
    public CompiledNode<V>[] children() {
224 1 1. children : replaced return value with null for org/egothor/stemmer/trie/CompiledNode::children → KILLED
        return this.children;
225
    }
226
227
    /**
228
     * Returns the internal ordered-values array.
229
     *
230
     * <p>
231
     * The returned array is not copied for performance reasons and must be treated
232
     * as read-only.
233
     *
234
     * @return internal ordered-values array
235
     */
236
    @SuppressWarnings("PMD.MethodReturnsInternalArray")
237
    public V[] orderedValues() {
238 1 1. orderedValues : replaced return value with null for org/egothor/stemmer/trie/CompiledNode::orderedValues → KILLED
        return this.orderedValues;
239
    }
240
241
    /**
242
     * Returns the internal ordered-counts array.
243
     *
244
     * <p>
245
     * The returned array is not copied for performance reasons and must be treated
246
     * as read-only.
247
     *
248
     * @return internal ordered-counts array
249
     */
250
    @SuppressWarnings("PMD.MethodReturnsInternalArray")
251
    public int[] orderedCounts() {
252 1 1. orderedCounts : replaced return value with null for org/egothor/stemmer/trie/CompiledNode::orderedCounts → KILLED
        return this.orderedCounts;
253
    }
254
255
    /**
256
     * Returns the number of child edges represented by this node.
257
     *
258
     * @return child edge count
259
     */
260
    public int edgeCount() {
261 1 1. edgeCount : replaced int return with 0 for org/egothor/stemmer/trie/CompiledNode::edgeCount → NO_COVERAGE
        return this.edgeLabels.length;
262
    }
263
264
    /**
265
     * Returns the number of values stored in this node.
266
     *
267
     * @return value count
268
     */
269
    public int valueCount() {
270 1 1. valueCount : replaced int return with 0 for org/egothor/stemmer/trie/CompiledNode::valueCount → KILLED
        return this.orderedValues.length;
271
    }
272
273
    /**
274
     * Indicates whether this node stores any values.
275
     *
276
     * @return {@code true} when values are present at this node
277
     */
278
    public boolean hasValues() {
279 3 1. hasValues : changed conditional boundary → KILLED
2. hasValues : replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::hasValues → KILLED
3. hasValues : negated conditional → KILLED
        return this.orderedValues.length > 0;
280
    }
281
282
    /**
283
     * Indicates whether this node has child edges.
284
     *
285
     * @return {@code true} when this node has at least one outgoing edge
286
     */
287
    public boolean hasChildren() {
288 3 1. hasChildren : replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::hasChildren → KILLED
2. hasChildren : negated conditional → KILLED
3. hasChildren : changed conditional boundary → KILLED
        return this.edgeLabels.length > 0;
289
    }
290
291
    /**
292
     * Indicates whether this node has no child edges.
293
     *
294
     * @return {@code true} when this node is a terminal leaf node
295
     */
296
    public boolean isLeaf() {
297 2 1. isLeaf : replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::isLeaf → KILLED
2. isLeaf : negated conditional → KILLED
        return !hasChildren();
298
    }
299
300
    /**
301
     * Indicates whether this node accepts any remaining lookup input.
302
     *
303
     * @return {@code true} for a contracted accepting leaf
304
     */
305
    public boolean acceptsRemainingInput() {
306 2 1. acceptsRemainingInput : replaced boolean return with false for org/egothor/stemmer/trie/CompiledNode::acceptsRemainingInput → KILLED
2. acceptsRemainingInput : replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::acceptsRemainingInput → KILLED
        return this.acceptsRemainingInput;
307
    }
308
309
    /**
310
     * Tests whether an edge label is present at this node.
311
     *
312
     * @param edge edge label
313
     * @return {@code true} if this node contains the supplied edge label
314
     */
315
    public boolean hasEdge(final char edge) {
316 2 1. hasEdge : negated conditional → KILLED
2. hasEdge : replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::hasEdge → KILLED
        return findChild(edge) != null;
317
    }
318
319
    /**
320
     * Indicates whether this node has a dense direct-index child lookup table.
321
     *
322
     * @return {@code true} when a direct-index child table is available
323
     */
324
    public boolean hasDenseLookup() {
325 2 1. hasDenseLookup : replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::hasDenseLookup → KILLED
2. hasDenseLookup : negated conditional → KILLED
        return this.denseChildren != null;
326
    }
327
328
    /**
329
     * Returns a small memory-related metric describing this node's dense table
330
     * size.
331
     *
332
     * @return number of dense table slots, or {@code 0} when dense lookup is not
333
     *         enabled
334
     */
335
    public int denseTableLength() {
336 2 1. denseTableLength : negated conditional → NO_COVERAGE
2. denseTableLength : replaced int return with 0 for org/egothor/stemmer/trie/CompiledNode::denseTableLength → NO_COVERAGE
        return this.denseChildren == null ? 0 : this.denseChildren.length;
337
    }
338
339
    /**
340
     * Returns a compact structural summary used by diagnostics and tests.
341
     *
342
     * @return summary hash for node structure and contents
343
     */
344
    @Override
345
    public int hashCode() {
346
        int hash = Arrays.hashCode(this.edgeLabels);
347 2 1. hashCode : Replaced integer addition with subtraction → SURVIVED
2. hashCode : Replaced integer multiplication with division → SURVIVED
        hash = 31 * hash + Arrays.hashCode(this.children);
348 2 1. hashCode : Replaced integer addition with subtraction → SURVIVED
2. hashCode : Replaced integer multiplication with division → SURVIVED
        hash = 31 * hash + Arrays.hashCode(this.orderedValues);
349 2 1. hashCode : Replaced integer multiplication with division → SURVIVED
2. hashCode : Replaced integer addition with subtraction → SURVIVED
        hash = 31 * hash + Arrays.hashCode(this.orderedCounts);
350 2 1. hashCode : Replaced integer multiplication with division → SURVIVED
2. hashCode : Replaced integer addition with subtraction → SURVIVED
        hash = 31 * hash + Objects.hash(this.denseEdgeMin);
351 2 1. hashCode : Replaced integer addition with subtraction → SURVIVED
2. hashCode : Replaced integer multiplication with division → SURVIVED
        hash = 31 * hash + Boolean.hashCode(this.acceptsRemainingInput);
352 3 1. hashCode : Replaced integer multiplication with division → SURVIVED
2. hashCode : Replaced integer addition with subtraction → SURVIVED
3. hashCode : negated conditional → SURVIVED
        hash = 31 * hash + (hasDenseLookup() ? Arrays.hashCode(this.denseChildren) : 0);
353 1 1. hashCode : replaced int return with 0 for org/egothor/stemmer/trie/CompiledNode::hashCode → SURVIVED
        return hash;
354
    }
355
356
    /**
357
     * Compares structural node content, including dense table availability.
358
     *
359
     * @param object comparison object
360
     * @return {@code true} when nodes describe identical structure and payload
361
     */
362
    @Override
363
    public boolean equals(final Object object) {
364 1 1. equals : negated conditional → SURVIVED
        if (this == object) {
365 1 1. equals : replaced boolean return with false for org/egothor/stemmer/trie/CompiledNode::equals → NO_COVERAGE
            return true;
366
        }
367 1 1. equals : negated conditional → KILLED
        if (!(object instanceof CompiledNode<?> other)) {
368 1 1. equals : replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::equals → NO_COVERAGE
            return false;
369
        }
370 3 1. equals : replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::equals → SURVIVED
2. equals : negated conditional → KILLED
3. equals : negated conditional → KILLED
        return Arrays.equals(this.edgeLabels, other.edgeLabels) && Arrays.equals(this.children, other.children)
371 1 1. equals : negated conditional → KILLED
                && Arrays.equals(this.orderedValues, other.orderedValues)
372 3 1. equals : negated conditional → KILLED
2. equals : negated conditional → KILLED
3. equals : negated conditional → KILLED
                && Arrays.equals(this.orderedCounts, other.orderedCounts) && this.denseEdgeMin == other.denseEdgeMin
373
                && this.acceptsRemainingInput == other.acceptsRemainingInput
374 1 1. equals : negated conditional → KILLED
                && Arrays.equals(this.denseChildren, other.denseChildren);
375
    }
376
377
    /**
378
     * Returns a short summary useful for debugging and diagnostics.
379
     *
380
     * @return textual node summary
381
     */
382
    @Override
383
    public String toString() {
384 1 1. toString : replaced return value with "" for org/egothor/stemmer/trie/CompiledNode::toString → NO_COVERAGE
        return "CompiledNode{" + "edgeCount=" + this.edgeLabels.length + ", orderedValueCount="
385
                + this.orderedValues.length + ", acceptsRemainingInput=" + this.acceptsRemainingInput
386
                + ", denseTableLength=" + denseTableLength() + '}';
387
    }
388
389
    /**
390
     * Finds a child for the supplied edge character.
391
     * 
392
     * Lookup order is:
393
     * <ol>
394
     * <li>dense array index (if the label interval is compact enough),</li>
395
     * <li>small-child linear scan when the fallback node has
396
     * {@value #LINEAR_CHILD_COUNT_THRESHOLD} or fewer edges,</li>
397
     * <li>binary search over sorted labels.</li>
398
     * </ol>
399
     *
400
     * @param edge edge character
401
     * @return child node, or {@code null} if absent
402
     */
403
    public CompiledNode<V> findChild(final char edge) {
404
        final int childCount = this.edgeLabels.length;
405 1 1. findChild : negated conditional → KILLED
        if (childCount == 0) {
406
            return null;
407
        }
408
409 1 1. findChild : negated conditional → KILLED
        if (this.denseChildren != null) {
410 1 1. findChild : Replaced integer subtraction with addition → KILLED
            final int denseIndex = edge - this.denseEdgeMin;
411 4 1. findChild : negated conditional → KILLED
2. findChild : changed conditional boundary → KILLED
3. findChild : changed conditional boundary → KILLED
4. findChild : negated conditional → KILLED
            if (denseIndex < 0 || denseIndex >= this.denseChildren.length) {
412
                return null;
413
            }
414 1 1. findChild : replaced return value with null for org/egothor/stemmer/trie/CompiledNode::findChild → KILLED
            return this.denseChildren[denseIndex];
415
        }
416
417 2 1. findChild : negated conditional → SURVIVED
2. findChild : changed conditional boundary → SURVIVED
        if (childCount <= LINEAR_CHILD_COUNT_THRESHOLD) {
418 2 1. findChild : negated conditional → KILLED
2. findChild : changed conditional boundary → KILLED
            for (int index = 0; index < childCount; index++) {
419 1 1. findChild : negated conditional → KILLED
                if (this.edgeLabels[index] == edge) {
420 1 1. findChild : replaced return value with null for org/egothor/stemmer/trie/CompiledNode::findChild → KILLED
                    return this.children[index];
421
                }
422
            }
423
            return null;
424
        }
425
426
        final int index = Arrays.binarySearch(this.edgeLabels, edge);
427 2 1. findChild : changed conditional boundary → SURVIVED
2. findChild : negated conditional → KILLED
        if (index < 0) {
428
            return null;
429
        }
430 1 1. findChild : replaced return value with null for org/egothor/stemmer/trie/CompiledNode::findChild → KILLED
        return this.children[index];
431
    }
432
}

Mutations

150

1.1
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeShouldRejectMismatchedValueArrays()]
negated conditional → KILLED

2.2
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesBinarySearchForLargeDegree()]
changed conditional boundary → KILLED

154

1.1
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeShouldRejectMismatchedValueArrays()]
negated conditional → KILLED

157

1.1
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeShouldRejectMismatchedValueArrays()]
negated conditional → KILLED

160

1.1
Location : <init>
Killed by : org.egothor.stemmer.FrequencyTrieTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.FrequencyTrieTest]/[method:shouldContractUniformInternalSubtreeIntoAcceptingLeaf()]
negated conditional → KILLED

2.2
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeAccessorsShouldExposeDocumentedBackingArrays()]
negated conditional → KILLED

163

1.1
Location : <init>
Killed by : org.egothor.stemmer.FrequencyTrieTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.FrequencyTrieTest]/[method:shouldContractUniformInternalSubtreeIntoAcceptingLeaf()]
negated conditional → KILLED

2.2
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
negated conditional → KILLED

173

1.1
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
negated conditional → KILLED

2.2
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
negated conditional → KILLED

180

1.1
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeAccessorsShouldExposeDocumentedBackingArrays()]
Replaced integer subtraction with addition → KILLED

181

1.1
Location : <init>
Killed by : none
Replaced integer subtraction with addition → SURVIVED
Covering tests

183

1.1
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
negated conditional → KILLED

2.2
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
negated conditional → KILLED

3.3
Location : <init>
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

4.4
Location : <init>
Killed by : none
changed conditional boundary → SURVIVED Covering tests

190

1.1
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeAccessorsShouldExposeDocumentedBackingArrays()]
Replaced integer addition with subtraction → KILLED

191

1.1
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeAccessorsShouldExposeDocumentedBackingArrays()]
changed conditional boundary → KILLED

2.2
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
negated conditional → KILLED

192

1.1
Location : <init>
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeAccessorsShouldExposeDocumentedBackingArrays()]
Replaced integer subtraction with addition → KILLED

210

1.1
Location : edgeLabels
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeAccessorsShouldExposeDocumentedBackingArrays()]
replaced return value with null for org/egothor/stemmer/trie/CompiledNode::edgeLabels → KILLED

224

1.1
Location : children
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeAccessorsShouldExposeDocumentedBackingArrays()]
replaced return value with null for org/egothor/stemmer/trie/CompiledNode::children → KILLED

238

1.1
Location : orderedValues
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeAccessorsShouldExposeDocumentedBackingArrays()]
replaced return value with null for org/egothor/stemmer/trie/CompiledNode::orderedValues → KILLED

252

1.1
Location : orderedCounts
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeAccessorsShouldExposeDocumentedBackingArrays()]
replaced return value with null for org/egothor/stemmer/trie/CompiledNode::orderedCounts → KILLED

261

1.1
Location : edgeCount
Killed by : none
replaced int return with 0 for org/egothor/stemmer/trie/CompiledNode::edgeCount → NO_COVERAGE

270

1.1
Location : valueCount
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
replaced int return with 0 for org/egothor/stemmer/trie/CompiledNode::valueCount → KILLED

279

1.1
Location : hasValues
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
changed conditional boundary → KILLED

2.2
Location : hasValues
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::hasValues → KILLED

3.3
Location : hasValues
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
negated conditional → KILLED

288

1.1
Location : hasChildren
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::hasChildren → KILLED

2.2
Location : hasChildren
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
negated conditional → KILLED

3.3
Location : hasChildren
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
changed conditional boundary → KILLED

297

1.1
Location : isLeaf
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::isLeaf → KILLED

2.2
Location : isLeaf
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
negated conditional → KILLED

306

1.1
Location : acceptsRemainingInput
Killed by : org.egothor.stemmer.FrequencyTrieTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.FrequencyTrieTest]/[method:shouldContractUniformInternalSubtreeIntoAcceptingLeaf()]
replaced boolean return with false for org/egothor/stemmer/trie/CompiledNode::acceptsRemainingInput → KILLED

2.2
Location : acceptsRemainingInput
Killed by : org.egothor.stemmer.CompiledTrieArtifactRegressionTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.CompiledTrieArtifactRegressionTest]/[test-template:shouldKeepGoldenArtifactReadableAndHashStable(org.egothor.stemmer.CompiledTrieArtifactRegressionTest$ArtifactCase)]/[test-template-invocation:#3]
replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::acceptsRemainingInput → KILLED

316

1.1
Location : hasEdge
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
negated conditional → KILLED

2.2
Location : hasEdge
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::hasEdge → KILLED

325

1.1
Location : hasDenseLookup
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesBinarySearchForLargeDegree()]
replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::hasDenseLookup → KILLED

2.2
Location : hasDenseLookup
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesBinarySearchForLargeDegree()]
negated conditional → KILLED

336

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

2.2
Location : denseTableLength
Killed by : none
replaced int return with 0 for org/egothor/stemmer/trie/CompiledNode::denseTableLength → NO_COVERAGE

347

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

2.2
Location : hashCode
Killed by : none
Replaced integer multiplication with division → SURVIVED Covering tests

348

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

2.2
Location : hashCode
Killed by : none
Replaced integer multiplication with division → SURVIVED Covering tests

349

1.1
Location : hashCode
Killed by : none
Replaced integer multiplication with division → SURVIVED
Covering tests

2.2
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → SURVIVED Covering tests

350

1.1
Location : hashCode
Killed by : none
Replaced integer multiplication with division → SURVIVED
Covering tests

2.2
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → SURVIVED Covering tests

351

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

2.2
Location : hashCode
Killed by : none
Replaced integer multiplication with division → SURVIVED Covering tests

352

1.1
Location : hashCode
Killed by : none
Replaced integer multiplication with division → SURVIVED
Covering tests

2.2
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → SURVIVED Covering tests

3.3
Location : hashCode
Killed by : none
negated conditional → SURVIVED Covering tests

353

1.1
Location : hashCode
Killed by : none
replaced int return with 0 for org/egothor/stemmer/trie/CompiledNode::hashCode → SURVIVED
Covering tests

364

1.1
Location : equals
Killed by : none
negated conditional → SURVIVED
Covering tests

365

1.1
Location : equals
Killed by : none
replaced boolean return with false for org/egothor/stemmer/trie/CompiledNode::equals → NO_COVERAGE

367

1.1
Location : equals
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeEqualsAndHashCodeAlignForIdenticalStructure()]
negated conditional → KILLED

368

1.1
Location : equals
Killed by : none
replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::equals → NO_COVERAGE

370

1.1
Location : equals
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeEqualsAndHashCodeAlignForIdenticalStructure()]
negated conditional → KILLED

2.2
Location : equals
Killed by : none
replaced boolean return with true for org/egothor/stemmer/trie/CompiledNode::equals → SURVIVED
Covering tests

3.3
Location : equals
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeEqualsAndHashCodeAlignForIdenticalStructure()]
negated conditional → KILLED

371

1.1
Location : equals
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeEqualsAndHashCodeAlignForIdenticalStructure()]
negated conditional → KILLED

372

1.1
Location : equals
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeEqualsAndHashCodeAlignForIdenticalStructure()]
negated conditional → KILLED

2.2
Location : equals
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeEqualsAndHashCodeAlignForIdenticalStructure()]
negated conditional → KILLED

3.3
Location : equals
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeEqualsAndHashCodeAlignForIdenticalStructure()]
negated conditional → KILLED

374

1.1
Location : equals
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeEqualsAndHashCodeAlignForIdenticalStructure()]
negated conditional → KILLED

384

1.1
Location : toString
Killed by : none
replaced return value with "" for org/egothor/stemmer/trie/CompiledNode::toString → NO_COVERAGE

405

1.1
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
negated conditional → KILLED

409

1.1
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesBinarySearchForLargeDegree()]
negated conditional → KILLED

410

1.1
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
Replaced integer subtraction with addition → KILLED

411

1.1
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
negated conditional → KILLED

2.2
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
changed conditional boundary → KILLED

3.3
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeReportsNodeStateHelpers()]
changed conditional boundary → KILLED

4.4
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
negated conditional → KILLED

414

1.1
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesDenseLookupForCompactIntervals()]
replaced return value with null for org/egothor/stemmer/trie/CompiledNode::findChild → KILLED

417

1.1
Location : findChild
Killed by : none
negated conditional → SURVIVED
Covering tests

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

418

1.1
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesLinearScanForSmallDegree()]
negated conditional → KILLED

2.2
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesLinearScanForSmallDegree()]
changed conditional boundary → KILLED

419

1.1
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesLinearScanForSmallDegree()]
negated conditional → KILLED

420

1.1
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesLinearScanForSmallDegree()]
replaced return value with null for org/egothor/stemmer/trie/CompiledNode::findChild → KILLED

427

1.1
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesBinarySearchForLargeDegree()]
negated conditional → KILLED

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

430

1.1
Location : findChild
Killed by : org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.trie.CompiledNodeAndNodeDataTest]/[method:compiledNodeUsesBinarySearchForLargeDegree()]
replaced return value with null for org/egothor/stemmer/trie/CompiledNode::findChild → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1