File tree Expand file tree Collapse file tree
main/java/org/springframework/core
test/java/org/springframework/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,13 +123,13 @@ public class ResolvableType implements Serializable {
123123
124124 private @ Nullable Class <?> resolved ;
125125
126- private volatile @ Nullable ResolvableType superType ;
126+ private transient volatile @ Nullable ResolvableType superType ;
127127
128- private volatile ResolvableType @ Nullable [] interfaces ;
128+ private transient volatile ResolvableType @ Nullable [] interfaces ;
129129
130- private volatile ResolvableType @ Nullable [] generics ;
130+ private transient volatile ResolvableType @ Nullable [] generics ;
131131
132- private volatile @ Nullable Boolean unresolvableGenerics ;
132+ private transient volatile @ Nullable Boolean unresolvableGenerics ;
133133
134134
135135 /**
Original file line number Diff line number Diff line change @@ -1335,6 +1335,22 @@ void serialize() throws Exception {
13351335 assertThat (deserializedNone ).isSameAs (ResolvableType .NONE );
13361336 }
13371337
1338+ @ Test
1339+ void serializeWithCachedState () throws Exception {
1340+ ResolvableType type = ResolvableType .forClass (List .class );
1341+ testSerialization (type );
1342+ type .getSuperType ();
1343+ type .getInterfaces ();
1344+ type .getGenerics ();
1345+ type .hasUnresolvableGenerics ();
1346+ testSerialization (type );
1347+ type .getSuperType ();
1348+ type .getInterfaces ();
1349+ type .getGenerics ();
1350+ type .hasUnresolvableGenerics ();
1351+ testSerialization (type );
1352+ }
1353+
13381354 @ Test
13391355 void canResolveVoid () {
13401356 ResolvableType type = ResolvableType .forClass (void .class );
You can’t perform that action at this time.
0 commit comments