diff --git a/avro/src/main/java/tools/jackson/dataformat/avro/deser/AvroFieldDefaulters.java b/avro/src/main/java/tools/jackson/dataformat/avro/deser/AvroFieldDefaulters.java index 5e44037e0..f3973714c 100644 --- a/avro/src/main/java/tools/jackson/dataformat/avro/deser/AvroFieldDefaulters.java +++ b/avro/src/main/java/tools/jackson/dataformat/avro/deser/AvroFieldDefaulters.java @@ -38,7 +38,7 @@ public static AvroFieldReader createDefaulter(String name, return new ScalarDefaults.FloatDefaults(name, defaultAsNode.asLong()); } case VALUE_STRING: - return new ScalarDefaults.StringDefaults(name, defaultAsNode.asText()); + return new ScalarDefaults.StringDefaults(name, defaultAsNode.asString()); case START_OBJECT: { List readers = new ArrayList<>(); diff --git a/avro/src/main/java/tools/jackson/dataformat/avro/schema/RecordVisitor.java b/avro/src/main/java/tools/jackson/dataformat/avro/schema/RecordVisitor.java index 4755e6024..0dd3e2909 100644 --- a/avro/src/main/java/tools/jackson/dataformat/avro/schema/RecordVisitor.java +++ b/avro/src/main/java/tools/jackson/dataformat/avro/schema/RecordVisitor.java @@ -267,7 +267,7 @@ protected Schema reorderUnionToMatchDefaultType(Schema schema, JsonNode defaultV if (matchingIndex == null) { matchingIndex = schema.getIndexNamed(Type.INT.getName()); } - } else if (defaultValue.isTextual()) { + } else if (defaultValue.isString()) { matchingIndex = schema.getIndexNamed(Type.STRING.getName()); if (matchingIndex == null) { // search for an enum diff --git a/cbor/src/test/java/tools/jackson/dataformat/cbor/mapper/TreeNodesTest.java b/cbor/src/test/java/tools/jackson/dataformat/cbor/mapper/TreeNodesTest.java index 7aa70145c..f08929273 100644 --- a/cbor/src/test/java/tools/jackson/dataformat/cbor/mapper/TreeNodesTest.java +++ b/cbor/src/test/java/tools/jackson/dataformat/cbor/mapper/TreeNodesTest.java @@ -26,7 +26,7 @@ public void testSimple() throws Exception // now, deserialize JsonNode top2 = MAPPER.readValue(doc, JsonNode.class); JsonNode foo2 = top2.get("foo"); - assertEquals("baz", foo2.get("bar").textValue()); + assertEquals("baz", foo2.get("bar").stringValue()); JsonNode datNode = foo2.get("dat"); if (!datNode.isBinary()) { diff --git a/cbor/src/test/java/tools/jackson/dataformat/cbor/mapper/TreeReadViaMapperTest.java b/cbor/src/test/java/tools/jackson/dataformat/cbor/mapper/TreeReadViaMapperTest.java index 8bd50d842..33efbac40 100644 --- a/cbor/src/test/java/tools/jackson/dataformat/cbor/mapper/TreeReadViaMapperTest.java +++ b/cbor/src/test/java/tools/jackson/dataformat/cbor/mapper/TreeReadViaMapperTest.java @@ -41,21 +41,21 @@ public void testSimple() throws Exception assertEquals(SAMPLE_SPEC_VALUE_HEIGHT, ob.intValue()); ob = imageMap.get("Title"); - assertTrue(ob.isTextual()); - assertEquals(SAMPLE_SPEC_VALUE_TITLE, ob.textValue()); + assertTrue(ob.isString()); + assertEquals(SAMPLE_SPEC_VALUE_TITLE, ob.stringValue()); ob = imageMap.get("Thumbnail"); assertType(ob, ObjectNode.class); ObjectNode tn = (ObjectNode) ob; ob = tn.get("Url"); - assertTrue(ob.isTextual()); - assertEquals(SAMPLE_SPEC_VALUE_TN_URL, ob.textValue()); + assertTrue(ob.isString()); + assertEquals(SAMPLE_SPEC_VALUE_TN_URL, ob.stringValue()); ob = tn.get("Height"); assertTrue(ob.isIntegralNumber()); assertEquals(SAMPLE_SPEC_VALUE_TN_HEIGHT, ob.intValue()); ob = tn.get("Width"); - assertTrue(ob.isTextual()); - assertEquals(SAMPLE_SPEC_VALUE_TN_WIDTH, ob.textValue()); + assertTrue(ob.isString()); + assertEquals(SAMPLE_SPEC_VALUE_TN_WIDTH, ob.stringValue()); ob = imageMap.get("IDs"); assertTrue(ob.isArray()); @@ -87,14 +87,14 @@ public void testMultiple() throws Exception assertTrue(result.isIntegralNumber()); assertTrue(result.isInt()); - assertFalse(result.isTextual()); + assertFalse(result.isString()); assertEquals(12, result.intValue()); result = MAPPER.readTree(p); - assertTrue(result.isTextual()); + assertTrue(result.isString()); assertFalse(result.isIntegralNumber()); assertFalse(result.isInt()); - assertEquals("string", result.textValue()); + assertEquals("string", result.stringValue()); result = MAPPER.readTree(p); assertTrue(result.isArray()); diff --git a/smile/src/test/java/tools/jackson/dataformat/smile/mapper/MapperSimpleReadTest.java b/smile/src/test/java/tools/jackson/dataformat/smile/mapper/MapperSimpleReadTest.java index bd3b790df..25e786f31 100644 --- a/smile/src/test/java/tools/jackson/dataformat/smile/mapper/MapperSimpleReadTest.java +++ b/smile/src/test/java/tools/jackson/dataformat/smile/mapper/MapperSimpleReadTest.java @@ -122,7 +122,7 @@ public void testWithNestedMaps() throws IOException assertEquals(1, n2.size()); JsonNode n3 = n2.get(""); assertNotNull(n3); - assertTrue(n3.isTextual()); + assertTrue(n3.isString()); } // for [dataformat-smile#26] diff --git a/smile/src/test/java/tools/jackson/dataformat/smile/mapper/TreeNodesTest.java b/smile/src/test/java/tools/jackson/dataformat/smile/mapper/TreeNodesTest.java index 590ccdd79..ecefde902 100644 --- a/smile/src/test/java/tools/jackson/dataformat/smile/mapper/TreeNodesTest.java +++ b/smile/src/test/java/tools/jackson/dataformat/smile/mapper/TreeNodesTest.java @@ -25,7 +25,7 @@ public void testSimple() throws Exception // now, deserialize JsonNode top2 = MAPPER.readValue(doc, JsonNode.class); JsonNode foo2 = top2.get("foo"); - assertEquals("baz", foo2.get("bar").textValue()); + assertEquals("baz", foo2.get("bar").stringValue()); JsonNode datNode = foo2.get("dat"); if (!datNode.isBinary()) { diff --git a/smile/src/test/java/tools/jackson/dataformat/smile/mapper/TreeReadViaMapperTest.java b/smile/src/test/java/tools/jackson/dataformat/smile/mapper/TreeReadViaMapperTest.java index 796945a9f..760b99fbe 100644 --- a/smile/src/test/java/tools/jackson/dataformat/smile/mapper/TreeReadViaMapperTest.java +++ b/smile/src/test/java/tools/jackson/dataformat/smile/mapper/TreeReadViaMapperTest.java @@ -41,21 +41,21 @@ public void testSimple() throws Exception assertEquals(SAMPLE_SPEC_VALUE_HEIGHT, ob.intValue()); ob = imageMap.get("Title"); - assertTrue(ob.isTextual()); - assertEquals(SAMPLE_SPEC_VALUE_TITLE, ob.textValue()); + assertTrue(ob.isString()); + assertEquals(SAMPLE_SPEC_VALUE_TITLE, ob.stringValue()); ob = imageMap.get("Thumbnail"); assertType(ob, ObjectNode.class); ObjectNode tn = (ObjectNode) ob; ob = tn.get("Url"); - assertTrue(ob.isTextual()); - assertEquals(SAMPLE_SPEC_VALUE_TN_URL, ob.textValue()); + assertTrue(ob.isString()); + assertEquals(SAMPLE_SPEC_VALUE_TN_URL, ob.stringValue()); ob = tn.get("Height"); assertTrue(ob.isIntegralNumber()); assertEquals(SAMPLE_SPEC_VALUE_TN_HEIGHT, ob.intValue()); ob = tn.get("Width"); - assertTrue(ob.isTextual()); - assertEquals(SAMPLE_SPEC_VALUE_TN_WIDTH, ob.textValue()); + assertTrue(ob.isString()); + assertEquals(SAMPLE_SPEC_VALUE_TN_WIDTH, ob.stringValue()); ob = imageMap.get("IDs"); assertTrue(ob.isArray()); @@ -87,14 +87,14 @@ public void testMultiple() throws Exception assertTrue(result.isIntegralNumber()); assertTrue(result.isInt()); - assertFalse(result.isTextual()); + assertFalse(result.isString()); assertEquals(12, result.intValue()); result = MAPPER.readTree(p); - assertTrue(result.isTextual()); + assertTrue(result.isString()); assertFalse(result.isIntegralNumber()); assertFalse(result.isInt()); - assertEquals("string", result.textValue()); + assertEquals("string", result.stringValue()); result = MAPPER.readTree(p); assertTrue(result.isArray());