# devopsgym / testgen__fasterxml__jackson-databind-4048 - taskset: [devopsgym](https://harnessreport.com/tasks/devopsgym.md) - difficulty: hard - category: test-generation - language: - runnable from the site: no - agent timeout: 3000s ## Results by harness _none yet_ ## Instruction ``` The following text contains a user issue (in <issue/> brackets) posted at a repository. Further, you are provided with file contents of several files in the repository that contain relevant code (in <code> brackets). It may be necessary to use code from third party dependencies or files not contained in the attached documents however. Your task is to identify the issue and implement a test case that verifies a proposed solution to this issue. More details at the end of this text. <issue> **Describe the bug** After upgrading jackson-databind, properties were being exposed after serialization that were set to @JsonIngore and shouldn't be. **Version information** Which Jackson version(s) was this for? 2.15.+ (seeing with both 2.15.0 and 2.15.1) JDK - Temurin-17.0.6+10 **To Reproduce** If you have a way to reproduce this with: Example unit test showing the issue. If referencing 2.14.+ it works, but fails on these assertions when using 2.15.+: assertFalse(json.contains("world")); assertNotEquals(obj1.getDef(), obj2.getDef()); assertNull(obj2.getDef()); Code: ``` package org.example; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Test; import java.io.Serial; import java.io.Serializable; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNull; public class JacksonTest { public static class Obj implements Serializable { @Serial private static final long serialVersionUID = -1L; private String abc; @JsonIgnore private transient String def; public String getAbc() { return abc; } public void setAbc(String abc) { this.abc = abc; } public String getDef() { return def; } public void setDef(String def) { this.def = def; } } @Test public void testJsonIgnore() throws JsonProcessingException { var mapper = new ObjectMapper(); var obj1 = new Obj(); obj1.setAbc("hello"); obj1.setDef("world"); String json = mapper.writeValueAsString(obj1); var obj2 = mapper.readValue(json, Obj.class); assertEquals(obj1.getAbc(), obj2.getAbc()); assertFalse(json.contains("world")); assertNotEquals(obj1.getDef(), obj2.getDef()); assertNull(obj2.getDef()); } } ``` **Expected behavior** The test should pass the same as it did with 2.14.+ **Additional context** I noticed that using the 2.15.+ version, if I set mapper.configure(MapperFeature.PROPAGATE_TRANSIENT_MARKER, true), it does start working. Did the default somehow change? This is concerning because usages of the library could start exposing sensitive data that it wasn't in previous versions and this would be unknowingly. Since this is a minor (2.14 -> 2.15) this seems to be a big change that should be saved for a major. I did verify mapper.isEnabled(MapperFeature.PROPAGATE_TRANSIENT_MARKER) is false in both 2.14 and 2.15, but it seems to be working in 2.14 without needing to set it to true. </issue> Please generate test cases that check whether an implemented solution resolves the issue of the user (at the top, within <issue/> brackets). You may apply changes to several files. Apply as much reasoning as you please and see necessary. Make sure to implement only test cases and don't try to fix the issue itself. You are not allowed to read git history. ``` --- Harness Report runs agent harnesses from their GitHub repos on Harbor tasks and records every model call. Every page is also `.md` and `.json`; index: https://harnessreport.com/llms.txt · MCP: https://harnessreport.com/mcp