| 1 | package com.github.dakusui.symfonion.exceptions; | |
| 2 | ||
| 3 | import com.github.dakusui.json.JsonUtils; | |
| 4 | import com.google.gson.JsonElement; | |
| 5 | import com.google.gson.JsonObject; | |
| 6 | ||
| 7 | import java.io.File; | |
| 8 | import java.io.Serial; | |
| 9 | ||
| 10 | public class SymfonionIllegalFormatException extends SymfonionSyntaxException { | |
| 11 | public static final String FRACTION_EXAMPLE = "This value must be a fraction. e.g. '1/2', '1/4', and so on."; | |
| 12 | public static final String NOTE_LENGTH_EXAMPLE = "This value must be a note length. e.g. '4', '8.', '16'"; | |
| 13 | ||
| 14 | /** | |
| 15 | * Serial version UID | |
| 16 | */ | |
| 17 | @Serial | |
| 18 | private static final long serialVersionUID = 8614872945878002862L; | |
| 19 | ||
| 20 | public SymfonionIllegalFormatException(JsonElement problemCausingJsonNode, String explanationOfAcceptableValue, JsonObject root, File sourceFile) { | |
| 21 | super(formatMessage(explanationOfAcceptableValue, problemCausingJsonNode), problemCausingJsonNode, root, sourceFile); | |
| 22 | } | |
| 23 | ||
| 24 | private static String formatMessage(String acceptableExample, JsonElement problemContainingNode) { | |
| 25 |
1
1. formatMessage : replaced return value with "" for com/github/dakusui/symfonion/exceptions/SymfonionIllegalFormatException::formatMessage → KILLED |
return String.format("%s is invalid. (%s)", JsonUtils.summarizeJsonElement(problemContainingNode), acceptableExample); |
| 26 | } | |
| 27 | ||
| 28 | static public void main(String[] args) { | |
| 29 |
1
1. main : removed call to java/io/PrintStream::println → NO_COVERAGE |
System.out.println(new JsonObject()); |
| 30 | } | |
| 31 | } | |
Mutations | ||
| 25 |
1.1 |
|
| 29 |
1.1 |