rombert commented on PR #61: URL: https://github.com/apache/sling-org-apache-sling-models-impl/pull/61#issuecomment-2473124538
> > Right, but you don't have the java.lang.Record class on Java 11, right? What I'm saying is that you can get by reflection the "java.lang.Class.isRecord" method. If it fails, records are not supported and if it works they are. > > I added an even simpler check - we look at the runtime version. Records are supported starting with Java 14. WDYT about relying on the JRE info? I think this can get complicated because Records are available as of Java 14 as a preview feature and delivered in 16. https://openjdk.org/jeps/395 I would got for runtime detection is the `Class.isRecord` method and try to get a hold of it only once. -- 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]
