FixedFormatUtil.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;
17
18
import com.ancientprogramming.fixedformat4j.exception.FixedFormatException;
19
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21
22
import static java.lang.String.format;
23
24
/**
25
 * Utility class used when loading and exporting to and from fixedformat data.
26
 *
27
 * @author Jacob von Eyben - <a href="https://eybenconsult.com">https://eybenconsult.com</a>
28
 * @since 1.0.0
29
 */
30
public class FixedFormatUtil {
31
32
  private static final Logger LOG = LoggerFactory.getLogger(FixedFormatUtil.class);
33
34
  /**
35
   * Fetches the slice of {@code record} that corresponds to the field described by
36
   * {@code instructions} and {@code context}.
37
   *
38
   * @param record       the full fixed-width record string
39
   * @param instructions the field's formatting instructions (supplies the field length)
40
   * @param context      the format context (supplies the 1-based field offset)
41
   * @return the extracted field substring, or {@code null} if {@code record} is shorter than
42
   * the requested offset
43
   */
44
  public static String fetchData(String record, FormatInstructions instructions, FormatContext<?> context) {
45
    String result;
46 3 1. fetchData : Substituted 1 with 0 → KILLED
2. fetchData : removed call to com/ancientprogramming/fixedformat4j/format/FormatContext::getOffset → KILLED
3. fetchData : Replaced integer subtraction with addition → KILLED
    int offset = context.getOffset() - 1;
47 1 1. fetchData : removed call to com/ancientprogramming/fixedformat4j/format/FormatInstructions::getLength → KILLED
    int length = instructions.getLength();
48 4 1. fetchData : negated conditional → KILLED
2. fetchData : removed conditional - replaced equality check with false → KILLED
3. fetchData : Substituted -1 with 0 → KILLED
4. fetchData : removed conditional - replaced equality check with true → KILLED
    if (length == -1) {
49
      // rest-of-line: capture from offset to end of line verbatim
50 5 1. fetchData : removed conditional - replaced comparison check with false → KILLED
2. fetchData : removed conditional - replaced comparison check with true → KILLED
3. fetchData : negated conditional → KILLED
4. fetchData : changed conditional boundary → KILLED
5. fetchData : removed call to java/lang/String::length → KILLED
      if (offset <= record.length()) {
51 2 1. fetchData : removed call to java/lang/String::substring → KILLED
2. fetchData : replaced call to java/lang/String::substring with receiver → KILLED
        result = record.substring(offset);
52
      } else {
53
        result = null;
54
        LOG.debug("Could not fetch rest-of-line data: recordlength[{}] is shorter than the requested offset[{}]. Returning null", record.length(), offset);
55
      }
56
      LOG.debug("fetched '{}' from record", result);
57 1 1. fetchData : replaced return value with "" for com/ancientprogramming/fixedformat4j/format/FixedFormatUtil::fetchData → KILLED
      return result;
58
    }
59 6 1. fetchData : changed conditional boundary → SURVIVED
2. fetchData : removed call to java/lang/String::length → KILLED
3. fetchData : removed conditional - replaced comparison check with false → KILLED
4. fetchData : negated conditional → KILLED
5. fetchData : Replaced integer addition with subtraction → KILLED
6. fetchData : removed conditional - replaced comparison check with true → KILLED
    if (record.length() >= offset + length) {
60 3 1. fetchData : removed call to java/lang/String::substring → KILLED
2. fetchData : replaced call to java/lang/String::substring with receiver → KILLED
3. fetchData : Replaced integer addition with subtraction → KILLED
      result = record.substring(offset, offset + length);
61 5 1. fetchData : removed conditional - replaced comparison check with true → KILLED
2. fetchData : negated conditional → KILLED
3. fetchData : removed call to java/lang/String::length → KILLED
4. fetchData : changed conditional boundary → KILLED
5. fetchData : removed conditional - replaced comparison check with false → KILLED
    } else if (record.length() > offset) {
62
      //the field does contain data, but is not as long as the instructions tells.
63 2 1. fetchData : replaced call to java/lang/String::substring with receiver → KILLED
2. fetchData : removed call to java/lang/String::substring → KILLED
      result = record.substring(offset);
64
      LOG.debug("The record field was not as long as expected by the instructions. Expected field to be {} long but it was {}.", length, record.length());
65
    } else {
66
      result = null;
67
      LOG.debug("Could not fetch data from record as the recordlength[{}] was shorter than or equal to the requested offset[{}] of the request data. Returning null", record.length(), offset);
68
    }
69
    LOG.debug("fetched '{}' from record", result);
70 1 1. fetchData : replaced return value with "" for com/ancientprogramming/fixedformat4j/format/FixedFormatUtil::fetchData → KILLED
    return result;
71
  }
72
73
  /**
74
   * Creates an instance of the given {@code formatterClass}, first trying a single-argument
75
   * constructor that accepts a {@link FormatContext}, then falling back to a no-arg constructor.
76
   *
77
   * @param formatterClass the formatter class to instantiate
78
   * @param context        the {@link FormatContext} passed to the single-argument constructor attempt
79
   * @param <T>            the value type handled by the formatter
80
   * @return a ready-to-use formatter instance
81
   * @throws FixedFormatException if neither constructor is available
82
   */
83
  public static <T> FixedFormatter<T> getFixedFormatterInstance(Class<? extends FixedFormatter<T>> formatterClass, FormatContext<?> context) {
84 2 1. getFixedFormatterInstance : removed call to java/lang/Object::getClass → KILLED
2. getFixedFormatterInstance : removed call to com/ancientprogramming/fixedformat4j/format/FixedFormatUtil::getFixedFormatterInstance → KILLED
    FixedFormatter<T> formatter = getFixedFormatterInstance(formatterClass, context.getClass(), context);
85 3 1. getFixedFormatterInstance : negated conditional → KILLED
2. getFixedFormatterInstance : removed conditional - replaced equality check with true → KILLED
3. getFixedFormatterInstance : removed conditional - replaced equality check with false → KILLED
    if (formatter == null) {
86 1 1. getFixedFormatterInstance : removed call to com/ancientprogramming/fixedformat4j/format/FixedFormatUtil::getFixedFormatterInstance → KILLED
      formatter = getFixedFormatterInstance(formatterClass, null, null);
87
    }
88 3 1. getFixedFormatterInstance : removed conditional - replaced equality check with false → KILLED
2. getFixedFormatterInstance : removed conditional - replaced equality check with true → KILLED
3. getFixedFormatterInstance : negated conditional → KILLED
    if (formatter == null) {
89 8 1. getFixedFormatterInstance : Substituted 1 with 0 → SURVIVED
2. getFixedFormatterInstance : Substituted 2 with 3 → SURVIVED
3. getFixedFormatterInstance : Substituted 0 with 1 → SURVIVED
4. getFixedFormatterInstance : removed call to java/lang/String::format → SURVIVED
5. getFixedFormatterInstance : removed call to java/lang/Class::getName → SURVIVED
6. getFixedFormatterInstance : replaced call to java/lang/String::format with argument → SURVIVED
7. getFixedFormatterInstance : removed call to java/lang/Class::getName → SURVIVED
8. getFixedFormatterInstance : removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → KILLED
      throw new FixedFormatException(format("could not create instance of [%s] because the class has no default constructor and no constructor with %s as argument.", formatterClass.getName(), FormatContext.class.getName()));
90
    }
91 1 1. getFixedFormatterInstance : replaced return value with null for com/ancientprogramming/fixedformat4j/format/FixedFormatUtil::getFixedFormatterInstance → KILLED
    return formatter;
92
  }
93
94
  /**
95
   * Creates an instance of {@code formatterClass} using either a single-argument constructor
96
   * (when both {@code paramType} and {@code paramValue} are non-null) or a no-arg constructor.
97
   * Returns {@code null} when the requested constructor does not exist.
98
   *
99
   * @param formatterClass the formatter class to instantiate
100
   * @param paramType      the constructor parameter type; {@code null} to force the no-arg path
101
   * @param paramValue     the constructor argument value; {@code null} to force the no-arg path
102
   * @param <T>            the value type handled by the formatter
103
   * @return a formatter instance, or {@code null} if the matching constructor is absent
104
   * @throws FixedFormatException if a matching constructor exists but instantiation fails
105
   */
106
  public static <T> FixedFormatter<T> getFixedFormatterInstance(Class<? extends FixedFormatter<T>> formatterClass, Class<?> paramType, FormatContext<?> paramValue) {
107
    FixedFormatter<T> result;
108 6 1. getFixedFormatterInstance : removed conditional - replaced equality check with true → SURVIVED
2. getFixedFormatterInstance : removed conditional - replaced equality check with true → SURVIVED
3. getFixedFormatterInstance : removed conditional - replaced equality check with false → KILLED
4. getFixedFormatterInstance : negated conditional → KILLED
5. getFixedFormatterInstance : removed conditional - replaced equality check with false → KILLED
6. getFixedFormatterInstance : negated conditional → KILLED
    if (paramType != null && paramValue != null) {
109
      try {
110 6 1. getFixedFormatterInstance : Substituted 0 with 1 → KILLED
2. getFixedFormatterInstance : removed call to java/lang/reflect/Constructor::newInstance → KILLED
3. getFixedFormatterInstance : removed call to java/lang/Class::getConstructor → KILLED
4. getFixedFormatterInstance : Substituted 1 with 0 → KILLED
5. getFixedFormatterInstance : Substituted 1 with 0 → KILLED
6. getFixedFormatterInstance : Substituted 0 with 1 → KILLED
        result = formatterClass.getConstructor(paramType).newInstance(paramValue);
111
      } catch (NoSuchMethodException e) {
112
        result = null;
113
      } catch (Exception e) {
114 1 1. getFixedFormatterInstance : removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → NO_COVERAGE
        throw new FixedFormatException("Could not create instance with one argument constructor", e);
115
      }
116
    } else {
117
      try {
118 4 1. getFixedFormatterInstance : removed call to java/lang/reflect/Constructor::newInstance → KILLED
2. getFixedFormatterInstance : Substituted 0 with 1 → KILLED
3. getFixedFormatterInstance : Substituted 0 with 1 → KILLED
4. getFixedFormatterInstance : removed call to java/lang/Class::getConstructor → KILLED
        result = formatterClass.getConstructor().newInstance();
119
      } catch (NoSuchMethodException e) {
120
        result = null;
121
      } catch (Exception e) {
122 1 1. getFixedFormatterInstance : removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → NO_COVERAGE
        throw new FixedFormatException("Could not create instance with no arg constructor", e);
123
      }
124
    }
125
    return result;
126
  }
127
}

Mutations

46

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_firstField_offset1()]
Substituted 1 with 0 → KILLED

2.2
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_firstField_offset1()]
removed call to com/ancientprogramming/fixedformat4j/format/FormatContext::getOffset → KILLED

3.3
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_firstField_offset1()]
Replaced integer subtraction with addition → KILLED

47

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_firstField_offset1()]
removed call to com/ancientprogramming/fixedformat4j/format/FormatInstructions::getLength → KILLED

48

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_firstField_offset1()]
negated conditional → KILLED

2.2
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine]/[method:load_restOfLineFromOffset1_emptyLineYieldsEmptyString()]
removed conditional - replaced equality check with false → KILLED

3.3
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine]/[method:load_restOfLineFromOffset1_emptyLineYieldsEmptyString()]
Substituted -1 with 0 → KILLED

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

50

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine]/[method:load_restOfLineFromOffset1_emptyLineYieldsEmptyString()]
removed conditional - replaced comparison check with false → KILLED

2.2
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine]/[method:load_restOfLine_nullWhenOffsetBeyondEndOfLine()]
removed conditional - replaced comparison check with true → KILLED

3.3
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine]/[method:load_restOfLineFromOffset1_emptyLineYieldsEmptyString()]
negated conditional → KILLED

4.4
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine]/[method:load_restOfLineFromOffset1_emptyLineYieldsEmptyString()]
changed conditional boundary → KILLED

5.5
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine]/[method:load_restOfLine_emptyStringWhenOffsetExactlyAtEndOfLine()]
removed call to java/lang/String::length → KILLED

51

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine]/[method:load_restOfLineFromOffset1_emptyLineYieldsEmptyString()]
removed call to java/lang/String::substring → KILLED

2.2
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine]/[method:load_restOfLine_emptyStringWhenOffsetExactlyAtEndOfLine()]
replaced call to java/lang/String::substring with receiver → KILLED

57

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.issues.TestIssue97RestOfLine]/[method:load_restOfLineFromOffset1_capturesEntireLine()]
replaced return value with "" for com/ancientprogramming/fixedformat4j/format/FixedFormatUtil::fetchData → KILLED

59

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_firstField_offset1()]
removed call to java/lang/String::length → KILLED

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

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

4.4
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_firstField_offset1()]
negated conditional → KILLED

5.5
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_offsetBeyondRecord_returnsNull()]
Replaced integer addition with subtraction → KILLED

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

60

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_firstField_offset1()]
removed call to java/lang/String::substring → KILLED

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

3.3
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_firstField_offset1()]
Replaced integer addition with subtraction → KILLED

61

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_offsetAtRecordLength_returnsNull()]
removed conditional - replaced comparison check with true → KILLED

2.2
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_offsetAtRecordLength_returnsNull()]
negated conditional → KILLED

3.3
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_fieldExceedsRecordLength_returnsAvailable()]
removed call to java/lang/String::length → KILLED

4.4
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_offsetAtRecordLength_returnsNull()]
changed conditional boundary → KILLED

5.5
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_fieldExceedsRecordLength_returnsAvailable()]
removed conditional - replaced comparison check with false → KILLED

63

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_fieldExceedsRecordLength_returnsAvailable()]
replaced call to java/lang/String::substring with receiver → KILLED

2.2
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_fieldExceedsRecordLength_returnsAvailable()]
removed call to java/lang/String::substring → KILLED

70

1.1
Location : fetchData
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:fetchData_firstField_offset1()]
replaced return value with "" for com/ancientprogramming/fixedformat4j/format/FixedFormatUtil::fetchData → KILLED

84

1.1
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
removed call to java/lang/Object::getClass → KILLED

2.2
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
removed call to com/ancientprogramming/fixedformat4j/format/FixedFormatUtil::getFixedFormatterInstance → KILLED

85

1.1
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
negated conditional → KILLED

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

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

86

1.1
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
removed call to com/ancientprogramming/fixedformat4j/format/FixedFormatUtil::getFixedFormatterInstance → KILLED

88

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

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

3.3
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
negated conditional → KILLED

89

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

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

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

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

5.5
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:getFixedFormatterInstance_noValidConstructor_throwsFixedFormatException()]
removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → KILLED

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

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

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

91

1.1
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtilExtended]/[method:getFixedFormatterInstance_noArgConstructor_StringFormatter()]
replaced return value with null for com/ancientprogramming/fixedformat4j/format/FixedFormatUtil::getFixedFormatterInstance → KILLED

108

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

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

3.3
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
negated conditional → KILLED

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

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

6.6
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
negated conditional → KILLED

110

1.1
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
Substituted 0 with 1 → KILLED

2.2
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
removed call to java/lang/reflect/Constructor::newInstance → KILLED

3.3
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
removed call to java/lang/Class::getConstructor → KILLED

4.4
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
Substituted 1 with 0 → KILLED

5.5
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
Substituted 1 with 0 → KILLED

6.6
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
Substituted 0 with 1 → KILLED

114

1.1
Location : getFixedFormatterInstance
Killed by : none
removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → NO_COVERAGE

118

1.1
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
removed call to java/lang/reflect/Constructor::newInstance → KILLED

2.2
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
Substituted 0 with 1 → KILLED

3.3
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
Substituted 0 with 1 → KILLED

4.4
Location : getFixedFormatterInstance
Killed by : com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil.[engine:junit-jupiter]/[class:com.ancientprogramming.fixedformat4j.format.TestFixedFormatUtil]/[method:testGetInstance()]
removed call to java/lang/Class::getConstructor → KILLED

122

1.1
Location : getFixedFormatterInstance
Killed by : none
removed call to com/ancientprogramming/fixedformat4j/exception/FixedFormatException::<init> → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.23.1 support