EnumFormatter.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.format.impl;
17
18
import com.ancientprogramming.fixedformat4j.annotation.EnumFormat;
19
import com.ancientprogramming.fixedformat4j.exception.FixedFormatException;
20
import com.ancientprogramming.fixedformat4j.format.AbstractFixedFormatter;
21
import com.ancientprogramming.fixedformat4j.format.FormatContext;
22
import com.ancientprogramming.fixedformat4j.format.FormatInstructions;
23
import com.ancientprogramming.fixedformat4j.format.data.FixedFormatEnumData;
24
25
/**
26
 * Formatter for Java enum types.
27
 *
28
 * <p>Supports two serialization modes controlled by {@code @FixedFormatEnum}:
29
 * <ul>
30
 *   <li>{@link EnumFormat#LITERAL} (default) — uses {@link Enum#name()} / {@link Enum#valueOf}</li>
31
 *   <li>{@link EnumFormat#NUMERIC} — uses {@link Enum#ordinal()} / index lookup</li>
32
 * </ul>
33
 *
34
 * <p>Padding is handled by the {@link AbstractFixedFormatter} base class using the field's
35
 * configured {@code paddingChar} and {@code align}. This formatter receives a padding-stripped
36
 * value in {@link #asObject} and must not apply additional whitespace-specific trimming,
37
 * so non-space padding characters (e.g. {@code '*'}, {@code '0'}) are handled correctly.
38
 *
39
 * @author Jacob von Eyben - <a href="https://eybenconsult.com">https://eybenconsult.com</a>
40
 * @since 1.7.0
41
 */
42
public class EnumFormatter extends AbstractFixedFormatter<Enum> {
43
44
  private final FormatContext<?> context;
45
46
  /**
47
   * Creates an {@code EnumFormatter} bound to the given format context.
48
   * The context's data type must be an enum class.
49
   *
50
   * @param context the format context describing the field's data type
51
   */
52
  public EnumFormatter(FormatContext<?> context) {
53 1 1. <init> : Removed assignment to member variable context → KILLED
    this.context = context;
54
  }
55
56
  /**
57
   * {@inheritDoc}
58
   *
59
   * <p>The {@code value} received here has already had its padding stripped by
60
   * {@link AbstractFixedFormatter#parse} using the field's actual {@code paddingChar},
61
   * so no additional trimming is performed.
62
   */
63
  @SuppressWarnings({"unchecked", "rawtypes"})
64
  @Override
65
  public Enum asObject(String value, FormatInstructions instructions) {
66 7 1. asObject : removed conditional - replaced equality check with true → SURVIVED
2. asObject : negated conditional → KILLED
3. asObject : removed call to java/lang/String::isEmpty → KILLED
4. asObject : removed conditional - replaced equality check with false → KILLED
5. asObject : removed conditional - replaced equality check with false → KILLED
6. asObject : removed conditional - replaced equality check with true → KILLED
7. asObject : negated conditional → KILLED
    if (value == null || value.isEmpty()) {
67
      return null;
68
    }
69 1 1. asObject : removed call to com/ancientprogramming/fixedformat4j/format/FormatContext::getDataType → KILLED
    Class<? extends Enum> enumClass = (Class<? extends Enum>) context.getDataType();
70 1 1. asObject : removed call to com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::enumFormat → KILLED
    EnumFormat format = enumFormat(instructions);
71 3 1. asObject : removed conditional - replaced equality check with true → KILLED
2. asObject : negated conditional → KILLED
3. asObject : removed conditional - replaced equality check with false → KILLED
    if (format == EnumFormat.NUMERIC) {
72
      int ordinal;
73
      try {
74 1 1. asObject : removed call to java/lang/Integer::parseInt → KILLED
        ordinal = Integer.parseInt(value);
75
      } catch (NumberFormatException e) {
76 2 1. asObject : Substituted 2 with 3 → SURVIVED
2. asObject : Substituted 0 with 1 → KILLED
        throw new FixedFormatException(
77 5 1. asObject : removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → KILLED
2. asObject : removed call to java/lang/String::format → KILLED
3. asObject : replaced call to java/lang/String::format with argument → KILLED
4. asObject : Substituted 1 with 0 → KILLED
5. asObject : removed call to java/lang/Class::getName → KILLED
            String.format("Cannot parse ordinal for enum [%s] from value [%s]", enumClass.getName(), value), e);
78
      }
79 1 1. asObject : removed call to java/lang/Class::getEnumConstants → KILLED
      Enum<?>[] constants = enumClass.getEnumConstants();
80 8 1. asObject : changed conditional boundary → SURVIVED
2. asObject : removed conditional - replaced comparison check with false → KILLED
3. asObject : removed conditional - replaced comparison check with false → KILLED
4. asObject : changed conditional boundary → KILLED
5. asObject : removed conditional - replaced comparison check with true → KILLED
6. asObject : removed conditional - replaced comparison check with true → KILLED
7. asObject : negated conditional → KILLED
8. asObject : negated conditional → KILLED
      if (ordinal < 0 || ordinal >= constants.length) {
81 2 1. asObject : Substituted 3 with 4 → SURVIVED
2. asObject : Substituted 0 with 1 → KILLED
        throw new FixedFormatException(
82 10 1. asObject : Replaced integer subtraction with addition → SURVIVED
2. asObject : removed call to java/lang/Class::getName → SURVIVED
3. asObject : removed call to java/lang/Integer::valueOf → SURVIVED
4. asObject : Substituted 1 with 0 → SURVIVED
5. asObject : removed call to java/lang/Integer::valueOf → KILLED
6. asObject : Substituted 2 with 3 → KILLED
7. asObject : Substituted 1 with 0 → KILLED
8. asObject : replaced call to java/lang/String::format with argument → KILLED
9. asObject : removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → KILLED
10. asObject : removed call to java/lang/String::format → KILLED
            String.format("Ordinal [%d] is out of range for enum [%s] (valid range: 0..%d)", ordinal, enumClass.getName(), constants.length - 1));
83
      }
84 1 1. asObject : replaced return value with null for com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::asObject → KILLED
      return constants[ordinal];
85
    } else {
86
      try {
87 2 1. asObject : removed call to java/lang/Enum::valueOf → KILLED
2. asObject : replaced return value with null for com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::asObject → KILLED
        return Enum.valueOf(enumClass, value);
88
      } catch (IllegalArgumentException e) {
89 3 1. asObject : Substituted 2 with 3 → SURVIVED
2. asObject : Substituted 1 with 0 → KILLED
3. asObject : Substituted 0 with 1 → KILLED
        throw new FixedFormatException(
90 4 1. asObject : removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → KILLED
2. asObject : removed call to java/lang/String::format → KILLED
3. asObject : replaced call to java/lang/String::format with argument → KILLED
4. asObject : removed call to java/lang/Class::getName → KILLED
            String.format("Cannot find enum constant [%s] in [%s]", value, enumClass.getName()), e);
91
      }
92
    }
93
  }
94
95
  /** {@inheritDoc} */
96
  @Override
97
  public String asString(Enum value, FormatInstructions instructions) {
98 3 1. asString : negated conditional → KILLED
2. asString : removed conditional - replaced equality check with true → KILLED
3. asString : removed conditional - replaced equality check with false → KILLED
    if (value == null) {
99
      return "";
100
    }
101 5 1. asString : negated conditional → KILLED
2. asString : removed call to com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::enumFormat → KILLED
3. asString : removed conditional - replaced equality check with true → KILLED
4. asString : removed conditional - replaced equality check with false → KILLED
5. asString : replaced return value with "" for com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::asString → KILLED
    return enumFormat(instructions) == EnumFormat.NUMERIC
102 2 1. asString : removed call to java/lang/String::valueOf → KILLED
2. asString : removed call to java/lang/Enum::ordinal → KILLED
        ? String.valueOf(value.ordinal())
103 1 1. asString : removed call to java/lang/Enum::name → KILLED
        : value.name();
104
  }
105
106
  private EnumFormat enumFormat(FormatInstructions instructions) {
107 1 1. enumFormat : removed call to com/ancientprogramming/fixedformat4j/format/FormatInstructions::getFixedFormatEnumData → KILLED
    FixedFormatEnumData data = instructions.getFixedFormatEnumData();
108 5 1. enumFormat : removed conditional - replaced equality check with true → SURVIVED
2. enumFormat : removed conditional - replaced equality check with false → KILLED
3. enumFormat : removed call to com/ancientprogramming/fixedformat4j/format/data/FixedFormatEnumData::getEnumFormat → KILLED
4. enumFormat : negated conditional → KILLED
5. enumFormat : replaced return value with null for com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::enumFormat → KILLED
    return (data != null) ? data.getEnumFormat() : EnumFormat.LITERAL;
109
  }
110
}

Mutations

53

1.1
Location : <init>
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nonNumericOrdinal_throwsFixedFormatException()]
Removed assignment to member variable context → KILLED

66

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

2.2
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:allPaddingInput_literal_parsesToNull()]
removed call to java/lang/String::isEmpty → KILLED

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

4.4
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nonNumericOrdinal_throwsFixedFormatException()]
removed conditional - replaced equality check with false → KILLED

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

6.6
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nonNumericOrdinal_throwsFixedFormatException()]
negated conditional → KILLED

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

69

1.1
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nonNumericOrdinal_throwsFixedFormatException()]
removed call to com/ancientprogramming/fixedformat4j/format/FormatContext::getDataType → KILLED

70

1.1
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:outOfRangeOrdinal_positive_exceptionMessageMentionsOutOfRange()]
removed call to com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::enumFormat → KILLED

71

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

2.2
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nullEnumData_defaultsToLiteralBehavior_parse()]
negated conditional → KILLED

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

74

1.1
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nonNumericOrdinal_throwsFixedFormatException()]
removed call to java/lang/Integer::parseInt → KILLED

76

1.1
Location : asObject
Killed by : none
Substituted 2 with 3 → SURVIVED
Covering tests

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

77

1.1
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nonNumericOrdinal_throwsFixedFormatException()]
removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → KILLED

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

3.3
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nonNumericOrdinal_exceptionMessageMentionsCannotParseOrdinal()]
replaced call to java/lang/String::format with argument → KILLED

4.4
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nonNumericOrdinal_exceptionMessageMentionsCannotParseOrdinal()]
Substituted 1 with 0 → KILLED

5.5
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nonNumericOrdinal_exceptionMessageMentionsCannotParseOrdinal()]
removed call to java/lang/Class::getName → KILLED

79

1.1
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:outOfRangeOrdinal_positive_throwsFixedFormatException()]
removed call to java/lang/Class::getEnumConstants → KILLED

80

1.1
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:outOfRangeOrdinal_positive_throwsFixedFormatException()]
removed conditional - replaced comparison check with false → KILLED

2.2
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:rightAlignedNumericParse_stripsLeadingSpaces()]
removed conditional - replaced comparison check with false → KILLED

3.3
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:numericParse_ordinalZeroIsRed()]
changed conditional boundary → KILLED

4.4
Location : asObject
Killed by : none
changed conditional boundary → SURVIVED
Covering tests

5.5
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:rightAlignedNumericParse_stripsLeadingSpaces()]
removed conditional - replaced comparison check with true → KILLED

6.6
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:outOfRangeOrdinal_negative_exceptionMessageMentionsOutOfRange()]
removed conditional - replaced comparison check with true → KILLED

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

8.8
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:outOfRangeOrdinal_positive_throwsFixedFormatException()]
negated conditional → KILLED

81

1.1
Location : asObject
Killed by : none
Substituted 3 with 4 → SURVIVED
Covering tests

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

82

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

2.2
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:outOfRangeOrdinal_positive_exceptionMessageMentionsOutOfRange()]
removed call to java/lang/Integer::valueOf → KILLED

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

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

5.5
Location : asObject
Killed by : none
removed call to java/lang/Integer::valueOf → SURVIVED Covering tests

6.6
Location : asObject
Killed by : none
Substituted 1 with 0 → SURVIVED Covering tests

7.7
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:outOfRangeOrdinal_positive_throwsFixedFormatException()]
Substituted 1 with 0 → KILLED

8.8
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:outOfRangeOrdinal_positive_exceptionMessageMentionsOutOfRange()]
replaced call to java/lang/String::format with argument → KILLED

9.9
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:outOfRangeOrdinal_positive_throwsFixedFormatException()]
removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → KILLED

10.10
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:outOfRangeOrdinal_negative_exceptionMessageMentionsOutOfRange()]
removed call to java/lang/String::format → KILLED

84

1.1
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:numericParse_ordinalOneIsGreen()]
replaced return value with null for com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::asObject → KILLED

87

1.1
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nullEnumData_defaultsToLiteralBehavior_parse()]
removed call to java/lang/Enum::valueOf → KILLED

2.2
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nullEnumData_defaultsToLiteralBehavior_parse()]
replaced return value with null for com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::asObject → KILLED

89

1.1
Location : asObject
Killed by : none
Substituted 2 with 3 → SURVIVED
Covering tests

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

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

90

1.1
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:unknownLiteralName_throwsFixedFormatException()]
removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → KILLED

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

3.3
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:unknownLiteralName_exceptionMessageContainsBadValue()]
replaced call to java/lang/String::format with argument → KILLED

4.4
Location : asObject
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:unknownLiteralName_exceptionMessageContainsEnumClassName()]
removed call to java/lang/Class::getName → KILLED

98

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

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

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

101

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

2.2
Location : asString
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:numericFormat_blueIsOrdinalTwo()]
removed call to com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::enumFormat → KILLED

3.3
Location : asString
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nullEnumData_defaultsToLiteralBehavior_format()]
removed conditional - replaced equality check with true → KILLED

4.4
Location : asString
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:numericFormat_blueIsOrdinalTwo()]
removed conditional - replaced equality check with false → KILLED

5.5
Location : asString
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nullEnumData_defaultsToLiteralBehavior_format()]
replaced return value with "" for com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::asString → KILLED

102

1.1
Location : asString
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:numericFormat_blueIsOrdinalTwo()]
removed call to java/lang/String::valueOf → KILLED

2.2
Location : asString
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:numericFormat_blueIsOrdinalTwo()]
removed call to java/lang/Enum::ordinal → KILLED

103

1.1
Location : asString
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:nullEnumData_defaultsToLiteralBehavior_format()]
removed call to java/lang/Enum::name → KILLED

107

1.1
Location : enumFormat
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:numericFormat_redIsOrdinalZero()]
removed call to com/ancientprogramming/fixedformat4j/format/FormatInstructions::getFixedFormatEnumData → KILLED

108

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

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

3.3
Location : enumFormat
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:numericFormat_redIsOrdinalZero()]
removed call to com/ancientprogramming/fixedformat4j/format/data/FixedFormatEnumData::getEnumFormat → KILLED

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

5.5
Location : enumFormat
Killed by : com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.impl.TestEnumFormatter]/[method:numericFormat_redIsOrdinalZero()]
replaced return value with null for com/ancientprogramming/fixedformat4j/format/impl/EnumFormatter::enumFormat → KILLED

Active mutators

Tests examined


Report generated by PIT 1.23.1 support