RecordMappingIndex.java

1
/*
2
 * Copyright 2004 the original author or authors.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package com.ancientprogramming.fixedformat4j.io.read;
17
18
import java.util.ArrayList;
19
import java.util.Arrays;
20
import java.util.Comparator;
21
import java.util.HashMap;
22
import java.util.List;
23
import java.util.Map;
24
import java.util.Objects;
25
26
/**
27
 * Bucketed lookup of {@link RecordMapping}s keyed by their {@link LinePattern}. Built once at
28
 * reader-build time and queried per line by {@link FixedFormatLineProcessor}.
29
 *
30
 * <p>Patterns sharing the same positions array share a hash bucket; within a bucket, mappings
31
 * are keyed by the literal extracted from those positions. Match-all patterns are kept in a
32
 * separate list and appended to every result.</p>
33
 *
34
 * <p>{@link #findMatches(String)} returns matched mappings ordered by depth descending then by
35
 * registration order — so the most detailed match is first and ties fall back to insertion order.</p>
36
 *
37
 * @author Jacob von Eyben - <a href="https://eybenconsult.com">https://eybenconsult.com</a>
38
 * @since 1.8.0
39
 */
40
final class RecordMappingIndex {
41
42
  private static final Comparator<IndexedMapping> BY_DEPTH_DESC_THEN_SEQUENCE =
43 1 1. lambda$static$0 : replaced int return with 0 for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex::lambda$static$0 → KILLED
      Comparator.<IndexedMapping>comparingInt(im -> im.depth).reversed()
44 1 1. lambda$static$1 : replaced int return with 0 for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex::lambda$static$1 → KILLED
          .thenComparingInt(im -> im.sequence);
45
46
  private final List<IndexedMapping> matchAll;
47
  private final List<Bucket> buckets;
48
49
  private RecordMappingIndex(List<IndexedMapping> matchAll, List<Bucket> buckets) {
50 1 1. <init> : Removed assignment to member variable matchAll → KILLED
    this.matchAll = matchAll;
51 1 1. <init> : Removed assignment to member variable buckets → KILLED
    this.buckets = buckets;
52
  }
53
54
  List<RecordMapping<?>> findMatches(String line) {
55 1 1. findMatches : removed call to java/util/ArrayList::<init> → KILLED
    List<IndexedMapping> hits = new ArrayList<>();
56
    for (Bucket bucket : buckets) {
57 5 1. findMatches : negated conditional → KILLED
2. findMatches : removed conditional - replaced comparison check with true → KILLED
3. findMatches : changed conditional boundary → KILLED
4. findMatches : removed call to java/lang/String::length → KILLED
5. findMatches : removed conditional - replaced comparison check with false → KILLED
      if (line.length() <= bucket.maxPosition) {
58
        continue;
59
      }
60 4 1. findMatches : removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Bucket::extractKey → KILLED
2. findMatches : replaced call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Bucket::extractKey with argument → KILLED
3. findMatches : removed call to java/util/Map::get → KILLED
4. findMatches : replaced call to java/util/Map::get with argument → KILLED
      List<IndexedMapping> atKey = bucket.byLiteral.get(bucket.extractKey(line));
61 3 1. findMatches : removed conditional - replaced equality check with true → KILLED
2. findMatches : removed conditional - replaced equality check with false → KILLED
3. findMatches : negated conditional → KILLED
      if (atKey != null) {
62 1 1. findMatches : removed call to java/util/List::addAll → KILLED
        hits.addAll(atKey);
63
      }
64
    }
65 1 1. findMatches : removed call to java/util/List::addAll → KILLED
    hits.addAll(matchAll);
66 1 1. findMatches : removed call to java/util/List::sort → KILLED
    hits.sort(BY_DEPTH_DESC_THEN_SEQUENCE);
67 2 1. findMatches : removed call to java/util/List::size → SURVIVED
2. findMatches : removed call to java/util/ArrayList::<init> → KILLED
    List<RecordMapping<?>> result = new ArrayList<>(hits.size());
68
    for (IndexedMapping im : hits) {
69 1 1. findMatches : removed call to java/util/List::add → KILLED
      result.add(im.mapping);
70
    }
71 1 1. findMatches : replaced return value with Collections.emptyList for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex::findMatches → KILLED
    return result;
72
  }
73
74
  static Builder builder() {
75 2 1. builder : removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::<init> → KILLED
2. builder : replaced return value with null for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex::builder → KILLED
    return new Builder();
76
  }
77
78
  static final class Builder {
79 2 1. <init> : Removed assignment to member variable matchAll → KILLED
2. <init> : removed call to java/util/ArrayList::<init> → KILLED
    private final List<IndexedMapping> matchAll = new ArrayList<>();
80 2 1. <init> : removed call to java/util/HashMap::<init> → KILLED
2. <init> : Removed assignment to member variable byPositions → KILLED
    private final Map<PositionsKey, Bucket> byPositions = new HashMap<>();
81 2 1. <init> : Removed assignment to member variable sequence → SURVIVED
2. <init> : Substituted 0 with 1 → SURVIVED
    private int sequence = 0;
82
83
    Builder add(LinePattern pattern, RecordMapping<?> mapping) {
84 2 1. add : replaced call to java/util/Objects::requireNonNull with argument → SURVIVED
2. add : removed call to java/util/Objects::requireNonNull → SURVIVED
      Objects.requireNonNull(pattern, "pattern must not be null");
85 2 1. add : removed call to java/util/Objects::requireNonNull → KILLED
2. add : replaced call to java/util/Objects::requireNonNull with argument → KILLED
      Objects.requireNonNull(mapping, "mapping must not be null");
86 5 1. add : removed call to com/ancientprogramming/fixedformat4j/io/read/LinePattern::depth → KILLED
2. add : Replaced integer addition with subtraction → KILLED
3. add : Removed assignment to member variable sequence → KILLED
4. add : Substituted 1 with 0 → KILLED
5. add : removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$IndexedMapping::<init> → KILLED
      IndexedMapping im = new IndexedMapping(sequence++, pattern.depth(), mapping);
87 4 1. add : negated conditional → KILLED
2. add : removed conditional - replaced equality check with false → KILLED
3. add : removed call to com/ancientprogramming/fixedformat4j/io/read/LinePattern::depth → KILLED
4. add : removed conditional - replaced equality check with true → KILLED
      if (pattern.depth() == 0) {
88 1 1. add : removed call to java/util/List::add → KILLED
        matchAll.add(im);
89 1 1. add : replaced return value with null for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::add → KILLED
        return this;
90
      }
91 1 1. add : removed call to com/ancientprogramming/fixedformat4j/io/read/LinePattern::positions → KILLED
      int[] positions = pattern.positions();
92 3 1. add : removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$PositionsKey::<init> → KILLED
2. add : removed call to java/util/Map::computeIfAbsent → KILLED
3. add : replaced call to java/util/Map::computeIfAbsent with argument → KILLED
      Bucket bucket = byPositions.computeIfAbsent(new PositionsKey(positions),
93 2 1. lambda$add$0 : removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Bucket::<init> → KILLED
2. lambda$add$0 : replaced return value with null for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::lambda$add$0 → KILLED
          k -> new Bucket(positions));
94 6 1. add : removed call to java/util/List::add → KILLED
2. lambda$add$1 : removed call to java/util/ArrayList::<init> → KILLED
3. add : removed call to com/ancientprogramming/fixedformat4j/io/read/LinePattern::literal → KILLED
4. lambda$add$1 : replaced return value with Collections.emptyList for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::lambda$add$1 → KILLED
5. add : replaced call to java/util/Map::computeIfAbsent with argument → KILLED
6. add : removed call to java/util/Map::computeIfAbsent → KILLED
      bucket.byLiteral.computeIfAbsent(pattern.literal(), k -> new ArrayList<>()).add(im);
95 1 1. add : replaced return value with null for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::add → KILLED
      return this;
96
    }
97
98
    RecordMappingIndex build() {
99 5 1. build : removed call to java/util/Map::values → KILLED
2. build : replaced return value with null for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::build → KILLED
3. build : removed call to java/util/List::copyOf → KILLED
4. build : removed call to java/util/List::copyOf → KILLED
5. build : removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex::<init> → KILLED
      return new RecordMappingIndex(List.copyOf(matchAll), List.copyOf(byPositions.values()));
100
    }
101
  }
102
103
  private static final class IndexedMapping {
104
    final int sequence;
105
    final int depth;
106
    final RecordMapping<?> mapping;
107
108
    IndexedMapping(int sequence, int depth, RecordMapping<?> mapping) {
109 1 1. <init> : Removed assignment to member variable sequence → KILLED
      this.sequence = sequence;
110 1 1. <init> : Removed assignment to member variable depth → KILLED
      this.depth = depth;
111 1 1. <init> : Removed assignment to member variable mapping → KILLED
      this.mapping = mapping;
112
    }
113
  }
114
115
  private static final class Bucket {
116
    final int[] positions;
117
    final int maxPosition;
118 2 1. <init> : Removed assignment to member variable byLiteral → KILLED
2. <init> : removed call to java/util/HashMap::<init> → KILLED
    final Map<String, List<IndexedMapping>> byLiteral = new HashMap<>();
119
120
    Bucket(int[] positions) {
121 1 1. <init> : Removed assignment to member variable positions → KILLED
      this.positions = positions;
122 3 1. <init> : Replaced integer subtraction with addition → KILLED
2. <init> : Removed assignment to member variable maxPosition → KILLED
3. <init> : Substituted 1 with 0 → KILLED
      this.maxPosition = positions[positions.length - 1];
123
    }
124
125
    String extractKey(String line) {
126
      char[] chars = new char[positions.length];
127 5 1. extractKey : removed conditional - replaced comparison check with false → KILLED
2. extractKey : Substituted 0 with 1 → KILLED
3. extractKey : changed conditional boundary → KILLED
4. extractKey : removed conditional - replaced comparison check with true → KILLED
5. extractKey : negated conditional → KILLED
      for (int i = 0; i < positions.length; i++) {
128 1 1. extractKey : removed call to java/lang/String::charAt → KILLED
        chars[i] = line.charAt(positions[i]);
129
      }
130 2 1. extractKey : replaced return value with "" for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Bucket::extractKey → KILLED
2. extractKey : removed call to java/lang/String::<init> → KILLED
      return new String(chars);
131
    }
132
  }
133
134
  private static final class PositionsKey {
135
    private final int[] positions;
136
    private final int hash;
137
138
    PositionsKey(int[] positions) {
139 1 1. <init> : Removed assignment to member variable positions → SURVIVED
      this.positions = positions;
140 2 1. <init> : removed call to java/util/Arrays::hashCode → SURVIVED
2. <init> : Removed assignment to member variable hash → SURVIVED
      this.hash = Arrays.hashCode(positions);
141
    }
142
143
    @Override
144
    public boolean equals(Object o) {
145 4 1. equals : removed conditional - replaced equality check with true → SURVIVED
2. equals : replaced boolean return with true for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$PositionsKey::equals → SURVIVED
3. equals : negated conditional → SURVIVED
4. equals : removed conditional - replaced equality check with false → SURVIVED
      return o instanceof PositionsKey
146 6 1. equals : Substituted 1 with 0 → SURVIVED
2. equals : Substituted 0 with 1 → NO_COVERAGE
3. equals : removed conditional - replaced equality check with true → SURVIVED
4. equals : negated conditional → SURVIVED
5. equals : removed call to java/util/Arrays::equals → SURVIVED
6. equals : removed conditional - replaced equality check with false → SURVIVED
          && Arrays.equals(positions, ((PositionsKey) o).positions);
147
    }
148
149
    @Override
150
    public int hashCode() {
151 1 1. hashCode : replaced int return with 0 for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$PositionsKey::hashCode → SURVIVED
      return hash;
152
    }
153
  }
154
}

Mutations

43

1.1
Location : lambda$static$0
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllAppearsAfterDeeperMatches()]
replaced int return with 0 for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex::lambda$static$0 → KILLED

44

1.1
Location : lambda$static$1
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:registrationOrderAppliesAmongSameDepthMatches()]
replaced int return with 0 for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex::lambda$static$1 → KILLED

50

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
Removed assignment to member variable matchAll → KILLED

51

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
Removed assignment to member variable buckets → KILLED

55

1.1
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to java/util/ArrayList::<init> → KILLED

57

1.1
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
negated conditional → KILLED

2.2
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed conditional - replaced comparison check with true → KILLED

3.3
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineLengthExactlyEqualToMaxPositionDoesNotMatch()]
changed conditional boundary → KILLED

4.4
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed call to java/lang/String::length → KILLED

5.5
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
removed conditional - replaced comparison check with false → KILLED

60

1.1
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Bucket::extractKey → KILLED

2.2
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
replaced call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Bucket::extractKey with argument → KILLED

3.3
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed call to java/util/Map::get → KILLED

4.4
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixMissReturnsEmpty()]
replaced call to java/util/Map::get with argument → KILLED

61

1.1
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixMissReturnsEmpty()]
removed conditional - replaced equality check with true → KILLED

2.2
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed conditional - replaced equality check with false → KILLED

3.3
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixMissReturnsEmpty()]
negated conditional → KILLED

62

1.1
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed call to java/util/List::addAll → KILLED

65

1.1
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to java/util/List::addAll → KILLED

66

1.1
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:registrationOrderAppliesAmongSameDepthMatches()]
removed call to java/util/List::sort → KILLED

67

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

2.2
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to java/util/ArrayList::<init> → KILLED

69

1.1
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to java/util/List::add → KILLED

71

1.1
Location : findMatches
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
replaced return value with Collections.emptyList for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex::findMatches → KILLED

75

1.1
Location : builder
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::<init> → KILLED

2.2
Location : builder
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
replaced return value with null for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex::builder → KILLED

79

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
Removed assignment to member variable matchAll → KILLED

2.2
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to java/util/ArrayList::<init> → KILLED

80

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to java/util/HashMap::<init> → KILLED

2.2
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
Removed assignment to member variable byPositions → KILLED

81

1.1
Location : <init>
Killed by : none
Removed assignment to member variable sequence → SURVIVED
Covering tests

2.2
Location : <init>
Killed by : none
Substituted 0 with 1 → SURVIVED Covering tests

84

1.1
Location : add
Killed by : none
replaced call to java/util/Objects::requireNonNull with argument → SURVIVED
Covering tests

2.2
Location : add
Killed by : none
removed call to java/util/Objects::requireNonNull → SURVIVED Covering tests

85

1.1
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:builderRejectsNullMapping()]
removed call to java/util/Objects::requireNonNull → KILLED

2.2
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:builderRejectsNullMapping()]
replaced call to java/util/Objects::requireNonNull with argument → KILLED

86

1.1
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllAppearsAfterDeeperMatches()]
removed call to com/ancientprogramming/fixedformat4j/io/read/LinePattern::depth → KILLED

2.2
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:registrationOrderAppliesAmongSameDepthMatches()]
Replaced integer addition with subtraction → KILLED

3.3
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:registrationOrderAppliesAmongSameDepthMatches()]
Removed assignment to member variable sequence → KILLED

4.4
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:registrationOrderAppliesAmongSameDepthMatches()]
Substituted 1 with 0 → KILLED

5.5
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$IndexedMapping::<init> → KILLED

87

1.1
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
negated conditional → KILLED

2.2
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed conditional - replaced equality check with false → KILLED

3.3
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
removed call to com/ancientprogramming/fixedformat4j/io/read/LinePattern::depth → KILLED

4.4
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
removed conditional - replaced equality check with true → KILLED

88

1.1
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to java/util/List::add → KILLED

89

1.1
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
replaced return value with null for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::add → KILLED

91

1.1
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
removed call to com/ancientprogramming/fixedformat4j/io/read/LinePattern::positions → KILLED

92

1.1
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:registrationOrderAppliesAmongSameDepthMatches()]
removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$PositionsKey::<init> → KILLED

2.2
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
removed call to java/util/Map::computeIfAbsent → KILLED

3.3
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
replaced call to java/util/Map::computeIfAbsent with argument → KILLED

93

1.1
Location : lambda$add$0
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Bucket::<init> → KILLED

2.2
Location : lambda$add$0
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
replaced return value with null for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::lambda$add$0 → KILLED

94

1.1
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed call to java/util/List::add → KILLED

2.2
Location : lambda$add$1
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
removed call to java/util/ArrayList::<init> → KILLED

3.3
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed call to com/ancientprogramming/fixedformat4j/io/read/LinePattern::literal → KILLED

4.4
Location : lambda$add$1
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
replaced return value with Collections.emptyList for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::lambda$add$1 → KILLED

5.5
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
replaced call to java/util/Map::computeIfAbsent with argument → KILLED

6.6
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
removed call to java/util/Map::computeIfAbsent → KILLED

95

1.1
Location : add
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
replaced return value with null for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::add → KILLED

99

1.1
Location : build
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to java/util/Map::values → KILLED

2.2
Location : build
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
replaced return value with null for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Builder::build → KILLED

3.3
Location : build
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to java/util/List::copyOf → KILLED

4.4
Location : build
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to java/util/List::copyOf → KILLED

5.5
Location : build
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllReturnsMappingForEveryLine()]
removed call to com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex::<init> → KILLED

109

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:registrationOrderAppliesAmongSameDepthMatches()]
Removed assignment to member variable sequence → KILLED

110

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:matchAllAppearsAfterDeeperMatches()]
Removed assignment to member variable depth → KILLED

111

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:emptyLineMatchesOnlyMatchAll()]
Removed assignment to member variable mapping → KILLED

118

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
Removed assignment to member variable byLiteral → KILLED

2.2
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
removed call to java/util/HashMap::<init> → KILLED

121

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixMissReturnsEmpty()]
Removed assignment to member variable positions → KILLED

122

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
Replaced integer subtraction with addition → KILLED

2.2
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
Removed assignment to member variable maxPosition → KILLED

3.3
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:lineShorterThanMaxPositionDoesNotMatch()]
Substituted 1 with 0 → KILLED

127

1.1
Location : extractKey
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed conditional - replaced comparison check with false → KILLED

2.2
Location : extractKey
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
Substituted 0 with 1 → KILLED

3.3
Location : extractKey
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixMissReturnsEmpty()]
changed conditional boundary → KILLED

4.4
Location : extractKey
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixMissReturnsEmpty()]
removed conditional - replaced comparison check with true → KILLED

5.5
Location : extractKey
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
negated conditional → KILLED

128

1.1
Location : extractKey
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed call to java/lang/String::charAt → KILLED

130

1.1
Location : extractKey
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
replaced return value with "" for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$Bucket::extractKey → KILLED

2.2
Location : extractKey
Killed by : com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.io.read.TestRecordMappingIndex]/[method:prefixHitReturnsMapping()]
removed call to java/lang/String::<init> → KILLED

139

1.1
Location : <init>
Killed by : none
Removed assignment to member variable positions → SURVIVED
Covering tests

140

1.1
Location : <init>
Killed by : none
removed call to java/util/Arrays::hashCode → SURVIVED
Covering tests

2.2
Location : <init>
Killed by : none
Removed assignment to member variable hash → SURVIVED Covering tests

145

1.1
Location : equals
Killed by : none
removed conditional - replaced equality check with true → SURVIVED
Covering tests

2.2
Location : equals
Killed by : none
replaced boolean return with true for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$PositionsKey::equals → SURVIVED Covering tests

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

4.4
Location : equals
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

146

1.1
Location : equals
Killed by : none
Substituted 1 with 0 → SURVIVED
Covering tests

2.2
Location : equals
Killed by : none
Substituted 0 with 1 → NO_COVERAGE

3.3
Location : equals
Killed by : none
removed conditional - replaced equality check with true → SURVIVED Covering tests

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

5.5
Location : equals
Killed by : none
removed call to java/util/Arrays::equals → SURVIVED Covering tests

6.6
Location : equals
Killed by : none
removed conditional - replaced equality check with false → SURVIVED Covering tests

151

1.1
Location : hashCode
Killed by : none
replaced int return with 0 for com/ancientprogramming/fixedformat4j/io/read/RecordMappingIndex$PositionsKey::hashCode → SURVIVED
Covering tests

Active mutators

Tests examined


Report generated by PIT 1.23.1 support