File tree 3 files changed +30
-1
lines changed
src/main/java/com/fasterxml/jackson/databind/deser
3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ Project: jackson-databind
6
6
7
7
2.13.3 (not yet released)
8
8
9
+ #3419 : Improve performance of `UnresolvedForwardReference` for forward
10
+ reference resolution
11
+ (contributed by Gary M)
9
12
#3446 : `java.lang.StringBuffer` cannot be deserialized
10
13
(reported by Lolf1010@github)
11
14
Original file line number Diff line number Diff line change @@ -168,7 +168,8 @@ public void checkUnresolvedObjectId() throws UnresolvedForwardReference
168
168
continue ;
169
169
}
170
170
if (exception == null ) {
171
- exception = new UnresolvedForwardReference (getParser (), "Unresolved forward references for: " );
171
+ exception = new UnresolvedForwardReference (getParser (), "Unresolved forward references for: " )
172
+ .withStackTrace ();
172
173
}
173
174
Object key = roid .getKey ().key ;
174
175
for (Iterator <Referring > iterator = roid .referringProperties (); iterator .hasNext (); ) {
Original file line number Diff line number Diff line change @@ -97,4 +97,29 @@ public String getMessage()
97
97
sb .append ('.' );
98
98
return sb .toString ();
99
99
}
100
+
101
+ /**
102
+ * This method is overridden to prevent filling of the stack trace when
103
+ * constructors are called (unfortunately alternative constructors can
104
+ * not be used due to historical reasons).
105
+ * To explicitly fill in stack traces method {@link #withStackTrace()}
106
+ * needs to be called after construction.
107
+ *
108
+ * @since 2.14
109
+ */
110
+ @ Override
111
+ public synchronized UnresolvedForwardReference fillInStackTrace () {
112
+ return this ;
113
+ }
114
+
115
+ /**
116
+ * "Mutant" factory method for filling in stack trace; needed since the default
117
+ * constructors will not fill in stack trace.
118
+ *
119
+ * @since 2.14
120
+ */
121
+ public UnresolvedForwardReference withStackTrace () {
122
+ super .fillInStackTrace ();
123
+ return this ;
124
+ }
100
125
}
You can’t perform that action at this time.
0 commit comments