Skip to content

Commit

Permalink
Change how IBM JDK is determined to fix tests and future-proof (#2150)
Browse files Browse the repository at this point in the history
* Changed isIBM util method to look for presence of a IBM file, in order to set isIBM, vs looking at name.

* Whoops, should be return not null, not return null

* Comment for catch block

* Remove added test files

* Changed JAASLoginModule to a more generic class.
  • Loading branch information
Jeffery-Wasty authored Aug 17, 2023
1 parent 6b2bc00 commit 671ac96
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/com/microsoft/sqlserver/jdbc/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ private Util() {
private static final Lock LOCK = new ReentrantLock();

static boolean isIBM() {
return SYSTEM_JRE.startsWith("IBM");
Class<?> clazz = null;
try {
clazz = Class.forName("com.ibm.lang.management.MemoryUsage");
} catch (ClassNotFoundException e) {
//We're using the try-catch to test for IBM jdk, no need to handle exception.
}
return null != clazz;
}

static String getJVMArchOnWindows() {
Expand Down

0 comments on commit 671ac96

Please sign in to comment.