SymfonionReferenceException.java

1
package com.github.dakusui.symfonion.exceptions;
2
3
import com.google.gson.JsonElement;
4
import com.google.gson.JsonObject;
5
6
import java.io.File;
7
import java.io.Serial;
8
9
import static com.github.dakusui.json.JsonUtils.createSummaryJsonObjectFromPaths;
10
import static com.github.dakusui.json.JsonUtils.findPathOf;
11
12
public class SymfonionReferenceException extends SymfonionSyntaxException {
13
  /**
14
   * Serial version UID.
15
   */
16
  @Serial
17
  private static final long serialVersionUID = 3554220091863267192L;
18
  private final JsonElement referencedNodeHoldingNode;
19
20
  public SymfonionReferenceException(String missingReference, String type, JsonElement problemCausingJsonNode, JsonObject root, File sourceFile, JsonElement referencedNodeHoldingNode) {
21
    super(formatMessage(missingReference, type),  problemCausingJsonNode, root, sourceFile);
22
    this.referencedNodeHoldingNode = referencedNodeHoldingNode;
23
  }
24
  
25
  
26
  protected static String formatMessage(String missingReference, String type) {
27 1 1. formatMessage : replaced return value with "" for com/github/dakusui/symfonion/exceptions/SymfonionReferenceException::formatMessage → KILLED
    return String.format("'%s' undefined %s symbol", missingReference, type);
28
  }
29
30
  protected JsonObject summaryRootObjectNode() {
31 1 1. summaryRootObjectNode : replaced return value with null for com/github/dakusui/symfonion/exceptions/SymfonionReferenceException::summaryRootObjectNode → SURVIVED
    return createSummaryJsonObjectFromPaths(
32
        this.rootJsonObjectNode,
33
        findPathOf(problemCausingJsonNode, this.rootJsonObjectNode),
34
        findPathOf(referencedNodeHoldingNode, this.rootJsonObjectNode)
35
    );
36
  }
37
}

Mutations

27

1.1
Location : formatMessage
Killed by : com.github.dakusui.symfonion.tests.ReferenceErrorTest.missingNoteMap(com.github.dakusui.symfonion.tests.ReferenceErrorTest)
replaced return value with "" for com/github/dakusui/symfonion/exceptions/SymfonionReferenceException::formatMessage → KILLED

31

1.1
Location : summaryRootObjectNode
Killed by : none
replaced return value with null for com/github/dakusui/symfonion/exceptions/SymfonionReferenceException::summaryRootObjectNode → SURVIVED

Active mutators

Tests examined


Report generated by PIT 1.15.3