Minor fix to keep Exception deserializer working with latest JDK 9 EA
diff --git a/src/main/java/com/fasterxml/jackson/databind/deser/std/StackTraceElementDeserializer.java b/src/main/java/com/fasterxml/jackson/databind/deser/std/StackTraceElementDeserializer.java
index 61572c6..3c69efa 100644
--- a/src/main/java/com/fasterxml/jackson/databind/deser/std/StackTraceElementDeserializer.java
+++ b/src/main/java/com/fasterxml/jackson/databind/deser/std/StackTraceElementDeserializer.java
@@ -24,6 +24,7 @@
String className = "", methodName = "", fileName = "";
// Java 9 adds couple more things
String moduleName = null, moduleVersion = null;
+ String classLoaderName = null;
int lineNumber = -1;
while ((t = p.nextValue()) != JsonToken.END_OBJECT) {
@@ -31,6 +32,8 @@
// TODO: with Java 8, convert to switch
if ("className".equals(propName)) {
className = p.getText();
+ } else if ("classLoaderName".equals(propName)) {
+ classLoaderName = p.getText();
} else if ("fileName".equals(propName)) {
fileName = p.getText();
} else if ("lineNumber".equals(propName)) {
@@ -53,7 +56,7 @@
}
}
return constructValue(ctxt, className, methodName, fileName, lineNumber,
- moduleName, moduleVersion);
+ moduleName, moduleVersion, classLoaderName);
} else if (t == JsonToken.START_ARRAY && ctxt.isEnabled(DeserializationFeature.UNWRAP_SINGLE_VALUE_ARRAYS)) {
p.nextToken();
final StackTraceElement value = deserialize(p, ctxt);
@@ -65,6 +68,14 @@
return (StackTraceElement) ctxt.handleUnexpectedToken(_valueClass, p);
}
+ @Deprecated // since 2.9
+ protected StackTraceElement constructValue(DeserializationContext ctxt,
+ String className, String methodName, String fileName, int lineNumber,
+ String moduleName, String moduleVersion) {
+ return constructValue(ctxt, className, methodName, fileName, lineNumber,
+ moduleName, moduleVersion, null);
+ }
+
/**
* Overridable factory method used for constructing {@link StackTraceElement}s.
*
@@ -72,7 +83,7 @@
*/
protected StackTraceElement constructValue(DeserializationContext ctxt,
String className, String methodName, String fileName, int lineNumber,
- String moduleName, String moduleVersion)
+ String moduleName, String moduleVersion, String classLoaderName)
{
// 21-May-2016, tatu: With Java 9, need to use different constructor, probably
// via different module, and throw exception here if extra args passed