LuciferYang commented on code in PR #259:
URL: https://github.com/apache/commons-crypto/pull/259#discussion_r1367939088


##########
src/main/java/org/apache/commons/crypto/random/CryptoRandomFactory.java:
##########
@@ -206,6 +206,18 @@ public static CryptoRandom getCryptoRandom(final 
Properties props)
                 } else {
                     throw initializerError;
                 }
+            } catch (final NoClassDefFoundError noClassDefFoundError) {
+                Throwable initializerError = noClassDefFoundError.getCause();

Review Comment:
   There are some differences here between Java 8/11 and Java 17/21:
   - Java 8/11: Here it will catch `NoClassDefFoundError`, but 
`NoClassDefFoundError.getCause` is `null`.
   - Java 17/21: Here it will catch `NoClassDefFoundError`, and  
`NoClassDefFoundError.getCause` is `ExceptionInInitializerError`, but 
`ExceptionInInitializerError.getCause` is null
   
   So the check way here is a bit tricky, do you have any better suggestions? 
@garydgregory 
   
   
   



-- 
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]

Reply via email to