File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
databricks-sdk-java/src/main/java/com/databricks/sdk/core Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -63,16 +63,12 @@ public OAuthHeaderFactory configure(DatabricksConfig config) {
6363 }
6464
6565 /**
66- * Null-safe check for the azureUseMsi config flag. The underlying field is a boxed Boolean, but
67- * the getter auto-unboxes to primitive boolean, which would NPE when the field is null. This
68- * helper treats null as false.
66+ * Null-safe check for the azureUseMsi config flag. The underlying field is a boxed Boolean, so we
67+ * avoid auto-unboxing which would NPE when the field is null.
6968 */
7069 private static boolean isAzureUseMsi (DatabricksConfig config ) {
71- try {
72- return config .getAzureUseMsi ();
73- } catch (NullPointerException e ) {
74- return false ;
75- }
70+ Boolean flag = config .getAzureUseMsi ();
71+ return flag != null && flag ;
7672 }
7773
7874 /**
Original file line number Diff line number Diff line change @@ -504,7 +504,7 @@ public DatabricksConfig setAzureWorkspaceResourceId(String azureWorkspaceResourc
504504 return this ;
505505 }
506506
507- public boolean getAzureUseMsi () {
507+ public Boolean getAzureUseMsi () {
508508 return azureUseMsi ;
509509 }
510510
You can’t perform that action at this time.
0 commit comments