AnnotationScanner.java

1
package com.ancientprogramming.fixedformat4j.format.impl;
2
3
import com.ancientprogramming.fixedformat4j.annotation.Field;
4
import com.ancientprogramming.fixedformat4j.annotation.Fields;
5
import com.ancientprogramming.fixedformat4j.exception.FixedFormatException;
6
import org.slf4j.Logger;
7
import org.slf4j.LoggerFactory;
8
9
import java.lang.reflect.Method;
10
import java.util.ArrayList;
11
import java.util.LinkedHashMap;
12
import java.util.List;
13
14
import static java.lang.String.format;
15
16
/**
17
 * Discovers all {@link Field} and {@link Fields} annotation targets on a class.
18
 *
19
 * <p>Pass 1 walks public methods; pass 2 walks declared fields including superclasses.
20
 * Field annotations take priority over method annotations for the same property.
21
 * A conflict (both annotated) is logged as a warning.
22
 *
23
 * @author Jacob von Eyben - <a href="https://eybenconsult.com">https://eybenconsult.com</a>
24
 * @since 1.6.0
25
 */
26
class AnnotationScanner {
27
28
  private static final Logger LOG = LoggerFactory.getLogger(AnnotationScanner.class);
29
30
  /**
31
   * Returns all annotation targets for the given class in declaration order.
32
   */
33
  List<AnnotationTarget> scan(Class<?> clazz) {
34 1 1. scan : removed call to java/util/LinkedHashMap::<init> → KILLED
    LinkedHashMap<String, AnnotationTarget> targets = new LinkedHashMap<>();
35 1 1. scan : removed call to com/ancientprogramming/fixedformat4j/format/impl/JavaRecordSupport::isJavaRecord → SURVIVED
    boolean isJavaRecord = JavaRecordSupport.isJavaRecord(clazz);
36
37
    // Pass 1: method annotations. Record accessors keep their raw name as key: they carry no
38
    // get/is prefix, and stripping would mangle components like 'issuer' to 'suer'.
39 1 1. scan : removed call to java/lang/Class::getMethods → KILLED
    for (Method method : clazz.getMethods()) {
40 8 1. scan : removed conditional - replaced equality check with false → KILLED
2. scan : removed conditional - replaced equality check with true → KILLED
3. scan : negated conditional → KILLED
4. scan : removed call to java/lang/reflect/Method::getAnnotation → KILLED
5. scan : removed conditional - replaced equality check with true → KILLED
6. scan : removed conditional - replaced equality check with false → KILLED
7. scan : negated conditional → KILLED
8. scan : removed call to java/lang/reflect/Method::getAnnotation → KILLED
      if (method.getAnnotation(Field.class) != null || method.getAnnotation(Fields.class) != null) {
41 7 1. scan : removed conditional - replaced equality check with false → SURVIVED
2. scan : removed call to java/lang/reflect/Method::getName → NO_COVERAGE
3. scan : negated conditional → KILLED
4. scan : removed conditional - replaced equality check with true → KILLED
5. scan : replaced call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix with argument → KILLED
6. scan : removed call to java/lang/reflect/Method::getName → KILLED
7. scan : removed call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix → KILLED
        String key = isJavaRecord ? method.getName() : stripMethodPrefix(method.getName());
42 3 1. scan : replaced call to java/util/LinkedHashMap::put with argument → KILLED
2. scan : removed call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationTarget::ofMethod → KILLED
3. scan : removed call to java/util/LinkedHashMap::put → KILLED
        targets.put(key, AnnotationTarget.ofMethod(method));
43
      }
44
    }
45
46
    // Pass 2: field annotations — walk class hierarchy. Skipped for records: a component
47
    // annotation propagates to both the accessor (pass 1 above) and the backing field, so
48
    // scanning the fields would only produce duplicates without resolvable get/is getters.
49 3 1. scan : removed conditional - replaced equality check with false → SURVIVED
2. scan : removed conditional - replaced equality check with true → KILLED
3. scan : negated conditional → KILLED
    if (isJavaRecord) {
50 3 1. scan : removed call to java/util/ArrayList::<init> → NO_COVERAGE
2. scan : replaced return value with Collections.emptyList for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::scan → NO_COVERAGE
3. scan : removed call to java/util/LinkedHashMap::values → NO_COVERAGE
      return new ArrayList<>(targets.values());
51
    }
52
    Class<?> current = clazz;
53 6 1. scan : removed conditional - replaced equality check with true → SURVIVED
2. scan : removed conditional - replaced equality check with true → SURVIVED
3. scan : removed conditional - replaced equality check with false → KILLED
4. scan : removed conditional - replaced equality check with false → KILLED
5. scan : negated conditional → KILLED
6. scan : negated conditional → KILLED
    while (current != null && current != Object.class) {
54 1 1. scan : removed call to java/lang/Class::getDeclaredFields → KILLED
      for (java.lang.reflect.Field javaField : current.getDeclaredFields()) {
55 8 1. scan : removed call to java/lang/reflect/Field::getAnnotation → SURVIVED
2. scan : removed conditional - replaced equality check with true → SURVIVED
3. scan : removed conditional - replaced equality check with false → KILLED
4. scan : negated conditional → KILLED
5. scan : removed call to java/lang/reflect/Field::getAnnotation → KILLED
6. scan : removed conditional - replaced equality check with false → KILLED
7. scan : negated conditional → KILLED
8. scan : removed conditional - replaced equality check with true → KILLED
        if (javaField.getAnnotation(Field.class) == null && javaField.getAnnotation(Fields.class) == null) {
56
          continue;
57
        }
58 1 1. scan : removed call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::findGetter → KILLED
        Method getter = findGetter(clazz, javaField);
59 3 1. scan : replaced call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix with argument → KILLED
2. scan : removed call to java/lang/reflect/Method::getName → KILLED
3. scan : removed call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix → KILLED
        String key = stripMethodPrefix(getter.getName());
60 4 1. scan : removed call to java/util/LinkedHashMap::containsKey → SURVIVED
2. scan : removed conditional - replaced equality check with true → SURVIVED
3. scan : negated conditional → SURVIVED
4. scan : removed conditional - replaced equality check with false → SURVIVED
        if (targets.containsKey(key)) {
61
          LOG.error("Configuration mismatch: @Field annotation found on both field '{}' and its getter method '{}' in class '{}'. The field annotation will be used.",
62 5 1. scan : removed call to java/lang/reflect/Method::getName → SURVIVED
2. scan : Substituted 1 with 0 → SURVIVED
3. scan : removed call to java/lang/reflect/Field::getName → SURVIVED
4. scan : removed call to java/lang/Class::getName → SURVIVED
5. scan : Substituted 2 with 3 → KILLED
              javaField.getName(), getter.getName(), clazz.getName());
63
        }
64 3 1. scan : replaced call to java/util/LinkedHashMap::put with argument → KILLED
2. scan : removed call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationTarget::ofField → KILLED
3. scan : removed call to java/util/LinkedHashMap::put → KILLED
        targets.put(key, AnnotationTarget.ofField(getter, javaField));
65
      }
66 2 1. scan : replaced call to java/lang/Class::getSuperclass with receiver → TIMED_OUT
2. scan : removed call to java/lang/Class::getSuperclass → KILLED
      current = current.getSuperclass();
67
    }
68
69 3 1. scan : removed call to java/util/ArrayList::<init> → KILLED
2. scan : removed call to java/util/LinkedHashMap::values → KILLED
3. scan : replaced return value with Collections.emptyList for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::scan → KILLED
    return new ArrayList<>(targets.values());
70
  }
71
72
  private Method findGetter(Class<?> clazz, java.lang.reflect.Field field) {
73 1 1. findGetter : removed call to java/lang/reflect/Field::getName → KILLED
    String name = field.getName();
74 7 1. findGetter : removed call to java/lang/Character::toUpperCase → KILLED
2. findGetter : Substituted 0 with 1 → KILLED
3. findGetter : removed call to java/lang/String::substring → KILLED
4. findGetter : replaced call to java/lang/Character::toUpperCase with argument → KILLED
5. findGetter : replaced call to java/lang/String::substring with receiver → KILLED
6. findGetter : Substituted 1 with 0 → KILLED
7. findGetter : removed call to java/lang/String::charAt → KILLED
    String cap = Character.toUpperCase(name.charAt(0)) + name.substring(1);
75
    try {
76 3 1. findGetter : replaced return value with null for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::findGetter → KILLED
2. findGetter : removed call to java/lang/Class::getMethod → KILLED
3. findGetter : Substituted 0 with 1 → KILLED
      return clazz.getMethod("get" + cap);
77
    } catch (NoSuchMethodException e) {
78
      try {
79 3 1. findGetter : Substituted 0 with 1 → SURVIVED
2. findGetter : replaced return value with null for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::findGetter → NO_COVERAGE
3. findGetter : removed call to java/lang/Class::getMethod → KILLED
        return clazz.getMethod("is" + cap);
80
      } catch (NoSuchMethodException e2) {
81 9 1. findGetter : removed call to java/lang/String::format → SURVIVED
2. findGetter : Substituted 2 with 3 → SURVIVED
3. findGetter : Substituted 0 with 1 → SURVIVED
4. findGetter : Substituted 4 with 5 → SURVIVED
5. findGetter : replaced call to java/lang/String::format with argument → SURVIVED
6. findGetter : Substituted 1 with 0 → SURVIVED
7. findGetter : removed call to java/lang/Class::getName → SURVIVED
8. findGetter : removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → KILLED
9. findGetter : Substituted 3 with 4 → KILLED
        throw new FixedFormatException(format("No getter found for field '%s' in class %s. Expected 'get%s()' or 'is%s()'.", name, clazz.getName(), cap, cap));
82
      }
83
    }
84
  }
85
86
  String stripMethodPrefix(String name) {
87 8 1. stripMethodPrefix : removed conditional - replaced equality check with false → SURVIVED
2. stripMethodPrefix : removed call to java/lang/String::startsWith → SURVIVED
3. stripMethodPrefix : removed call to java/lang/String::startsWith → KILLED
4. stripMethodPrefix : negated conditional → KILLED
5. stripMethodPrefix : removed conditional - replaced equality check with true → KILLED
6. stripMethodPrefix : removed conditional - replaced equality check with false → KILLED
7. stripMethodPrefix : negated conditional → KILLED
8. stripMethodPrefix : removed conditional - replaced equality check with true → KILLED
    if (name.startsWith("get") || name.startsWith("set")) {
88 4 1. stripMethodPrefix : Substituted 3 with 4 → KILLED
2. stripMethodPrefix : replaced call to java/lang/String::substring with receiver → KILLED
3. stripMethodPrefix : removed call to java/lang/String::substring → KILLED
4. stripMethodPrefix : replaced return value with "" for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix → KILLED
      return name.substring(3);
89 4 1. stripMethodPrefix : removed conditional - replaced equality check with true → SURVIVED
2. stripMethodPrefix : removed call to java/lang/String::startsWith → KILLED
3. stripMethodPrefix : removed conditional - replaced equality check with false → KILLED
4. stripMethodPrefix : negated conditional → KILLED
    } else if (name.startsWith("is")) {
90 4 1. stripMethodPrefix : Substituted 2 with 3 → KILLED
2. stripMethodPrefix : replaced call to java/lang/String::substring with receiver → KILLED
3. stripMethodPrefix : removed call to java/lang/String::substring → KILLED
4. stripMethodPrefix : replaced return value with "" for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix → KILLED
      return name.substring(2);
91
    } else {
92 1 1. stripMethodPrefix : replaced return value with "" for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix → NO_COVERAGE
      return name;
93
    }
94
  }
95
}

Mutations

34

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed call to java/util/LinkedHashMap::<init> → KILLED

35

1.1
Location : scan
Killed by : none
removed call to com/ancientprogramming/fixedformat4j/format/impl/JavaRecordSupport::isJavaRecord → SURVIVED
Covering tests

39

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed call to java/lang/Class::getMethods → KILLED

40

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed conditional - replaced equality check with false → KILLED

2.2
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_methodAnnotation_returnsTarget()]
removed conditional - replaced equality check with true → KILLED

3.3
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
negated conditional → KILLED

4.4
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_methodAnnotation_returnsTarget()]
removed call to java/lang/reflect/Method::getAnnotation → KILLED

5.5
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed conditional - replaced equality check with true → KILLED

6.6
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed conditional - replaced equality check with false → KILLED

7.7
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
negated conditional → KILLED

8.8
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed call to java/lang/reflect/Method::getAnnotation → KILLED

41

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldAndMethodAnnotation_fieldTakesPriority()]
negated conditional → KILLED

2.2
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldAndMethodAnnotation_fieldTakesPriority()]
removed conditional - replaced equality check with true → KILLED

3.3
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldAndMethodAnnotation_fieldTakesPriority()]
replaced call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix with argument → KILLED

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

5.5
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed call to java/lang/reflect/Method::getName → KILLED

6.6
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldAndMethodAnnotation_fieldTakesPriority()]
removed call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix → KILLED

7.7
Location : scan
Killed by : none
removed call to java/lang/reflect/Method::getName → NO_COVERAGE

42

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
replaced call to java/util/LinkedHashMap::put with argument → KILLED

2.2
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationTarget::ofMethod → KILLED

3.3
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed call to java/util/LinkedHashMap::put → KILLED

49

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed conditional - replaced equality check with true → KILLED

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

3.3
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
negated conditional → KILLED

50

1.1
Location : scan
Killed by : none
removed call to java/util/ArrayList::<init> → NO_COVERAGE

2.2
Location : scan
Killed by : none
replaced return value with Collections.emptyList for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::scan → NO_COVERAGE

3.3
Location : scan
Killed by : none
removed call to java/util/LinkedHashMap::values → NO_COVERAGE

53

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

2.2
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed conditional - replaced equality check with false → KILLED

3.3
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed conditional - replaced equality check with false → KILLED

4.4
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
negated conditional → KILLED

5.5
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
negated conditional → KILLED

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

54

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed call to java/lang/Class::getDeclaredFields → KILLED

55

1.1
Location : scan
Killed by : none
removed call to java/lang/reflect/Field::getAnnotation → SURVIVED
Covering tests

2.2
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed conditional - replaced equality check with false → KILLED

3.3
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
negated conditional → KILLED

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

5.5
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to java/lang/reflect/Field::getAnnotation → KILLED

6.6
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed conditional - replaced equality check with false → KILLED

7.7
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
negated conditional → KILLED

8.8
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed conditional - replaced equality check with true → KILLED

58

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::findGetter → KILLED

59

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldAndMethodAnnotation_fieldTakesPriority()]
replaced call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix with argument → KILLED

2.2
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to java/lang/reflect/Method::getName → KILLED

3.3
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix → KILLED

60

1.1
Location : scan
Killed by : none
removed call to java/util/LinkedHashMap::containsKey → SURVIVED
Covering tests

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

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

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

62

1.1
Location : scan
Killed by : none
removed call to java/lang/reflect/Method::getName → SURVIVED
Covering tests

2.2
Location : scan
Killed by : none
Substituted 1 with 0 → SURVIVED Covering tests

3.3
Location : scan
Killed by : none
removed call to java/lang/reflect/Field::getName → SURVIVED Covering tests

4.4
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldAndMethodAnnotation_fieldTakesPriority()]
Substituted 2 with 3 → KILLED

5.5
Location : scan
Killed by : none
removed call to java/lang/Class::getName → SURVIVED Covering tests

64

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
replaced call to java/util/LinkedHashMap::put with argument → KILLED

2.2
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to com/ancientprogramming/fixedformat4j/format/impl/AnnotationTarget::ofField → KILLED

3.3
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to java/util/LinkedHashMap::put → KILLED

66

1.1
Location : scan
Killed by : none
replaced call to java/lang/Class::getSuperclass with receiver → TIMED_OUT

2.2
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_superclassFields_included()]
removed call to java/lang/Class::getSuperclass → KILLED

69

1.1
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed call to java/util/ArrayList::<init> → KILLED

2.2
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
removed call to java/util/LinkedHashMap::values → KILLED

3.3
Location : scan
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_fieldsAnnotation_returnsTarget()]
replaced return value with Collections.emptyList for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::scan → KILLED

73

1.1
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to java/lang/reflect/Field::getName → KILLED

74

1.1
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to java/lang/Character::toUpperCase → KILLED

2.2
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
Substituted 0 with 1 → KILLED

3.3
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to java/lang/String::substring → KILLED

4.4
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
replaced call to java/lang/Character::toUpperCase with argument → KILLED

5.5
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
replaced call to java/lang/String::substring with receiver → KILLED

6.6
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
Substituted 1 with 0 → KILLED

7.7
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to java/lang/String::charAt → KILLED

76

1.1
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
replaced return value with null for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::findGetter → KILLED

2.2
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to java/lang/Class::getMethod → KILLED

3.3
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
Substituted 0 with 1 → KILLED

79

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

2.2
Location : findGetter
Killed by : none
replaced return value with null for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::findGetter → NO_COVERAGE

3.3
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.issues.TestLombokFieldAnnotations.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestLombokFieldAnnotations]/[method:testNoGetter_throwsFixedFormatException()]
removed call to java/lang/Class::getMethod → KILLED

81

1.1
Location : findGetter
Killed by : none
removed call to java/lang/String::format → SURVIVED
Covering tests

2.2
Location : findGetter
Killed by : none
Substituted 2 with 3 → SURVIVED Covering tests

3.3
Location : findGetter
Killed by : none
Substituted 0 with 1 → SURVIVED Covering tests

4.4
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.issues.TestLombokFieldAnnotations.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestLombokFieldAnnotations]/[method:testNoGetter_throwsFixedFormatException()]
removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → KILLED

5.5
Location : findGetter
Killed by : none
Substituted 4 with 5 → SURVIVED Covering tests

6.6
Location : findGetter
Killed by : com.ancientprogramming.fixedformat4j.issues.TestLombokFieldAnnotations.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestLombokFieldAnnotations]/[method:testNoGetter_throwsFixedFormatException()]
Substituted 3 with 4 → KILLED

7.7
Location : findGetter
Killed by : none
replaced call to java/lang/String::format with argument → SURVIVED Covering tests

8.8
Location : findGetter
Killed by : none
Substituted 1 with 0 → SURVIVED Covering tests

9.9
Location : findGetter
Killed by : none
removed call to java/lang/Class::getName → SURVIVED Covering tests

87

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

2.2
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestIntrospection.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestIntrospection]/[method:exposesPropertyNameOffsetLengthAndDataTypePerField()]
removed call to java/lang/String::startsWith → KILLED

3.3
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache]/[method:eachSimpleFieldDescriptorHasNonNullMetadata()]
negated conditional → KILLED

4.4
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestIntrospection.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestIntrospection]/[method:exposesPropertyNameOffsetLengthAndDataTypePerField()]
removed conditional - replaced equality check with true → KILLED

5.5
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache]/[method:eachSimpleFieldDescriptorHasNonNullMetadata()]
removed conditional - replaced equality check with false → KILLED

6.6
Location : stripMethodPrefix
Killed by : none
removed call to java/lang/String::startsWith → SURVIVED Covering tests

7.7
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestIntrospection.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestIntrospection]/[method:exposesPropertyNameOffsetLengthAndDataTypePerField()]
negated conditional → KILLED

8.8
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache]/[method:eachSimpleFieldDescriptorHasNonNullMetadata()]
removed conditional - replaced equality check with true → KILLED

88

1.1
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestIntrospection.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestIntrospection]/[method:exposesPropertyNameOffsetLengthAndDataTypePerField()]
Substituted 3 with 4 → KILLED

2.2
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestIntrospection.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestIntrospection]/[method:exposesPropertyNameOffsetLengthAndDataTypePerField()]
replaced call to java/lang/String::substring with receiver → KILLED

3.3
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
removed call to java/lang/String::substring → KILLED

4.4
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestAnnotationScanner]/[method:scan_orderPreserved()]
replaced return value with "" for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix → KILLED

89

1.1
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache]/[method:eachSimpleFieldDescriptorHasNonNullMetadata()]
removed call to java/lang/String::startsWith → KILLED

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

3.3
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache]/[method:eachSimpleFieldDescriptorHasNonNullMetadata()]
removed conditional - replaced equality check with false → KILLED

4.4
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache]/[method:eachSimpleFieldDescriptorHasNonNullMetadata()]
negated conditional → KILLED

90

1.1
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache]/[method:eachSimpleFieldDescriptorHasNonNullMetadata()]
Substituted 2 with 3 → KILLED

2.2
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache]/[method:eachSimpleFieldDescriptorHasNonNullMetadata()]
replaced call to java/lang/String::substring with receiver → KILLED

3.3
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache]/[method:eachSimpleFieldDescriptorHasNonNullMetadata()]
removed call to java/lang/String::substring → KILLED

4.4
Location : stripMethodPrefix
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestClassMetadataCache]/[method:eachSimpleFieldDescriptorHasNonNullMetadata()]
replaced return value with "" for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix → KILLED

92

1.1
Location : stripMethodPrefix
Killed by : none
replaced return value with "" for com/ancientprogramming/fixedformat4j/format/impl/AnnotationScanner::stripMethodPrefix → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.23.1 support