PatchCommandEncoder.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;
32
33
import java.util.Objects;
34
import java.util.concurrent.locks.ReentrantLock;
35
36
/**
37
 * Encodes a compact patch command that transforms one word form into another
38
 * and applies such commands back to source words.
39
 *
40
 * <p>
41
 * The historical Egothor patch language is defined for backward traversal, that
42
 * is, from the logical end of a word toward its beginning. This implementation
43
 * preserves that proven opcode semantics as the single internal representation.
44
 * Forward traversal is implemented by translating source and target words to
45
 * the equivalent reversed logical form at the API boundary and then delegating
46
 * to the same backward encoder and decoder.
47
 * </p>
48
 *
49
 * <p>
50
 * This design keeps the patch language stable, avoids maintaining two distinct
51
 * opcode interpreters, and guarantees that forward traversal is semantically
52
 * equivalent to running the historical algorithm on the reversed logical word
53
 * form.
54
 * </p>
55
 *
56
 * <p>
57
 * The encoder computes a minimum-cost edit script using weighted insert,
58
 * delete, replace, and match transitions. The resulting trace is then
59
 * serialized into the compact patch language.
60
 * </p>
61
 *
62
 * <p>
63
 * This class is stateful and reuses internal dynamic-programming matrices
64
 * across invocations to reduce allocation pressure during repeated use.
65
 * Instances are therefore not suitable for unsynchronized concurrent access.
66
 * The {@link #encode(String, String)} method is synchronized so that a shared
67
 * instance can still be used safely when needed.
68
 * </p>
69
 */
70
@SuppressWarnings("PMD.CyclomaticComplexity")
71
public final class PatchCommandEncoder {
72
73
    /**
74
     * Backward direction apply strategy with no runtime direction branching.
75
     */
76
    private static final ApplyStrategy BACKWARD_APPLY_STRATEGY = PatchCommandEncoder::applyBackward;
77
78
    /**
79
     * Forward direction apply strategy with no runtime direction branching.
80
     */
81
    private static final ApplyStrategy FORWARD_APPLY_STRATEGY = PatchCommandEncoder::applyForward;
82
83
    /**
84
     * Serialized opcode for deleting one or more characters.
85
     */
86
    private static final char DELETE_OPCODE = 'D';
87
88
    /**
89
     * Serialized opcode for inserting one character.
90
     */
91
    private static final char INSERT_OPCODE = 'I';
92
93
    /**
94
     * Serialized opcode for replacing one character.
95
     */
96
    private static final char REPLACE_OPCODE = 'R';
97
98
    /**
99
     * Serialized opcode for skipping one or more unchanged characters.
100
     */
101
    private static final char SKIP_OPCODE = '-';
102
103
    /**
104
     * Sentinel placed immediately before {@code 'a'} and used to accumulate compact
105
     * counts in the patch format.
106
     */
107
    private static final char COUNT_SENTINEL = (char) ('a' - 1);
108
109
    /**
110
     * Serialized opcode for a canonical no-operation patch.
111
     */
112
    private static final char NOOP_OPCODE = 'N';
113
114
    /**
115
     * Canonical argument used by the serialized no-operation patch.
116
     */
117
    private static final char NOOP_ARGUMENT = 'a';
118
119
    /**
120
     * Canonical serialized no-operation patch.
121
     */
122
    /* default */ static final String NOOP_PATCH = String.valueOf(new char[] { NOOP_OPCODE, NOOP_ARGUMENT });
123
124
    /**
125
     * Safety penalty used to prevent a mismatch from being selected as a match.
126
     */
127
    private static final int MISMATCH_PENALTY = 100;
128
129
    /**
130
     * Extra matrix headroom reserved beyond the immediately required dimensions.
131
     */
132
    private static final int CAPACITY_MARGIN = 8;
133
134
    /**
135
     * Cost of inserting one character.
136
     */
137
    private final int insertCost;
138
139
    /**
140
     * Cost of deleting one character.
141
     */
142
    private final int deleteCost;
143
144
    /**
145
     * Cost of replacing one character.
146
     */
147
    private final int replaceCost;
148
149
    /**
150
     * Cost of keeping one matching character unchanged.
151
     */
152
    private final int matchCost;
153
154
    /**
155
     * Direction in which words are traversed during both patch serialization and
156
     * patch application.
157
     */
158
    private final WordTraversalDirection traversalDirection;
159
160
    /**
161
     * Direction-specialized patch apply strategy.
162
     */
163
    private final ApplyStrategy applyStrategy;
164
165
    /**
166
     * Currently allocated source dimension of reusable matrices.
167
     */
168
    private int sourceCapacity;
169
170
    /**
171
     * Currently allocated target dimension of reusable matrices.
172
     */
173
    private int targetCapacity;
174
175
    /**
176
     * Dynamic-programming matrix containing cumulative minimum costs.
177
     */
178
    private int[][] costMatrix;
179
180
    /**
181
     * Matrix storing the chosen transition for each dynamic-programming cell.
182
     */
183
    private Trace[][] traceMatrix;
184
185
    /**
186
     * Reentrant lock for {@link #encode(String, String)} exclusive operation.
187
     */
188
    private final ReentrantLock lock = new ReentrantLock();
189
190
    /**
191
     * Internal dynamic-programming transition selected for one matrix cell.
192
     */
193
    private enum Trace {
194
195
        /** Deletes one character from the source sequence. */
196
        DELETE,
197
198
        /** Inserts one character from the target sequence. */
199
        INSERT,
200
201
        /** Replaces one source character with one target character. */
202
        REPLACE,
203
204
        /** Keeps one matching character unchanged. */
205
        MATCH
206
    }
207
208
    /**
209
     * Direction-specialized patch application strategy.
210
     */
211
    @FunctionalInterface
212
    private interface ApplyStrategy {
213
        /**
214
         * Applies the command.
215
         * 
216
         * @param source       original text
217
         * @param patchCommand patch command
218
         * @return final text after applying the command
219
         */
220
        String apply(String source, String patchCommand);
221
    }
222
223
    private PatchCommandEncoder(final Builder builder) {
224
        this.traversalDirection = Objects.requireNonNull(builder.traversalDirection, "traversalDirection");
225
        final int insertCost = builder.insertCost;
226 2 1. <init> : changed conditional boundary → SURVIVED
2. <init> : negated conditional → KILLED
        if (insertCost < 0) {
227
            throw new IllegalArgumentException("insertCost must be non-negative.");
228
        }
229
        final int deleteCost = builder.deleteCost;
230 2 1. <init> : changed conditional boundary → SURVIVED
2. <init> : negated conditional → KILLED
        if (deleteCost < 0) {
231
            throw new IllegalArgumentException("deleteCost must be non-negative.");
232
        }
233
        final int replaceCost = builder.replaceCost;
234 2 1. <init> : changed conditional boundary → SURVIVED
2. <init> : negated conditional → KILLED
        if (replaceCost < 0) {
235
            throw new IllegalArgumentException("replaceCost must be non-negative.");
236
        }
237
        final int matchCost = builder.matchCost;
238 2 1. <init> : changed conditional boundary → KILLED
2. <init> : negated conditional → KILLED
        if (matchCost < 0) {
239
            throw new IllegalArgumentException("matchCost must be non-negative.");
240
        }
241
242
        this.insertCost = insertCost;
243
        this.deleteCost = deleteCost;
244
        this.replaceCost = replaceCost;
245
        this.matchCost = matchCost;
246
        this.applyStrategy = applyStrategyFor(this.traversalDirection);
247
        this.sourceCapacity = 0;
248
        this.targetCapacity = 0;
249
        this.costMatrix = new int[0][0];
250
        this.traceMatrix = new Trace[0][0];
251
    }
252
253
    /**
254
     * Creates a fluent builder for constructing a direction-specialized encoder.
255
     *
256
     * @return new builder instance
257
     */
258
    public static Builder builder() {
259 1 1. builder : replaced return value with null for org/egothor/stemmer/PatchCommandEncoder::builder → KILLED
        return new Builder();
260
    }
261
262
    /**
263
     * Produces a compact patch command that transforms {@code source} into
264
     * {@code target}.
265
     *
266
     * @param source source word form
267
     * @param target target word form
268
     * @return compact patch command, or {@code null} when any argument is
269
     *         {@code null}
270
     */
271
    public String encode(final String source, final String target) {
272 2 1. encode : negated conditional → KILLED
2. encode : negated conditional → KILLED
        if (source == null || target == null) {
273 1 1. encode : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encode → KILLED
            return null;
274
        }
275 1 1. encode : negated conditional → KILLED
        if (source.equals(target)) {
276 1 1. encode : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encode → KILLED
            return NOOP_PATCH;
277
        }
278
279 1 1. encode : negated conditional → KILLED
        if (this.traversalDirection == WordTraversalDirection.BACKWARD) {
280 1 1. encode : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encode → KILLED
            return encodeBackward(source, target);
281
        }
282 1 1. encode : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encode → KILLED
        return encodeForward(source, target);
283
    }
284
285
    /**
286
     * Applies a compact patch command using this encoder instance traversal
287
     * direction.
288
     *
289
     * <p>
290
     * This is the branch-free instance-level fast path for repeated patch
291
     * application in a known traversal direction.
292
     * </p>
293
     *
294
     * @param source       original source word
295
     * @param patchCommand compact patch command
296
     * @return transformed word, or {@code null} when {@code source} is {@code null}
297
     */
298
    public String applyWithConfiguredDirection(final String source, final String patchCommand) {
299 1 1. applyWithConfiguredDirection : negated conditional → KILLED
        if (source == null) {
300 1 1. applyWithConfiguredDirection : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::applyWithConfiguredDirection → NO_COVERAGE
            return null;
301
        }
302 1 1. applyWithConfiguredDirection : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::applyWithConfiguredDirection → KILLED
        return this.applyStrategy.apply(source, patchCommand);
303
    }
304
305
    /**
306
     * Applies a compact patch command to the supplied source word using the
307
     * historical backward traversal direction.
308
     *
309
     * @param source       original source word
310
     * @param patchCommand compact patch command
311
     * @return transformed word, or {@code null} when {@code source} is {@code null}
312
     */
313
    public static String apply(final String source, final String patchCommand) {
314 1 1. apply : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::apply → KILLED
        return apply(source, patchCommand, WordTraversalDirection.BACKWARD);
315
    }
316
317
    /**
318
     * Applies a compact patch command to the supplied source word using the
319
     * specified traversal direction.
320
     *
321
     * <p>
322
     * The implementation uses dedicated direction-specific patch decoders.
323
     * </p>
324
     *
325
     * @param source             original source word
326
     * @param patchCommand       compact patch command
327
     * @param traversalDirection traversal direction used by the patch command
328
     * @return transformed word, or {@code null} when {@code source} is {@code null}
329
     */
330
    public static String apply(final String source, final String patchCommand,
331
            final WordTraversalDirection traversalDirection) {
332
        Objects.requireNonNull(traversalDirection, "traversalDirection");
333 1 1. apply : negated conditional → KILLED
        if (source == null) {
334 1 1. apply : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::apply → KILLED
            return null;
335
        }
336 1 1. apply : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::apply → KILLED
        return applyStrategyFor(traversalDirection).apply(source, patchCommand);
337
    }
338
339
    /**
340
     * Encodes a patch command using the historical backward Egothor semantics.
341
     *
342
     * @param source source word form in legacy backward logical space
343
     * @param target target word form in legacy backward logical space
344
     * @return compact patch command
345
     */
346
    private String encodeBackward(final String source, final String target) {
347
        final int sourceLength = source.length();
348
        final int targetLength = target.length();
349
350 1 1. encodeBackward : removed call to java/util/concurrent/locks/ReentrantLock::lock → KILLED
        lock.lock();
351
        try {
352 3 1. encodeBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::ensureCapacity → KILLED
2. encodeBackward : Replaced integer addition with subtraction → KILLED
3. encodeBackward : Replaced integer addition with subtraction → KILLED
            ensureCapacity(sourceLength + 1, targetLength + 1);
353 1 1. encodeBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::initializeBoundaryConditionsBackward → KILLED
            initializeBoundaryConditionsBackward(sourceLength, targetLength);
354
355
            final char[] sourceCharacters = source.toCharArray();
356
            final char[] targetCharacters = target.toCharArray();
357
358 1 1. encodeBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::fillMatrices → KILLED
            fillMatrices(sourceCharacters, targetCharacters, sourceLength, targetLength,
359
                    WordTraversalDirection.BACKWARD);
360
361 1 1. encodeBackward : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encodeBackward → KILLED
            return buildPatchCommandBackward(targetCharacters, sourceLength, targetLength);
362
        } finally {
363 1 1. encodeBackward : removed call to java/util/concurrent/locks/ReentrantLock::unlock → SURVIVED
            lock.unlock();
364
        }
365
    }
366
367
    /**
368
     * Encodes a patch command using forward traversal semantics.
369
     *
370
     * @param source source word form
371
     * @param target target word form
372
     * @return compact patch command
373
     */
374
    private String encodeForward(final String source, final String target) {
375
        final int sourceLength = source.length();
376
        final int targetLength = target.length();
377
378 1 1. encodeForward : removed call to java/util/concurrent/locks/ReentrantLock::lock → KILLED
        lock.lock();
379
        try {
380 3 1. encodeForward : Replaced integer addition with subtraction → SURVIVED
2. encodeForward : Replaced integer addition with subtraction → SURVIVED
3. encodeForward : removed call to org/egothor/stemmer/PatchCommandEncoder::ensureCapacity → KILLED
            ensureCapacity(sourceLength + 1, targetLength + 1);
381 1 1. encodeForward : removed call to org/egothor/stemmer/PatchCommandEncoder::initializeBoundaryConditionsForward → KILLED
            initializeBoundaryConditionsForward(sourceLength, targetLength);
382
383
            final char[] sourceCharacters = source.toCharArray();
384
            final char[] targetCharacters = target.toCharArray();
385
386 1 1. encodeForward : removed call to org/egothor/stemmer/PatchCommandEncoder::fillMatrices → KILLED
            fillMatrices(sourceCharacters, targetCharacters, sourceLength, targetLength,
387
                    WordTraversalDirection.FORWARD);
388
389 1 1. encodeForward : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encodeForward → KILLED
            return buildPatchCommandForward(targetCharacters, sourceLength, targetLength);
390
        } finally {
391 1 1. encodeForward : removed call to java/util/concurrent/locks/ReentrantLock::unlock → SURVIVED
            lock.unlock();
392
        }
393
    }
394
395
    /**
396
     * Applies a patch command using the historical backward Egothor semantics.
397
     *
398
     * @param source       original source word in legacy backward logical space
399
     * @param patchCommand compact patch command
400
     * @return transformed word, or {@code null} when {@code source} is {@code null}
401
     */
402
    @SuppressWarnings({ "PMD.CyclomaticComplexity", "PMD.AvoidLiteralsInIfCondition" })
403
    private static String applyBackward(final String source, final String patchCommand) {
404
        if (source == null) {
405
            return null;
406
        }
407
        if (patchCommand == null || patchCommand.isEmpty()) {
408
            return source;
409
        }
410
        if (NOOP_PATCH.equals(patchCommand)) {
411
            return source;
412
        }
413
        if ((patchCommand.length() & 1) != 0) {
414
            return source;
415
        }
416
417
        final StringBuilder result = new StringBuilder(source);
418
        if (result.isEmpty()) {
419
            return applyBackwardToEmptySource(result, patchCommand);
420
        }
421
422
        int position = result.length() - 1;
423
424
        try {
425
            for (int patchIndex = 0, patchLength = patchCommand.length(); patchIndex < patchLength; patchIndex += 2) { // NOPMD
426
                final char opcode = patchCommand.charAt(patchIndex);
427
                final char argument = patchCommand.charAt(patchIndex + 1);
428
429
                switch (opcode) {
430
                    case SKIP_OPCODE:
431
                        final int skipCount = decodeEncodedCount(argument);
432
                        if (skipCount < 1) {
433
                            return source;
434
                        }
435
                        position = position - skipCount + 1;
436
                        break;
437
438
                    case REPLACE_OPCODE:
439
                        result.setCharAt(position, argument);
440
                        break;
441
442
                    case DELETE_OPCODE:
443
                        final int deleteCount = decodeEncodedCount(argument);
444
                        if (deleteCount < 1) {
445
                            return source;
446
                        }
447
                        final int deleteEndExclusive = position + 1;
448
                        position -= deleteCount - 1;
449
                        result.delete(position, deleteEndExclusive);
450
                        break;
451
452
                    case INSERT_OPCODE:
453
                        result.insert(position + 1, argument);
454
                        position++;
455
                        break;
456
457
                    case NOOP_OPCODE:
458
                        if (argument != NOOP_ARGUMENT) {
459
                            throw new IllegalArgumentException("Unsupported NOOP patch argument: " + argument);
460
                        }
461
                        return source;
462
463
                    default:
464
                        throw new IllegalArgumentException("Unsupported patch opcode: " + opcode);
465
                }
466
467
                position--;
468
            }
469
        } catch (IndexOutOfBoundsException exception) {
470
            return source;
471
        }
472
473
        return result.toString();
474
    }
475
476
    /**
477
     * Applies a patch command using forward traversal semantics.
478
     *
479
     * @param source       original source word
480
     * @param patchCommand compact patch command
481
     * @return transformed word, or {@code null} when {@code source} is {@code null}
482
     */
483
    @SuppressWarnings({ "PMD.CyclomaticComplexity", "PMD.AvoidLiteralsInIfCondition" })
484
    private static String applyForward(final String source, final String patchCommand) {
485
        if (source == null) {
486
            return null;
487
        }
488
        if (patchCommand == null || patchCommand.isEmpty()) {
489
            return source;
490
        }
491
        if (NOOP_PATCH.equals(patchCommand)) {
492
            return source;
493
        }
494
        if ((patchCommand.length() & 1) != 0) {
495
            return source;
496
        }
497
498
        final StringBuilder result = new StringBuilder(source);
499
        if (result.isEmpty()) {
500
            return applyForwardToEmptySource(result, patchCommand);
501
        }
502
503
        int position = 0;
504
505
        try {
506
            for (int patchIndex = 0, patchLength = patchCommand.length(); patchIndex < patchLength; patchIndex += 2) { // NOPMD
507
                final char opcode = patchCommand.charAt(patchIndex);
508
                final char argument = patchCommand.charAt(patchIndex + 1);
509
510
                switch (opcode) {
511
                    case SKIP_OPCODE:
512
                        final int skipCount = decodeEncodedCount(argument);
513
                        if (skipCount < 1) {
514
                            return source;
515
                        }
516
                        position = position + skipCount - 1;
517
                        break;
518
519
                    case REPLACE_OPCODE:
520
                        result.setCharAt(position, argument);
521
                        break;
522
523
                    case DELETE_OPCODE:
524
                        final int deleteCount = decodeEncodedCount(argument);
525
                        if (deleteCount < 1) {
526
                            return source;
527
                        }
528
                        result.delete(position, position + deleteCount);
529
                        position--;
530
                        break;
531
532
                    case INSERT_OPCODE:
533
                        result.insert(position, argument);
534
                        break;
535
536
                    case NOOP_OPCODE:
537
                        if (argument != NOOP_ARGUMENT) {
538
                            throw new IllegalArgumentException("Unsupported NOOP patch argument: " + argument);
539
                        }
540
                        return source;
541
542
                    default:
543
                        throw new IllegalArgumentException("Unsupported patch opcode: " + opcode);
544
                }
545
546
                position++;
547
            }
548
        } catch (IndexOutOfBoundsException exception) {
549
            return source;
550
        }
551
552
        return result.toString();
553
    }
554
555
    /**
556
     * Applies a backward patch command to an empty source word.
557
     *
558
     * <p>
559
     * Only insertion instructions are meaningful for an empty source. Skip,
560
     * replace, and delete instructions are treated as malformed and therefore cause
561
     * the original source to be preserved, consistent with the historical fallback
562
     * behavior for index-invalid commands.
563
     * </p>
564
     *
565
     * @param result       empty result builder
566
     * @param patchCommand compact patch command
567
     * @return transformed word, or the original empty word when the patch is
568
     *         malformed
569
     */
570
    private static String applyBackwardToEmptySource(final StringBuilder result, final String patchCommand) {
571
        try {
572
            for (int patchIndex = 0, patchLength = patchCommand.length(); patchIndex < patchLength; patchIndex += 2) { // NOPMD
573
                final char opcode = patchCommand.charAt(patchIndex);
574
                final char argument = patchCommand.charAt(patchIndex + 1);
575
576
                switch (opcode) {
577
                    case INSERT_OPCODE:
578
                        result.insert(0, argument);
579
                        break;
580
581
                    case SKIP_OPCODE:
582
                    case REPLACE_OPCODE:
583
                    case DELETE_OPCODE:
584
                        return "";
585
586
                    case NOOP_OPCODE:
587
                        if (argument != NOOP_ARGUMENT) {
588
                            throw new IllegalArgumentException("Unsupported NOOP patch argument: " + argument);
589
                        }
590
                        return "";
591
592
                    default:
593
                        throw new IllegalArgumentException("Unsupported patch opcode: " + opcode);
594
                }
595
            }
596
        } catch (IndexOutOfBoundsException exception) {
597
            return "";
598
        }
599
600
        return result.toString();
601
    }
602
603
    /**
604
     * Applies a forward patch command to an empty source word.
605
     *
606
     * @param result       empty result builder
607
     * @param patchCommand compact patch command
608
     * @return transformed word, or the original empty word when the patch is
609
     *         malformed
610
     */
611
    private static String applyForwardToEmptySource(final StringBuilder result, final String patchCommand) {
612
        try {
613
            for (int patchIndex = 0, patchLength = patchCommand.length(); patchIndex < patchLength; patchIndex += 2) { // NOPMD
614
                final char opcode = patchCommand.charAt(patchIndex);
615
                final char argument = patchCommand.charAt(patchIndex + 1);
616
617
                switch (opcode) {
618
                    case INSERT_OPCODE:
619
                        result.append(argument);
620
                        break;
621
622
                    case SKIP_OPCODE:
623
                    case REPLACE_OPCODE:
624
                    case DELETE_OPCODE:
625
                        return "";
626
627
                    case NOOP_OPCODE:
628
                        if (argument != NOOP_ARGUMENT) {
629
                            throw new IllegalArgumentException("Unsupported NOOP patch argument: " + argument);
630
                        }
631
                        return "";
632
633
                    default:
634
                        throw new IllegalArgumentException("Unsupported patch opcode: " + opcode);
635
                }
636
            }
637
        } catch (IndexOutOfBoundsException exception) {
638
            return "";
639
        }
640
641
        return result.toString();
642
    }
643
644
    /**
645
     * Returns the direction-specialized apply strategy.
646
     *
647
     * @param traversalDirection requested traversal direction
648
     * @return branch-free apply strategy for that direction
649
     */
650
    private static ApplyStrategy applyStrategyFor(final WordTraversalDirection traversalDirection) {
651 2 1. applyStrategyFor : replaced return value with null for org/egothor/stemmer/PatchCommandEncoder::applyStrategyFor → KILLED
2. applyStrategyFor : negated conditional → KILLED
        return traversalDirection == WordTraversalDirection.BACKWARD ? BACKWARD_APPLY_STRATEGY : FORWARD_APPLY_STRATEGY;
652
    }
653
654
    /**
655
     * Decodes a compact count argument used by skip and delete instructions.
656
     *
657
     * @param argument serialized count argument
658
     * @return decoded positive count, or {@code -1} when the argument is malformed
659
     */
660
    @SuppressWarnings("PMD.AvoidLiteralsInIfCondition")
661
    private static int decodeEncodedCount(final char argument) {
662
        if (argument < 'a') {
663
            return -1;
664
        }
665
        return argument - 'a' + 1;
666
    }
667
668
    /**
669
     * Ensures that internal matrices are large enough for the requested input
670
     * dimensions.
671
     *
672
     * @param requiredSourceCapacity required source dimension
673
     * @param requiredTargetCapacity required target dimension
674
     */
675
    private void ensureCapacity(final int requiredSourceCapacity, final int requiredTargetCapacity) {
676 4 1. ensureCapacity : changed conditional boundary → SURVIVED
2. ensureCapacity : negated conditional → SURVIVED
3. ensureCapacity : changed conditional boundary → SURVIVED
4. ensureCapacity : negated conditional → SURVIVED
        if (requiredSourceCapacity <= this.sourceCapacity && requiredTargetCapacity <= this.targetCapacity) {
677
            return;
678
        }
679
680 1 1. ensureCapacity : Replaced integer addition with subtraction → KILLED
        this.sourceCapacity = Math.max(this.sourceCapacity, requiredSourceCapacity) + CAPACITY_MARGIN;
681 1 1. ensureCapacity : Replaced integer addition with subtraction → KILLED
        this.targetCapacity = Math.max(this.targetCapacity, requiredTargetCapacity) + CAPACITY_MARGIN;
682
683
        this.costMatrix = new int[this.sourceCapacity][this.targetCapacity];
684
        this.traceMatrix = new Trace[this.sourceCapacity][this.targetCapacity];
685
    }
686
687
    /**
688
     * Initializes the first row and first column of the dynamic-programming
689
     * matrices.
690
     *
691
     * @param sourceLength length of the source word
692
     * @param targetLength length of the target word
693
     */
694
    private void initializeBoundaryConditionsBackward(final int sourceLength, final int targetLength) {
695
        this.costMatrix[0][0] = 0;
696
        this.traceMatrix[0][0] = Trace.MATCH;
697
698 2 1. initializeBoundaryConditionsBackward : negated conditional → KILLED
2. initializeBoundaryConditionsBackward : changed conditional boundary → KILLED
        for (int sourceIndex = 1; sourceIndex <= sourceLength; sourceIndex++) {
699 1 1. initializeBoundaryConditionsBackward : Replaced integer multiplication with division → SURVIVED
            this.costMatrix[sourceIndex][0] = sourceIndex * this.deleteCost;
700
            this.traceMatrix[sourceIndex][0] = Trace.DELETE;
701
        }
702
703 2 1. initializeBoundaryConditionsBackward : changed conditional boundary → KILLED
2. initializeBoundaryConditionsBackward : negated conditional → KILLED
        for (int targetIndex = 1; targetIndex <= targetLength; targetIndex++) {
704 1 1. initializeBoundaryConditionsBackward : Replaced integer multiplication with division → SURVIVED
            this.costMatrix[0][targetIndex] = targetIndex * this.insertCost;
705
            this.traceMatrix[0][targetIndex] = Trace.INSERT;
706
        }
707
    }
708
709
    /**
710
     * Initializes boundary conditions for forward dynamic-programming traversal.
711
     *
712
     * @param sourceLength length of the source word
713
     * @param targetLength length of the target word
714
     */
715
    private void initializeBoundaryConditionsForward(final int sourceLength, final int targetLength) {
716
        this.costMatrix[sourceLength][targetLength] = 0;
717
        this.traceMatrix[sourceLength][targetLength] = Trace.MATCH;
718
719 3 1. initializeBoundaryConditionsForward : Replaced integer subtraction with addition → SURVIVED
2. initializeBoundaryConditionsForward : changed conditional boundary → KILLED
3. initializeBoundaryConditionsForward : negated conditional → KILLED
        for (int sourceIndex = sourceLength - 1; sourceIndex >= 0; sourceIndex--) {
720 2 1. initializeBoundaryConditionsForward : Replaced integer addition with subtraction → SURVIVED
2. initializeBoundaryConditionsForward : Replaced integer addition with subtraction → KILLED
            this.costMatrix[sourceIndex][targetLength] = this.costMatrix[sourceIndex + 1][targetLength]
721
                    + this.deleteCost;
722
            this.traceMatrix[sourceIndex][targetLength] = Trace.DELETE;
723
        }
724
725 3 1. initializeBoundaryConditionsForward : changed conditional boundary → SURVIVED
2. initializeBoundaryConditionsForward : Replaced integer subtraction with addition → SURVIVED
3. initializeBoundaryConditionsForward : negated conditional → KILLED
        for (int targetIndex = targetLength - 1; targetIndex >= 0; targetIndex--) {
726 2 1. initializeBoundaryConditionsForward : Replaced integer addition with subtraction → SURVIVED
2. initializeBoundaryConditionsForward : Replaced integer addition with subtraction → KILLED
            this.costMatrix[sourceLength][targetIndex] = this.costMatrix[sourceLength][targetIndex + 1]
727
                    + this.insertCost;
728
            this.traceMatrix[sourceLength][targetIndex] = Trace.INSERT;
729
        }
730
    }
731
732
    /**
733
     * Fills dynamic-programming matrices for the supplied source and target
734
     * character sequences.
735
     *
736
     * @param sourceCharacters source characters
737
     * @param targetCharacters target characters
738
     * @param sourceLength     source length
739
     * @param targetLength     target length
740
     * @param direction        traversal direction used to compare characters
741
     */
742
    private void fillMatrices(final char[] sourceCharacters, final char[] targetCharacters, final int sourceLength,
743
            final int targetLength, final WordTraversalDirection direction) {
744
        final int sourceStart;
745
        final int sourceEndExclusive;
746
        final int sourceStep;
747
        final int targetStart;
748
        final int targetEndExclusive;
749
        final int targetStep;
750
        final int sourceCharacterOffset;
751
        final int targetCharacterOffset;
752
        final int sourceNeighborDelta;
753
        final int targetNeighborDelta;
754
755 1 1. fillMatrices : negated conditional → KILLED
        if (direction == WordTraversalDirection.BACKWARD) {
756
            sourceStart = 1;
757 1 1. fillMatrices : Replaced integer addition with subtraction → KILLED
            sourceEndExclusive = sourceLength + 1;
758
            sourceStep = 1;
759
            targetStart = 1;
760 1 1. fillMatrices : Replaced integer addition with subtraction → KILLED
            targetEndExclusive = targetLength + 1;
761
            targetStep = 1;
762
            sourceCharacterOffset = -1;
763
            targetCharacterOffset = -1;
764
            sourceNeighborDelta = -1;
765
            targetNeighborDelta = -1;
766
        } else {
767 1 1. fillMatrices : Replaced integer subtraction with addition → KILLED
            sourceStart = sourceLength - 1;
768
            sourceEndExclusive = -1;
769
            sourceStep = -1;
770 1 1. fillMatrices : Replaced integer subtraction with addition → KILLED
            targetStart = targetLength - 1;
771
            targetEndExclusive = -1;
772
            targetStep = -1;
773
            sourceCharacterOffset = 0;
774
            targetCharacterOffset = 0;
775
            sourceNeighborDelta = 1;
776
            targetNeighborDelta = 1;
777
        }
778
779 2 1. fillMatrices : negated conditional → KILLED
2. fillMatrices : Replaced integer addition with subtraction → KILLED
        for (int sourceIndex = sourceStart; sourceIndex != sourceEndExclusive; sourceIndex += sourceStep) {
780 1 1. fillMatrices : Replaced integer addition with subtraction → KILLED
            final char sourceCharacter = sourceCharacters[sourceIndex + sourceCharacterOffset];
781 1 1. fillMatrices : Replaced integer addition with subtraction → KILLED
            final int sourceNeighbor = sourceIndex + sourceNeighborDelta;
782
783 2 1. fillMatrices : negated conditional → KILLED
2. fillMatrices : Replaced integer addition with subtraction → KILLED
            for (int targetIndex = targetStart; targetIndex != targetEndExclusive; targetIndex += targetStep) {
784 1 1. fillMatrices : Replaced integer addition with subtraction → KILLED
                final char targetCharacter = targetCharacters[targetIndex + targetCharacterOffset];
785 1 1. fillMatrices : Replaced integer addition with subtraction → KILLED
                final int targetNeighbor = targetIndex + targetNeighborDelta;
786
787 1 1. fillMatrices : Replaced integer addition with subtraction → KILLED
                final int deleteCandidate = this.costMatrix[sourceNeighbor][targetIndex] + this.deleteCost;
788 1 1. fillMatrices : Replaced integer addition with subtraction → KILLED
                final int insertCandidate = this.costMatrix[sourceIndex][targetNeighbor] + this.insertCost;
789 1 1. fillMatrices : Replaced integer addition with subtraction → KILLED
                final int replaceCandidate = this.costMatrix[sourceNeighbor][targetNeighbor] + this.replaceCost;
790
                final int matchCandidate = this.costMatrix[sourceNeighbor][targetNeighbor]
791 2 1. fillMatrices : negated conditional → KILLED
2. fillMatrices : Replaced integer addition with subtraction → KILLED
                        + (sourceCharacter == targetCharacter ? this.matchCost : MISMATCH_PENALTY);
792
793
                int bestCost = matchCandidate;
794
                Trace bestTrace = Trace.MATCH;
795
796 2 1. fillMatrices : changed conditional boundary → SURVIVED
2. fillMatrices : negated conditional → KILLED
                if (deleteCandidate <= bestCost) {
797
                    bestCost = deleteCandidate;
798
                    bestTrace = Trace.DELETE;
799
                }
800 2 1. fillMatrices : changed conditional boundary → SURVIVED
2. fillMatrices : negated conditional → KILLED
                if (insertCandidate < bestCost) {
801
                    bestCost = insertCandidate;
802
                    bestTrace = Trace.INSERT;
803
                }
804 2 1. fillMatrices : changed conditional boundary → SURVIVED
2. fillMatrices : negated conditional → KILLED
                if (replaceCandidate < bestCost) {
805
                    bestCost = replaceCandidate;
806
                    bestTrace = Trace.REPLACE;
807
                }
808
809
                this.costMatrix[sourceIndex][targetIndex] = bestCost;
810
                this.traceMatrix[sourceIndex][targetIndex] = bestTrace;
811
            }
812
        }
813
    }
814
815
    /**
816
     * Reconstructs the compact patch command by traversing the trace matrix from
817
     * the final cell back to the origin.
818
     *
819
     * @param targetCharacters target characters
820
     * @param sourceLength     source length
821
     * @param targetLength     target length
822
     * @return compact patch command
823
     */
824
    private String buildPatchCommandBackward(final char[] targetCharacters, final int sourceLength,
825
            final int targetLength) {
826 1 1. buildPatchCommandBackward : Replaced integer addition with subtraction → KILLED
        final StringBuilder patchBuilder = new StringBuilder(sourceLength + targetLength);
827
828
        char pendingDeletes = COUNT_SENTINEL;
829
        char pendingSkips = COUNT_SENTINEL;
830
831
        int sourceIndex = sourceLength;
832
        int targetIndex = targetLength;
833
834 2 1. buildPatchCommandBackward : negated conditional → KILLED
2. buildPatchCommandBackward : negated conditional → KILLED
        while (sourceIndex != 0 || targetIndex != 0) {
835
            final Trace trace = this.traceMatrix[sourceIndex][targetIndex];
836
837
            switch (trace) {
838
                case DELETE:
839 1 1. buildPatchCommandBackward : negated conditional → KILLED
                    if (pendingSkips != COUNT_SENTINEL) {
840 1 1. buildPatchCommandBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                        appendInstruction(patchBuilder, SKIP_OPCODE, pendingSkips);
841
                        pendingSkips = COUNT_SENTINEL;
842
                    }
843 1 1. buildPatchCommandBackward : Replaced integer addition with subtraction → KILLED
                    pendingDeletes++;
844 1 1. buildPatchCommandBackward : Changed increment from -1 to 1 → KILLED
                    sourceIndex--;
845
                    break;
846
847
                case INSERT:
848 1 1. buildPatchCommandBackward : negated conditional → KILLED
                    if (pendingDeletes != COUNT_SENTINEL) {
849 1 1. buildPatchCommandBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → NO_COVERAGE
                        appendInstruction(patchBuilder, DELETE_OPCODE, pendingDeletes);
850
                        pendingDeletes = COUNT_SENTINEL;
851
                    }
852 1 1. buildPatchCommandBackward : negated conditional → KILLED
                    if (pendingSkips != COUNT_SENTINEL) {
853 1 1. buildPatchCommandBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                        appendInstruction(patchBuilder, SKIP_OPCODE, pendingSkips);
854
                        pendingSkips = COUNT_SENTINEL;
855
                    }
856 1 1. buildPatchCommandBackward : Changed increment from -1 to 1 → KILLED
                    targetIndex--;
857 1 1. buildPatchCommandBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                    appendInstruction(patchBuilder, INSERT_OPCODE, targetCharacters[targetIndex]);
858
                    break;
859
860
                case REPLACE:
861 1 1. buildPatchCommandBackward : negated conditional → KILLED
                    if (pendingDeletes != COUNT_SENTINEL) {
862 1 1. buildPatchCommandBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                        appendInstruction(patchBuilder, DELETE_OPCODE, pendingDeletes);
863
                        pendingDeletes = COUNT_SENTINEL;
864
                    }
865 1 1. buildPatchCommandBackward : negated conditional → KILLED
                    if (pendingSkips != COUNT_SENTINEL) {
866 1 1. buildPatchCommandBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                        appendInstruction(patchBuilder, SKIP_OPCODE, pendingSkips);
867
                        pendingSkips = COUNT_SENTINEL;
868
                    }
869 1 1. buildPatchCommandBackward : Changed increment from -1 to 1 → KILLED
                    targetIndex--;
870 1 1. buildPatchCommandBackward : Changed increment from -1 to 1 → KILLED
                    sourceIndex--;
871 1 1. buildPatchCommandBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                    appendInstruction(patchBuilder, REPLACE_OPCODE, targetCharacters[targetIndex]);
872
                    break;
873
874
                case MATCH:
875 1 1. buildPatchCommandBackward : negated conditional → KILLED
                    if (pendingDeletes != COUNT_SENTINEL) {
876 1 1. buildPatchCommandBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                        appendInstruction(patchBuilder, DELETE_OPCODE, pendingDeletes);
877
                        pendingDeletes = COUNT_SENTINEL;
878
                    }
879 1 1. buildPatchCommandBackward : Replaced integer addition with subtraction → KILLED
                    pendingSkips++;
880 1 1. buildPatchCommandBackward : Changed increment from -1 to 1 → KILLED
                    sourceIndex--;
881 1 1. buildPatchCommandBackward : Changed increment from -1 to 1 → KILLED
                    targetIndex--;
882
                    break;
883
            }
884
        }
885
886 1 1. buildPatchCommandBackward : negated conditional → KILLED
        if (pendingDeletes != COUNT_SENTINEL) {
887 1 1. buildPatchCommandBackward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
            appendInstruction(patchBuilder, DELETE_OPCODE, pendingDeletes);
888
        }
889
890 1 1. buildPatchCommandBackward : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::buildPatchCommandBackward → KILLED
        return patchBuilder.toString();
891
    }
892
893
    /**
894
     * Reconstructs compact patch command for forward traversal.
895
     *
896
     * @param targetCharacters target characters
897
     * @param sourceLength     source length
898
     * @param targetLength     target length
899
     * @return compact patch command
900
     */
901
    private String buildPatchCommandForward(final char[] targetCharacters, final int sourceLength,
902
            final int targetLength) {
903 1 1. buildPatchCommandForward : Replaced integer addition with subtraction → SURVIVED
        final StringBuilder patchBuilder = new StringBuilder(sourceLength + targetLength);
904
905
        char pendingDeletes = COUNT_SENTINEL;
906
        char pendingSkips = COUNT_SENTINEL;
907
908
        int sourceIndex = 0;
909
        int targetIndex = 0;
910
911 2 1. buildPatchCommandForward : negated conditional → KILLED
2. buildPatchCommandForward : negated conditional → KILLED
        while (sourceIndex != sourceLength || targetIndex != targetLength) {
912
            final Trace trace = this.traceMatrix[sourceIndex][targetIndex];
913
914
            switch (trace) {
915
                case DELETE:
916 1 1. buildPatchCommandForward : negated conditional → KILLED
                    if (pendingSkips != COUNT_SENTINEL) {
917 1 1. buildPatchCommandForward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                        appendInstruction(patchBuilder, SKIP_OPCODE, pendingSkips);
918
                        pendingSkips = COUNT_SENTINEL;
919
                    }
920 1 1. buildPatchCommandForward : Replaced integer addition with subtraction → KILLED
                    pendingDeletes++;
921 1 1. buildPatchCommandForward : Changed increment from 1 to -1 → KILLED
                    sourceIndex++;
922
                    break;
923
924
                case INSERT:
925 1 1. buildPatchCommandForward : negated conditional → NO_COVERAGE
                    if (pendingDeletes != COUNT_SENTINEL) {
926 1 1. buildPatchCommandForward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → NO_COVERAGE
                        appendInstruction(patchBuilder, DELETE_OPCODE, pendingDeletes);
927
                        pendingDeletes = COUNT_SENTINEL;
928
                    }
929 1 1. buildPatchCommandForward : negated conditional → NO_COVERAGE
                    if (pendingSkips != COUNT_SENTINEL) {
930 1 1. buildPatchCommandForward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → NO_COVERAGE
                        appendInstruction(patchBuilder, SKIP_OPCODE, pendingSkips);
931
                        pendingSkips = COUNT_SENTINEL;
932
                    }
933 1 1. buildPatchCommandForward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → NO_COVERAGE
                    appendInstruction(patchBuilder, INSERT_OPCODE, targetCharacters[targetIndex]);
934 1 1. buildPatchCommandForward : Changed increment from 1 to -1 → NO_COVERAGE
                    targetIndex++;
935
                    break;
936
937
                case REPLACE:
938 1 1. buildPatchCommandForward : negated conditional → SURVIVED
                    if (pendingDeletes != COUNT_SENTINEL) {
939 1 1. buildPatchCommandForward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                        appendInstruction(patchBuilder, DELETE_OPCODE, pendingDeletes);
940
                        pendingDeletes = COUNT_SENTINEL;
941
                    }
942 1 1. buildPatchCommandForward : negated conditional → KILLED
                    if (pendingSkips != COUNT_SENTINEL) {
943 1 1. buildPatchCommandForward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → NO_COVERAGE
                        appendInstruction(patchBuilder, SKIP_OPCODE, pendingSkips);
944
                        pendingSkips = COUNT_SENTINEL;
945
                    }
946 1 1. buildPatchCommandForward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                    appendInstruction(patchBuilder, REPLACE_OPCODE, targetCharacters[targetIndex]);
947 1 1. buildPatchCommandForward : Changed increment from 1 to -1 → SURVIVED
                    sourceIndex++;
948 1 1. buildPatchCommandForward : Changed increment from 1 to -1 → KILLED
                    targetIndex++;
949
                    break;
950
951
                case MATCH:
952 1 1. buildPatchCommandForward : negated conditional → KILLED
                    if (pendingDeletes != COUNT_SENTINEL) {
953 1 1. buildPatchCommandForward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
                        appendInstruction(patchBuilder, DELETE_OPCODE, pendingDeletes);
954
                        pendingDeletes = COUNT_SENTINEL;
955
                    }
956 1 1. buildPatchCommandForward : Replaced integer addition with subtraction → KILLED
                    pendingSkips++;
957 1 1. buildPatchCommandForward : Changed increment from 1 to -1 → KILLED
                    sourceIndex++;
958 1 1. buildPatchCommandForward : Changed increment from 1 to -1 → KILLED
                    targetIndex++;
959
                    break;
960
            }
961
        }
962
963 1 1. buildPatchCommandForward : negated conditional → KILLED
        if (pendingDeletes != COUNT_SENTINEL) {
964 1 1. buildPatchCommandForward : removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED
            appendInstruction(patchBuilder, DELETE_OPCODE, pendingDeletes);
965
        }
966
967 1 1. buildPatchCommandForward : replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::buildPatchCommandForward → KILLED
        return patchBuilder.toString();
968
    }
969
970
    /**
971
     * Appends one serialized instruction to the patch command builder.
972
     *
973
     * @param patchBuilder patch command builder
974
     * @param opcode       single-character instruction opcode
975
     * @param argument     encoded instruction argument
976
     */
977
    private static void appendInstruction(final StringBuilder patchBuilder, final char opcode, final char argument) {
978
        patchBuilder.append(opcode).append(argument);
979
    }
980
981
    /**
982
     * Fluent builder for creating direction-specialized {@link PatchCommandEncoder}
983
     * instances.
984
     */
985
    public static final class Builder {
986
        private WordTraversalDirection traversalDirection = WordTraversalDirection.BACKWARD;
987
        private int insertCost = 1;
988
        private int deleteCost = 1;
989
        private int replaceCost = 1;
990
        private int matchCost; // = 0
991
992
        /**
993
         * Creates a builder initialized with the default Egothor-compatible cost model
994
         * and backward traversal.
995
         */
996
        public Builder() {
997
            // Default values are assigned in field initializers.
998
        }
999
1000
        /**
1001
         * Sets traversal direction used by the created encoder.
1002
         *
1003
         * @param value traversal direction
1004
         * @return this builder
1005
         */
1006
        public Builder traversalDirection(final WordTraversalDirection value) {
1007
            this.traversalDirection = Objects.requireNonNull(value, "traversalDirection");
1008 1 1. traversalDirection : replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::traversalDirection → KILLED
            return this;
1009
        }
1010
1011
        /**
1012
         * Sets cost of an insert operation.
1013
         * 
1014
         * @param value cost of the operation
1015
         * @return this builder
1016
         */
1017
        public Builder insertCost(final int value) {
1018
            this.insertCost = value;
1019 1 1. insertCost : replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::insertCost → KILLED
            return this;
1020
        }
1021
1022
        /**
1023
         * Sets cost of a delete operation.
1024
         * 
1025
         * @param value cost of the operation
1026
         * @return this builder
1027
         */
1028
        public Builder deleteCost(final int value) {
1029
            this.deleteCost = value;
1030 1 1. deleteCost : replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::deleteCost → KILLED
            return this;
1031
        }
1032
1033
        /**
1034
         * Sets cost of a replace operation.
1035
         * 
1036
         * @param value cost of the operation
1037
         * @return this builder
1038
         */
1039
        public Builder replaceCost(final int value) {
1040
            this.replaceCost = value;
1041 1 1. replaceCost : replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::replaceCost → KILLED
            return this;
1042
        }
1043
1044
        /**
1045
         * Sets cost of a match operation.
1046
         * 
1047
         * @param value cost of the operation
1048
         * @return this builder
1049
         */
1050
        public Builder matchCost(final int value) {
1051
            this.matchCost = value;
1052 1 1. matchCost : replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::matchCost → KILLED
            return this;
1053
        }
1054
1055
        /**
1056
         * Builds a direction-specialized encoder instance.
1057
         *
1058
         * @return configured encoder
1059
         */
1060
        public PatchCommandEncoder build() {
1061 1 1. build : replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::build → KILLED
            return new PatchCommandEncoder(this);
1062
        }
1063
    }
1064
}

Mutations

226

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

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

230

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

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

234

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

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

238

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

2.2
Location : <init>
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldReturnNullWhenTargetIsNull()]
negated conditional → KILLED

259

1.1
Location : builder
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldReturnNullWhenTargetIsNull()]
replaced return value with null for org/egothor/stemmer/PatchCommandEncoder::builder → KILLED

272

1.1
Location : encode
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldReturnNullWhenSourceIsNull()]
negated conditional → KILLED

2.2
Location : encode
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldReturnNullWhenTargetIsNull()]
negated conditional → KILLED

273

1.1
Location : encode
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldReturnNullWhenSourceIsNull()]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encode → KILLED

275

1.1
Location : encode
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldReturnCanonicalNoopPatchForEqualEmptyWords()]
negated conditional → KILLED

276

1.1
Location : encode
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldReturnCanonicalNoopPatchForEqualEmptyWords()]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encode → KILLED

279

1.1
Location : encode
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ReversedWordProcessingTests]/[test-template:shouldReconstructReversedTargetsFromReversedSources(int, java.lang.String, java.lang.String)]/[test-template-invocation:#17]
negated conditional → KILLED

280

1.1
Location : encode
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encode → KILLED

282

1.1
Location : encode
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encode → KILLED

299

1.1
Location : applyWithConfiguredDirection
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
negated conditional → KILLED

300

1.1
Location : applyWithConfiguredDirection
Killed by : none
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::applyWithConfiguredDirection → NO_COVERAGE

302

1.1
Location : applyWithConfiguredDirection
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::applyWithConfiguredDirection → KILLED

314

1.1
Location : apply
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldReturnSourceWhenPatchIsNull()]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::apply → KILLED

333

1.1
Location : apply
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldReturnSourceWhenPatchIsNull()]
negated conditional → KILLED

334

1.1
Location : apply
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldReturnNullWhenSourceIsNull()]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::apply → KILLED

336

1.1
Location : apply
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldReturnSourceWhenPatchIsNull()]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::apply → KILLED

350

1.1
Location : encodeBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
removed call to java/util/concurrent/locks/ReentrantLock::lock → KILLED

352

1.1
Location : encodeBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
removed call to org/egothor/stemmer/PatchCommandEncoder::ensureCapacity → KILLED

2.2
Location : encodeBackward
Killed by : org.egothor.stemmer.FuzzStemmerAndTrieCompilationTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.FuzzStemmerAndTrieCompilationTest]/[method:generatedStemmerTriesShouldSurviveBinaryPersistence()]
Replaced integer addition with subtraction → KILLED

3.3
Location : encodeBackward
Killed by : org.egothor.stemmer.FuzzStemmerAndTrieCompilationTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.FuzzStemmerAndTrieCompilationTest]/[method:generatedStemmerTriesShouldSurviveBinaryPersistence()]
Replaced integer addition with subtraction → KILLED

353

1.1
Location : encodeBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
removed call to org/egothor/stemmer/PatchCommandEncoder::initializeBoundaryConditionsBackward → KILLED

358

1.1
Location : encodeBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
removed call to org/egothor/stemmer/PatchCommandEncoder::fillMatrices → KILLED

361

1.1
Location : encodeBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encodeBackward → KILLED

363

1.1
Location : encodeBackward
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → SURVIVED
Covering tests

378

1.1
Location : encodeForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
removed call to java/util/concurrent/locks/ReentrantLock::lock → KILLED

380

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

2.2
Location : encodeForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
removed call to org/egothor/stemmer/PatchCommandEncoder::ensureCapacity → KILLED

3.3
Location : encodeForward
Killed by : none
Replaced integer addition with subtraction → SURVIVED Covering tests

381

1.1
Location : encodeForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
removed call to org/egothor/stemmer/PatchCommandEncoder::initializeBoundaryConditionsForward → KILLED

386

1.1
Location : encodeForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
removed call to org/egothor/stemmer/PatchCommandEncoder::fillMatrices → KILLED

389

1.1
Location : encodeForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::encodeForward → KILLED

391

1.1
Location : encodeForward
Killed by : none
removed call to java/util/concurrent/locks/ReentrantLock::unlock → SURVIVED
Covering tests

651

1.1
Location : applyStrategyFor
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldReturnSourceWhenPatchIsNull()]
replaced return value with null for org/egothor/stemmer/PatchCommandEncoder::applyStrategyFor → KILLED

2.2
Location : applyStrategyFor
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[test-template:shouldApplyExplicitPatchCommandsCorrectly(int, java.lang.String, java.lang.String, java.lang.String)]/[test-template-invocation:#3]
negated conditional → KILLED

676

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

2.2
Location : ensureCapacity
Killed by : none
negated conditional → SURVIVED Covering tests

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

4.4
Location : ensureCapacity
Killed by : none
negated conditional → SURVIVED Covering tests

680

1.1
Location : ensureCapacity
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
Replaced integer addition with subtraction → KILLED

681

1.1
Location : ensureCapacity
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
Replaced integer addition with subtraction → KILLED

698

1.1
Location : initializeBoundaryConditionsBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
negated conditional → KILLED

2.2
Location : initializeBoundaryConditionsBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
changed conditional boundary → KILLED

699

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

703

1.1
Location : initializeBoundaryConditionsBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ReversedWordProcessingTests]/[test-template:shouldReconstructReversedTargetsFromReversedSources(int, java.lang.String, java.lang.String)]/[test-template-invocation:#17]
changed conditional boundary → KILLED

2.2
Location : initializeBoundaryConditionsBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
negated conditional → KILLED

704

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

719

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

2.2
Location : initializeBoundaryConditionsForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ConstructionTests]/[method:shouldBuildDirectionSpecializedEncoderViaBuilder()]
changed conditional boundary → KILLED

3.3
Location : initializeBoundaryConditionsForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
negated conditional → KILLED

720

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

2.2
Location : initializeBoundaryConditionsForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Replaced integer addition with subtraction → KILLED

725

1.1
Location : initializeBoundaryConditionsForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldReconstructTargetWithForwardTraversalEncoderAndStaticApply()]
negated conditional → KILLED

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

3.3
Location : initializeBoundaryConditionsForward
Killed by : none
Replaced integer subtraction with addition → SURVIVED Covering tests

726

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

2.2
Location : initializeBoundaryConditionsForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Replaced integer addition with subtraction → KILLED

755

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
negated conditional → KILLED

757

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
Replaced integer addition with subtraction → KILLED

760

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
Replaced integer addition with subtraction → KILLED

767

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Replaced integer subtraction with addition → KILLED

770

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Replaced integer subtraction with addition → KILLED

779

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ReversedWordProcessingTests]/[test-template:shouldReconstructReversedTargetsFromReversedSources(int, java.lang.String, java.lang.String)]/[test-template-invocation:#17]
negated conditional → KILLED

2.2
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
Replaced integer addition with subtraction → KILLED

780

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
Replaced integer addition with subtraction → KILLED

781

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Replaced integer addition with subtraction → KILLED

783

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
negated conditional → KILLED

2.2
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
Replaced integer addition with subtraction → KILLED

784

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
Replaced integer addition with subtraction → KILLED

785

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Replaced integer addition with subtraction → KILLED

787

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldNotEmitTrailingSkipInstructionsIntoPatchCommand()]
Replaced integer addition with subtraction → KILLED

788

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldNotEmitTrailingSkipInstructionsIntoPatchCommand()]
Replaced integer addition with subtraction → KILLED

789

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldNotEmitTrailingSkipInstructionsIntoPatchCommand()]
Replaced integer addition with subtraction → KILLED

791

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
negated conditional → KILLED

2.2
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
Replaced integer addition with subtraction → KILLED

796

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

2.2
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldNotEmitTrailingSkipInstructionsIntoPatchCommand()]
negated conditional → KILLED

800

1.1
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldNotEmitTrailingSkipInstructionsIntoPatchCommand()]
negated conditional → KILLED

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

804

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

2.2
Location : fillMatrices
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldNotEmitTrailingSkipInstructionsIntoPatchCommand()]
negated conditional → KILLED

826

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ReversedWordProcessingTests]/[test-template:shouldReconstructReversedTargetsFromReversedSources(int, java.lang.String, java.lang.String)]/[test-template-invocation:#17]
Replaced integer addition with subtraction → KILLED

834

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
negated conditional → KILLED

2.2
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
negated conditional → KILLED

839

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
negated conditional → KILLED

840

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[test-template:shouldPreserveCorrectnessUnderMirroredInputOrientation(int, java.lang.String, java.lang.String)]/[test-template-invocation:#13]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

843

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
Replaced integer addition with subtraction → KILLED

844

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
Changed increment from -1 to 1 → KILLED

848

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ReversedWordProcessingTests]/[test-template:shouldReconstructReversedTargetsFromReversedSources(int, java.lang.String, java.lang.String)]/[test-template-invocation:#17]
negated conditional → KILLED

849

1.1
Location : buildPatchCommandBackward
Killed by : none
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → NO_COVERAGE

852

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ReversedWordProcessingTests]/[test-template:shouldReconstructReversedTargetsFromReversedSources(int, java.lang.String, java.lang.String)]/[test-template-invocation:#17]
negated conditional → KILLED

853

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[test-template:shouldPreserveCorrectnessUnderMirroredInputOrientation(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

856

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ReversedWordProcessingTests]/[test-template:shouldReconstructReversedTargetsFromReversedSources(int, java.lang.String, java.lang.String)]/[test-template-invocation:#17]
Changed increment from -1 to 1 → KILLED

857

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ReversedWordProcessingTests]/[test-template:shouldReconstructReversedTargetsFromReversedSources(int, java.lang.String, java.lang.String)]/[test-template-invocation:#17]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

861

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
negated conditional → KILLED

862

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandlePluralToSingularTransformation()]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

865

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
negated conditional → KILLED

866

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#11]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

869

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
Changed increment from -1 to 1 → KILLED

870

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
Changed increment from -1 to 1 → KILLED

871

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:StemmingScenarioTests]/[method:shouldHandleSingleCharacterReplacement()]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

875

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#5]
negated conditional → KILLED

876

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ConstructionTests]/[method:shouldCreateEncoderWithDefaultCostModel()]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

879

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#11]
Replaced integer addition with subtraction → KILLED

880

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ConstructionTests]/[method:shouldCreateEncoderWithDefaultCostModel()]
Changed increment from -1 to 1 → KILLED

881

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ConstructionTests]/[method:shouldCreateEncoderWithDefaultCostModel()]
Changed increment from -1 to 1 → KILLED

886

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
negated conditional → KILLED

887

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

890

1.1
Location : buildPatchCommandBackward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[test-template:shouldReconstructTargetForRoundTripPairs(int, java.lang.String, java.lang.String)]/[test-template-invocation:#14]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::buildPatchCommandBackward → KILLED

903

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

911

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
negated conditional → KILLED

2.2
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
negated conditional → KILLED

916

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
negated conditional → KILLED

917

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

920

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Replaced integer addition with subtraction → KILLED

921

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Changed increment from 1 to -1 → KILLED

925

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

926

1.1
Location : buildPatchCommandForward
Killed by : none
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → NO_COVERAGE

929

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

930

1.1
Location : buildPatchCommandForward
Killed by : none
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → NO_COVERAGE

933

1.1
Location : buildPatchCommandForward
Killed by : none
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → NO_COVERAGE

934

1.1
Location : buildPatchCommandForward
Killed by : none
Changed increment from 1 to -1 → NO_COVERAGE

938

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

939

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldReconstructTargetWithForwardTraversalEncoderAndStaticApply()]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

942

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldReconstructTargetWithForwardTraversalEncoderAndStaticApply()]
negated conditional → KILLED

943

1.1
Location : buildPatchCommandForward
Killed by : none
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → NO_COVERAGE

946

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldReconstructTargetWithForwardTraversalEncoderAndStaticApply()]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

947

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

948

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldReconstructTargetWithForwardTraversalEncoderAndStaticApply()]
Changed increment from 1 to -1 → KILLED

952

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
negated conditional → KILLED

953

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ConstructionTests]/[method:shouldBuildDirectionSpecializedEncoderViaBuilder()]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

956

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Replaced integer addition with subtraction → KILLED

957

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Changed increment from 1 to -1 → KILLED

958

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
Changed increment from 1 to -1 → KILLED

963

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
negated conditional → KILLED

964

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
removed call to org/egothor/stemmer/PatchCommandEncoder::appendInstruction → KILLED

967

1.1
Location : buildPatchCommandForward
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
replaced return value with "" for org/egothor/stemmer/PatchCommandEncoder::buildPatchCommandForward → KILLED

1008

1.1
Location : traversalDirection
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ApplyTests]/[method:shouldApplyPatchViaInstanceLevelDirectionSpecializedFastPath()]
replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::traversalDirection → KILLED

1019

1.1
Location : insertCost
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ConstructionTests]/[method:shouldRejectNegativeInsertCost()]
replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::insertCost → KILLED

1030

1.1
Location : deleteCost
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ConstructionTests]/[method:shouldRejectNegativeInsertCost()]
replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::deleteCost → KILLED

1041

1.1
Location : replaceCost
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ConstructionTests]/[method:shouldRejectNegativeInsertCost()]
replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::replaceCost → KILLED

1052

1.1
Location : matchCost
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:ConstructionTests]/[method:shouldRejectNegativeInsertCost()]
replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::matchCost → KILLED

1061

1.1
Location : build
Killed by : org.egothor.stemmer.PatchCommandEncoderTest.[engine:junit-jupiter]/[class:org.egothor.stemmer.PatchCommandEncoderTest]/[nested-class:EncodeTests]/[method:shouldReturnNullWhenTargetIsNull()]
replaced return value with null for org/egothor/stemmer/PatchCommandEncoder$Builder::build → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1