File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/com/esotericsoftware/kryo Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -558,7 +558,7 @@ public Registration getRegistration (Class type) {
558558
559559 Registration registration = classResolver .getRegistration (type );
560560 if (registration == null ) {
561- if (Proxy . isProxyClass (type )) {
561+ if (isProxy (type )) {
562562 // If a Proxy class, treat it like an InvocationHandler because the concrete class for a proxy is generated.
563563 registration = getRegistration (InvocationHandler .class );
564564 } else if (!type .isEnum () && Enum .class .isAssignableFrom (type ) && type != Enum .class ) {
@@ -1263,6 +1263,16 @@ public boolean isClosure (Class type) {
12631263 return type .getName ().indexOf ('/' ) >= 0 ;
12641264 }
12651265
1266+ /** Returns true if the specified type is a proxy. When true, Kryo uses {@link InvocationHandler} instead of the specified type
1267+ * to find the class {@link Registration}.
1268+ * <p>
1269+ * This can be overridden to support alternative proxy checks. The default implementation delegates to
1270+ * {@link Proxy#isProxyClass(Class)}. */
1271+ public boolean isProxy (Class type ) {
1272+ if (type == null ) throw new IllegalArgumentException ("type cannot be null." );
1273+ return Proxy .isProxyClass (type );
1274+ }
1275+
12661276 /** Tracks the generic type arguments and actual classes for type variables in the object graph during seralization.
12671277 * <p>
12681278 * When serializing a type with a single type parameter, {@link Generics#nextGenericClass() nextGenericClass} will return the
You can’t perform that action at this time.
0 commit comments