-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
3.0Issue planned for initial 3.0 releaseIssue planned for initial 3.0 release
Milestone
Description
Using ObjectMapper
to serialize and then deserialize a StackTraceElement
results in an instance with null values for classLoaderName
, moduleName
, and moduleVersion
. Those elements are present in the serialized form, but then do not make it into the instance supplied by
readValue("...", StackTraceElement.class)
.
Versions:
- Java: >= 9, using
11.0.4
- Jackson-Databind:
2.10.2
Example Test Case:
@Test
public void testStackTraceElementIsSerializableAfterJava9() throws IOException {
ObjectMapper mapper = new ObjectMapper();
StackTraceElement element = new StackTraceElement(
"testClassloader",
"testModule",
"module-version",
"com.test.DeclaringClass",
"firstMethod",
"/some/file",
35
);
String serializedElement = mapper.writeValueAsString(element);
System.out.println("Serialized Element: " + serializedElement);
assertEquals(element, mapper.readValue(serializedElement, StackTraceElement.class));
}
Serialize Element Print Statement:
{
"classLoaderName": "testClassloader",
"moduleName": "testModule",
"moduleVersion": "module-version",
"methodName": "firstMethod",
"fileName": "/some/file",
"lineNumber": 35,
"className": "com.test.DeclaringClass",
"nativeMethod": false
}
Assertion Failure Output:
Expected: testClassloader/testModule@moduleversion/com.test.DeclaringClass.firstMethod(/some/file:35)
Actual :com.test.DeclaringClass.firstMethod(/some/file:35)
Metadata
Metadata
Assignees
Labels
3.0Issue planned for initial 3.0 releaseIssue planned for initial 3.0 release