From 763c56d661f66e88dea1870eda1f3cc3a937755d Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Sun, 9 Aug 2026 16:28:38 +0200 Subject: [PATCH 1/2] Remove JsonPrimitive from domain model --- androidApp/src/main/AndroidManifest.xml | 1 + gradle.properties | 2 ++ .../sebastianneubauer/jsontree/JsonTree.kt | 1 + .../jsontree/JsonTreeElement.kt | 9 ++--- .../jsontree/diff/AnnotatedDiffText.kt | 31 +++++++---------- .../jsontree/diff/JsonTreeDiff.kt | 1 + .../jsontree/search/JsonTreeSearch.kt | 4 +-- .../jsontree/util/AnnotatedText.kt | 33 +++++++------------ .../util/JsonTreeElementExtensions.kt | 19 +++++++++-- 9 files changed, 52 insertions(+), 49 deletions(-) diff --git a/androidApp/src/main/AndroidManifest.xml b/androidApp/src/main/AndroidManifest.xml index 756d3b5..0f5996b 100644 --- a/androidApp/src/main/AndroidManifest.xml +++ b/androidApp/src/main/AndroidManifest.xml @@ -10,6 +10,7 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@android:style/Theme.Material.Light.NoActionBar"> + >?, ): AnnotatedString { - val valueColor = remember(value) { - when { - value.isString -> colors.stringValueColor - value.booleanOrNull != null -> colors.booleanValueColor - value.doubleOrNull != null || - value.intOrNull != null || - value.floatOrNull != null || - value.longOrNull != null -> colors.numberValueColor - else -> colors.nullValueColor - } - } - return remember(colors) { buildAnnotatedString { key?.let { key -> @@ -92,8 +76,15 @@ internal fun rememberPrimitiveDiffText( } } + val valueColor = when(type) { + Type.STRING -> colors.stringValueColor + Type.BOOLEAN -> colors.booleanValueColor + Type.NUMBER -> colors.numberValueColor + Type.OTHER -> colors.nullValueColor + } + withStyle(SpanStyle(color = valueColor)) { - append(value.toString()) + append(value) } if (!isLastItem) { diff --git a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/diff/JsonTreeDiff.kt b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/diff/JsonTreeDiff.kt index 426a189..2f8520c 100644 --- a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/diff/JsonTreeDiff.kt +++ b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/diff/JsonTreeDiff.kt @@ -247,6 +247,7 @@ private fun rememberText( is JsonTreeElement.Primitive -> rememberPrimitiveDiffText( key = jsonTreeElement.key, value = jsonTreeElement.value, + type = jsonTreeElement.type, isLastItem = jsonTreeElement.isLastItem, parentType = jsonTreeElement.parentType, colors = colors, diff --git a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/search/JsonTreeSearch.kt b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/search/JsonTreeSearch.kt index 6414117..9548081 100644 --- a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/search/JsonTreeSearch.kt +++ b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/search/JsonTreeSearch.kt @@ -81,9 +81,9 @@ internal class JsonTreeSearch( return when (this) { is JsonTreeElement.Primitive -> { if (parentType != JsonTreeElement.ParentType.ARRAY) { - searchRegex.findRanges(key) + searchRegex.findRanges(value.content, isKey = false) + searchRegex.findRanges(key) + searchRegex.findRanges(value, isKey = false) } else { - searchRegex.findRanges(value.content, isKey = false) + searchRegex.findRanges(value, isKey = false) } } is JsonTreeElement.Collapsable.Array -> { diff --git a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/AnnotatedText.kt b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/AnnotatedText.kt index 6d254ea..21fc054 100644 --- a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/AnnotatedText.kt +++ b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/AnnotatedText.kt @@ -7,18 +7,13 @@ import androidx.compose.ui.text.SpanStyle import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.withStyle import com.sebastianneubauer.jsontree.CollapsableType +import com.sebastianneubauer.jsontree.JsonTreeElement.Primitive.Type import com.sebastianneubauer.jsontree.JsonTreeElement.ParentType import com.sebastianneubauer.jsontree.TreeColors import com.sebastianneubauer.jsontree.TreeState import com.sebastianneubauer.jsontree.search.SearchOccurrence import jsontree.jsontree.generated.resources.Res import jsontree.jsontree.generated.resources.jsontree_collapsable_items -import kotlinx.serialization.json.JsonPrimitive -import kotlinx.serialization.json.booleanOrNull -import kotlinx.serialization.json.doubleOrNull -import kotlinx.serialization.json.floatOrNull -import kotlinx.serialization.json.intOrNull -import kotlinx.serialization.json.longOrNull import org.jetbrains.compose.resources.pluralStringResource @Composable @@ -115,7 +110,8 @@ internal fun rememberCollapsableText( @Composable internal fun rememberPrimitiveText( key: String?, - value: JsonPrimitive, + value: String, + type: Type, colors: TreeColors, isLastItem: Boolean, searchOccurrence: SearchOccurrence?, @@ -123,22 +119,11 @@ internal fun rememberPrimitiveText( showIndices: Boolean, parentType: ParentType, ): AnnotatedString { - val valueColor = remember(value) { - when { - value.isString -> colors.stringValueColor - value.booleanOrNull != null -> colors.booleanValueColor - value.doubleOrNull != null || - value.intOrNull != null || - value.floatOrNull != null || - value.longOrNull != null -> colors.numberValueColor - else -> colors.nullValueColor - } - } - return remember( key, value, colors, + type, isLastItem, showIndices, searchOccurrence, @@ -182,9 +167,15 @@ internal fun rememberPrimitiveText( } val keyOffset = this.length + val valueColor = when(type) { + Type.STRING -> colors.stringValueColor + Type.BOOLEAN -> colors.booleanValueColor + Type.NUMBER -> colors.numberValueColor + Type.OTHER -> colors.nullValueColor + } withStyle(SpanStyle(color = valueColor)) { - append(value.toString()) + append(value) } searchOccurrence @@ -199,7 +190,7 @@ internal fun rememberPrimitiveText( // add an offset for the key which is already appended to the string // add 1 to the range if the value is a string because it has quotes around it // add 1 to the end because it is exclusive - val stringQuoteOffset = if (value.isString) 1 else 0 + val stringQuoteOffset = if (type == Type.STRING) 1 else 0 addStyle( style = SpanStyle(background = color), start = keyOffset + valueRange.range.first + stringQuoteOffset, diff --git a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/JsonTreeElementExtensions.kt b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/JsonTreeElementExtensions.kt index b6f319d..ce4cd5a 100644 --- a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/JsonTreeElementExtensions.kt +++ b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/JsonTreeElementExtensions.kt @@ -6,14 +6,20 @@ import com.sebastianneubauer.jsontree.JsonTreeElement.Collapsable.Object import com.sebastianneubauer.jsontree.JsonTreeElement.EndBracket import com.sebastianneubauer.jsontree.JsonTreeElement.ParentType import com.sebastianneubauer.jsontree.JsonTreeElement.Primitive +import com.sebastianneubauer.jsontree.JsonTreeElement.Primitive.Type import com.sebastianneubauer.jsontree.TreeState import com.sebastianneubauer.jsontree.endBracket import kotlinx.serialization.json.JsonArray import kotlinx.serialization.json.JsonElement import kotlinx.serialization.json.JsonObject import kotlinx.serialization.json.JsonPrimitive +import kotlinx.serialization.json.booleanOrNull +import kotlinx.serialization.json.doubleOrNull +import kotlinx.serialization.json.floatOrNull +import kotlinx.serialization.json.intOrNull import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonObject +import kotlinx.serialization.json.longOrNull internal enum class Expansion { /** @@ -204,9 +210,18 @@ internal fun JsonElement.toJsonTreeElement( id = idGenerator.incrementAndGet().toString(), level = level, key = key, - value = this, + value = content, isLastItem = isLastItem, parentType = parentType, + type = when { + isString -> Type.STRING + booleanOrNull != null -> Type.BOOLEAN + doubleOrNull != null || + intOrNull != null || + floatOrNull != null || + longOrNull != null -> Type.NUMBER + else -> Type.OTHER + }, ) } is JsonArray -> { @@ -281,7 +296,7 @@ internal fun JsonTreeElement.toRenderString(): String { is Primitive -> if (key != null && parentType != ParentType.ARRAY) { "\"$key\": $value" + if (isLastItem) "" else "," } else { - "$value" + if (isLastItem) "" else "," + value + if (isLastItem) "" else "," } is EndBracket -> when (type) { EndBracket.Type.ARRAY -> if (!isLastItem) "]," else "]" From 852a8dd4ce60e4a6061acd9481ef0415ef60204e Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Sun, 9 Aug 2026 17:19:24 +0200 Subject: [PATCH 2/2] Fix string quotes and tests --- .../jsontree/diff/AnnotatedDiffText.kt | 6 +- .../jsontree/util/AnnotatedText.kt | 6 +- .../util/JsonTreeElementExtensions.kt | 13 ++-- .../jsontree/JsonTreeElementExtensionsTest.kt | 31 ++++++--- .../jsontree/JsonTreeParserTest.kt | 34 ++++++---- .../jsontree/JsonTreeSearchTest.kt | 7 +- .../jsontree/diff/JsonTreeDifferTest.kt | 64 +++++++++++++------ 7 files changed, 111 insertions(+), 50 deletions(-) diff --git a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/diff/AnnotatedDiffText.kt b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/diff/AnnotatedDiffText.kt index 5d8cd00..dbbb9a1 100644 --- a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/diff/AnnotatedDiffText.kt +++ b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/diff/AnnotatedDiffText.kt @@ -84,7 +84,11 @@ internal fun rememberPrimitiveDiffText( } withStyle(SpanStyle(color = valueColor)) { - append(value) + if(type == Type.STRING) { + append("\"$value\"") + } else { + append(value) + } } if (!isLastItem) { diff --git a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/AnnotatedText.kt b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/AnnotatedText.kt index 21fc054..0d0748c 100644 --- a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/AnnotatedText.kt +++ b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/AnnotatedText.kt @@ -175,7 +175,11 @@ internal fun rememberPrimitiveText( } withStyle(SpanStyle(color = valueColor)) { - append(value) + if(type == Type.STRING) { + append("\"$value\"") + } else { + append(value) + } } searchOccurrence diff --git a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/JsonTreeElementExtensions.kt b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/JsonTreeElementExtensions.kt index ce4cd5a..49a0e95 100644 --- a/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/JsonTreeElementExtensions.kt +++ b/jsontree/src/commonMain/kotlin/com/sebastianneubauer/jsontree/util/JsonTreeElementExtensions.kt @@ -293,10 +293,15 @@ internal fun JsonTreeElement.toRenderString(): String { } else { "[" } - is Primitive -> if (key != null && parentType != ParentType.ARRAY) { - "\"$key\": $value" + if (isLastItem) "" else "," - } else { - value + if (isLastItem) "" else "," + is Primitive -> { + val isString = type == Type.STRING + val quotedValue = if(isString) "\"$value\"" else value + + if (key != null && parentType != ParentType.ARRAY) { + "\"$key\": $quotedValue" + if (isLastItem) "" else "," + } else { + quotedValue + if (isLastItem) "" else "," + } } is EndBracket -> when (type) { EndBracket.Type.ARRAY -> if (!isLastItem) "]," else "]" diff --git a/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeElementExtensionsTest.kt b/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeElementExtensionsTest.kt index ddd4a53..bd62b25 100644 --- a/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeElementExtensionsTest.kt +++ b/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeElementExtensionsTest.kt @@ -2,6 +2,7 @@ package com.sebastianneubauer.jsontree import com.sebastianneubauer.jsontree.JsonTreeElement.Collapsable.Array import com.sebastianneubauer.jsontree.JsonTreeElement.Collapsable.Object +import com.sebastianneubauer.jsontree.JsonTreeElement.Primitive.Type import com.sebastianneubauer.jsontree.util.Expansion import com.sebastianneubauer.jsontree.util.collapse import com.sebastianneubauer.jsontree.util.expand @@ -252,7 +253,8 @@ public class JsonTreeElementExtensionsTest { level = 0, isLastItem = false, key = "myProp", - value = JsonPrimitive("test"), + value = "test", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -271,7 +273,8 @@ public class JsonTreeElementExtensionsTest { level = 0, isLastItem = true, key = "myProp", - value = JsonPrimitive("test"), + value = "test", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -290,7 +293,8 @@ public class JsonTreeElementExtensionsTest { level = 0, isLastItem = false, key = "0", - value = JsonPrimitive(42), + value = "42", + type = Type.NUMBER, parentType = JsonTreeElement.ParentType.ARRAY ) @@ -309,7 +313,8 @@ public class JsonTreeElementExtensionsTest { level = 0, isLastItem = true, key = "0", - value = JsonPrimitive(42), + value = "42", + type = Type.NUMBER, parentType = JsonTreeElement.ParentType.ARRAY ) @@ -328,7 +333,8 @@ public class JsonTreeElementExtensionsTest { level = 0, isLastItem = false, key = null, - value = JsonPrimitive(true), + value = "true", + type = Type.BOOLEAN, parentType = JsonTreeElement.ParentType.NONE ) @@ -347,7 +353,8 @@ public class JsonTreeElementExtensionsTest { level = 0, isLastItem = true, key = null, - value = JsonPrimitive(false), + value = "false", + type = Type.BOOLEAN, parentType = JsonTreeElement.ParentType.NONE ) @@ -433,7 +440,8 @@ public class JsonTreeElementExtensionsTest { level = 2, isLastItem = false, key = "0", - value = JsonPrimitive("value1"), + value = "value1", + type = Type.STRING, parentType = JsonTreeElement.ParentType.ARRAY ) @@ -442,7 +450,8 @@ public class JsonTreeElementExtensionsTest { level = 3, isLastItem = true, key = "primitive2", - value = JsonPrimitive("value2"), + value = "value2", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -488,7 +497,8 @@ public class JsonTreeElementExtensionsTest { level = 2, isLastItem = false, key = "0", - value = JsonPrimitive("value1"), + value = "value1", + type = Type.STRING, parentType = JsonTreeElement.ParentType.ARRAY ) @@ -497,7 +507,8 @@ public class JsonTreeElementExtensionsTest { level = 3, isLastItem = true, key = "primitive2", - value = JsonPrimitive("value2"), + value = "value2", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) diff --git a/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeParserTest.kt b/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeParserTest.kt index 9a93b5f..135b66f 100644 --- a/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeParserTest.kt +++ b/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeParserTest.kt @@ -1,5 +1,6 @@ package com.sebastianneubauer.jsontree +import com.sebastianneubauer.jsontree.JsonTreeElement.Primitive.Type import com.sebastianneubauer.jsontree.JsonTreeParserState.Parsing.Error import com.sebastianneubauer.jsontree.JsonTreeParserState.Ready import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -115,7 +116,8 @@ public class JsonTreeParserTest { level = 0, isLastItem = true, key = null, - value = JsonPrimitive("stringValue"), + value = "stringValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.NONE ) ) @@ -135,7 +137,8 @@ public class JsonTreeParserTest { level = 0, isLastItem = true, key = null, - value = JsonPrimitive("stringValue"), + value = "stringValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.NONE ) ) @@ -155,7 +158,8 @@ public class JsonTreeParserTest { level = 0, isLastItem = true, key = null, - value = JsonPrimitive("stringValue"), + value = "stringValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.NONE ) ) @@ -183,7 +187,8 @@ public class JsonTreeParserTest { level = 1, isLastItem = true, key = "0", - value = JsonPrimitive("stringValue"), + value = "stringValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.ARRAY, ) ) @@ -213,7 +218,8 @@ public class JsonTreeParserTest { level = 1, isLastItem = true, key = "0", - value = JsonPrimitive("stringValue"), + value = "stringValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.ARRAY, ) ) @@ -223,7 +229,8 @@ public class JsonTreeParserTest { level = 1, isLastItem = true, key = "0", - value = JsonPrimitive("stringValue"), + value = "stringValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.ARRAY, ), JsonTreeElement.EndBracket( @@ -257,7 +264,8 @@ public class JsonTreeParserTest { level = 1, isLastItem = true, key = "0", - value = JsonPrimitive("stringValue"), + value = "stringValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.ARRAY, ) ) @@ -267,7 +275,8 @@ public class JsonTreeParserTest { level = 1, isLastItem = true, key = "0", - value = JsonPrimitive("stringValue"), + value = "stringValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.ARRAY, ), JsonTreeElement.EndBracket( @@ -687,7 +696,8 @@ public class JsonTreeParserTest { level = 4, isLastItem = true, key = "string", - value = JsonPrimitive("aString"), + value = "aString", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT, ) @@ -696,7 +706,8 @@ public class JsonTreeParserTest { level = 3, isLastItem = false, key = "0", - value = JsonPrimitive(42), + value = "42", + type = Type.NUMBER, parentType = JsonTreeElement.ParentType.ARRAY ) @@ -705,7 +716,8 @@ public class JsonTreeParserTest { level = 3, isLastItem = true, key = "1", - value = JsonPrimitive(52), + value = "52", + type = Type.NUMBER, parentType = JsonTreeElement.ParentType.ARRAY ) diff --git a/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeSearchTest.kt b/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeSearchTest.kt index 538c1a7..a0305a3 100644 --- a/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeSearchTest.kt +++ b/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/JsonTreeSearchTest.kt @@ -2,6 +2,7 @@ package com.sebastianneubauer.jsontree import com.sebastianneubauer.jsontree.JsonTreeElement.Collapsable.Array import com.sebastianneubauer.jsontree.JsonTreeElement.Collapsable.Object +import com.sebastianneubauer.jsontree.JsonTreeElement.Primitive.Type import com.sebastianneubauer.jsontree.search.JsonTreeSearch import com.sebastianneubauer.jsontree.search.SearchOccurrence import com.sebastianneubauer.jsontree.search.SearchState.SearchResult @@ -155,7 +156,8 @@ public class JsonTreeSearchTest { level = 2, isLastItem = false, key = "0", - value = JsonPrimitive("value1"), + value = "value1", + type = Type.STRING, parentType = JsonTreeElement.ParentType.ARRAY ) @@ -164,7 +166,8 @@ public class JsonTreeSearchTest { level = 3, isLastItem = true, key = "primitive2", - value = JsonPrimitive("secondSecond"), + value = "secondSecond", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) diff --git a/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/diff/JsonTreeDifferTest.kt b/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/diff/JsonTreeDifferTest.kt index 36f7e33..5e40beb 100644 --- a/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/diff/JsonTreeDifferTest.kt +++ b/jsontree/src/commonTest/kotlin/com/sebastianneubauer/jsontree/diff/JsonTreeDifferTest.kt @@ -1,6 +1,7 @@ package com.sebastianneubauer.jsontree.diff import com.sebastianneubauer.jsontree.JsonTreeElement +import com.sebastianneubauer.jsontree.JsonTreeElement.Primitive.Type import com.sebastianneubauer.jsontree.TreeState import com.sebastianneubauer.jsontree.diff.JsonTreeDifferState.JsonDiffElement import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -44,7 +45,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = true, key = "name", - value = JsonPrimitive("value"), + value = "value", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -126,7 +128,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = true, key = "name", - value = JsonPrimitive("oldValue"), + value = "oldValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -135,7 +138,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = true, key = "name", - value = JsonPrimitive("newValue"), + value = "newValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -223,7 +227,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = true, key = "name", - value = JsonPrimitive("value"), + value = "value", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -232,7 +237,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = false, key = "age", - value = JsonPrimitive(42), + value = "42", + type = Type.NUMBER, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -241,7 +247,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = true, key = "name", - value = JsonPrimitive("value"), + value = "value", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -330,7 +337,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = false, key = "age", - value = JsonPrimitive(42), + value = "42", + type = Type.NUMBER, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -339,7 +347,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = true, key = "name", - value = JsonPrimitive("value"), + value = "value", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -348,7 +357,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = true, key = "name", - value = JsonPrimitive("value"), + value = "value", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -437,7 +447,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = true, key = "name", - value = JsonPrimitive("oldValue"), + value = "oldValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -446,7 +457,8 @@ public class JsonTreeDifferTest { level = 1, isLastItem = true, key = "name", - value = JsonPrimitive("newValue"), + value = "newValue", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -561,7 +573,8 @@ public class JsonTreeDifferTest { level = 2, isLastItem = true, key = "name", - value = JsonPrimitive("John"), + value = "John", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -665,7 +678,8 @@ public class JsonTreeDifferTest { level = 2, isLastItem = true, key = "name", - value = JsonPrimitive("John"), + value = "John", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -674,7 +688,8 @@ public class JsonTreeDifferTest { level = 2, isLastItem = true, key = "name", - value = JsonPrimitive("Jane"), + value = "Jane", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -803,7 +818,8 @@ public class JsonTreeDifferTest { level = 3, isLastItem = true, key = "c", - value = JsonPrimitive("value"), + value = "value", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -939,7 +955,8 @@ public class JsonTreeDifferTest { level = 2, isLastItem = true, key = "name", - value = JsonPrimitive("John"), + value = "John", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -948,7 +965,8 @@ public class JsonTreeDifferTest { level = 2, isLastItem = false, key = "age", - value = JsonPrimitive(30), + value = "30", + type = Type.NUMBER, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -957,7 +975,8 @@ public class JsonTreeDifferTest { level = 2, isLastItem = true, key = "name", - value = JsonPrimitive("John"), + value = "John", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -1088,7 +1107,8 @@ public class JsonTreeDifferTest { level = 2, isLastItem = false, key = "age", - value = JsonPrimitive(30), + value = "30", + type = Type.NUMBER, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -1097,7 +1117,8 @@ public class JsonTreeDifferTest { level = 2, isLastItem = true, key = "name", - value = JsonPrimitive("John"), + value = "John", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT ) @@ -1106,7 +1127,8 @@ public class JsonTreeDifferTest { level = 2, isLastItem = true, key = "name", - value = JsonPrimitive("John"), + value = "John", + type = Type.STRING, parentType = JsonTreeElement.ParentType.OBJECT )