From d30570a906187297f2d3765f797ec5b10e7e0e44 Mon Sep 17 00:00:00 2001 From: Thomas Heigl Date: Fri, 16 Dec 2022 13:50:26 +0100 Subject: [PATCH] Use `ClassValue` and restore default constructor for backwards compatibility --- .../esotericsoftware/kryo/serializers/RecordSerializer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/esotericsoftware/kryo/serializers/RecordSerializer.java b/src/com/esotericsoftware/kryo/serializers/RecordSerializer.java index cdd5276ff..43b0754d8 100644 --- a/src/com/esotericsoftware/kryo/serializers/RecordSerializer.java +++ b/src/com/esotericsoftware/kryo/serializers/RecordSerializer.java @@ -68,13 +68,13 @@ public class RecordSerializer extends ImmutableSerializer { GET_TYPE = getType; } - private static final ClassValue> CONSTRUCTOR = new ClassValue<>() { + private static final ClassValue> CONSTRUCTOR = new ClassValue>() { protected Constructor computeValue(Class clazz) { final RecordComponent[] components = recordComponents(clazz, Comparator.comparing(RecordComponent::index)); return getCanonicalConstructor(clazz, components); } }; - private static final ClassValue RECORD_COMPONENTS = new ClassValue<>() { + private static final ClassValue RECORD_COMPONENTS = new ClassValue() { protected RecordComponent[] computeValue(Class type) { return recordComponents(type, Comparator.comparing(RecordComponent::name)); } @@ -203,7 +203,7 @@ Object getValue (Object recordObject) { return getter.invoke(recordObject); } catch (Exception t) { KryoException ex = new KryoException(t); - ex.addTrace("Could not retrieve record component value (" + recordType + ")"); + ex.addTrace("Could not retrieve record component value (" + recordType.getName() + ")"); throw ex; } }