From 509f41bdf5d94eb8f0f194ec6fef3321352d8dd4 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Mon, 22 Jul 2024 20:31:28 -0700 Subject: [PATCH] First part of fix, for #4630 --- .../jackson/databind/introspect/POJOPropertiesCollector.java | 4 ++-- .../databind/records/RecordWithIgnoreOverride3992Test.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.java b/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.java index 924492686a..6bd9dd8c78 100644 --- a/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.java +++ b/src/main/java/com/fasterxml/jackson/databind/introspect/POJOPropertiesCollector.java @@ -1303,8 +1303,8 @@ protected void _removeUnwantedAccessor(Map props) { // 15-Jan-2023, tatu: Avoid pulling in mutators for Records; Fields mostly // since there should not be setters. - final boolean inferMutators = !isRecordType() - && _config.isEnabled(MapperFeature.INFER_PROPERTY_MUTATORS); + // 22-Jul-2024, tatu: Actually do pull them to fix [databind#4630] + final boolean inferMutators = _config.isEnabled(MapperFeature.INFER_PROPERTY_MUTATORS); Iterator it = props.values().iterator(); while (it.hasNext()) { diff --git a/src/test-jdk17/java/com/fasterxml/jackson/databind/records/RecordWithIgnoreOverride3992Test.java b/src/test-jdk17/java/com/fasterxml/jackson/databind/records/RecordWithIgnoreOverride3992Test.java index a1e6478241..0bd4a91921 100644 --- a/src/test-jdk17/java/com/fasterxml/jackson/databind/records/RecordWithIgnoreOverride3992Test.java +++ b/src/test-jdk17/java/com/fasterxml/jackson/databind/records/RecordWithIgnoreOverride3992Test.java @@ -39,7 +39,7 @@ void add(Recursion recursion) { // [databind#3992] @Test - public void testHelloRecord() throws Exception { + public void testHelloRecord3992() throws Exception { Recursion beanWithRecursion = new Recursion(); beanWithRecursion.add(beanWithRecursion); String json = MAPPER.writer() @@ -53,7 +53,7 @@ public void testHelloRecord() throws Exception { // [databind#4626] @Test - public void testDeserialize() throws Exception { + public void testDeserializeWithOverride4626() throws Exception { HelloRecord expected = new HelloRecord("hello", null); assertEquals(expected, MAPPER.readValue(a2q("{'text':'hello'}"), HelloRecord.class));