raducotescu commented on code in PR #61:
URL:
https://github.com/apache/sling-org-apache-sling-models-impl/pull/61#discussion_r1839912303
##########
src/main/java/org/apache/sling/models/impl/ReflectionUtil.java:
##########
@@ -34,6 +34,18 @@
*/
public final class ReflectionUtil {
+ static Class<?> recordType;
+
+ static {
+ try {
+ recordType = Class.forName("java.lang.Record");
+ } catch (ClassNotFoundException e) {
+ // this happens when running with Java11, which is supported, but
+ // of course does not have support for Record types
+ recordType = null;
Review Comment:
> Additionally nice to have would be, refactoring the supported JDK
feature/classes logic into a separate class and implementing caching to
minimize repeated null checks and isAssignableFrom calls during serialization,
especially when handling large numbers of objects, could be a useful
performance optimization. (but can be ignored if we are not facing significant
performance degradation :) )
I have started that in
[0a391ba](https://github.com/apache/sling-org-apache-sling-models-impl/pull/61/commits/0a391ba113e87d62579986bc5f4a30bd37985d49).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]