JackBuggins commented on code in PR #4537:
URL: https://github.com/apache/hadoop/pull/4537#discussion_r953550055


##########
hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/util/PlatformName.java:
##########
@@ -45,9 +45,23 @@ public class PlatformName {
 
   /**
    * A public static variable to indicate the current java vendor is
-   * IBM java or not.
+   * IBM and the type is Java Technology Edition which provides its
+   * own implementations of many security packages and Cipher suites.
+   * Note that these are not provided in Semeru runtimes:
+   * See https://developer.ibm.com/languages/java/semeru-runtimes/
+   * The class used is present in any supported IBM JTE Runtimes.
    */
-  public static final boolean IBM_JAVA = JAVA_VENDOR_NAME.contains("IBM");
+  public static final boolean IBM_JAVA = JAVA_VENDOR_NAME.contains("IBM") &&
+    hasClass("com.ibm.security.auth.module.JAASLoginModule");
+
+  private static boolean hasClass(String className) {
+    try {
+      Thread.currentThread().getContextClassLoader().loadClass(className);
+      return true;
+    } catch(ClassNotFoundException ignored) {

Review Comment:
   Thanks @steveloughran - Would you suggest we are catching the generic 
Exception instead?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to