Skip to content

Commit

Permalink
Use ClassValue and restore default constructor for backwards compat…
Browse files Browse the repository at this point in the history
…ibility
  • Loading branch information
theigl committed Dec 16, 2022
1 parent e3145b2 commit d30570a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ public class RecordSerializer<T> extends ImmutableSerializer<T> {
GET_TYPE = getType;
}

private static final ClassValue<Constructor<?>> CONSTRUCTOR = new ClassValue<>() {
private static final ClassValue<Constructor<?>> CONSTRUCTOR = new ClassValue<Constructor<?>>() {
protected Constructor<?> computeValue(Class<?> clazz) {
final RecordComponent[] components = recordComponents(clazz, Comparator.comparing(RecordComponent::index));
return getCanonicalConstructor(clazz, components);
}
};
private static final ClassValue<RecordComponent[]> RECORD_COMPONENTS = new ClassValue<>() {
private static final ClassValue<RecordComponent[]> RECORD_COMPONENTS = new ClassValue<RecordComponent[]>() {
protected RecordComponent[] computeValue(Class<?> type) {
return recordComponents(type, Comparator.comparing(RecordComponent::name));
}
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit d30570a

Please sign in to comment.