sagarmiglani commented on code in PR #61:
URL:
https://github.com/apache/sling-org-apache-sling-models-impl/pull/61#discussion_r1839439440
##########
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:
IMO, It would be beneficial to include a log indicating whether Records are
supported in the current setup to enhance visibility and traceability.
_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 :) )_
--
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]