Skip to content

Commit e8c1981

Browse files
committed
Fix JavaDoc
1 parent 92aaca1 commit e8c1981

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/EnvVarIDTokenSource.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public EnvVarIDTokenSource(String envVarName, Environment env) {
3535
* @throws IllegalArgumentException if the environment variable name is null or empty, or the
3636
* environment is null.
3737
* @throws DatabricksException if the environment variable is not set or is empty.
38+
* @throws NullPointerException if the environment variable name is null.
39+
* @throws ClassCastException if the environment variable name is not a String.
3840
*/
3941
@Override
4042
public IDToken getIDToken(String audience) {

databricks-sdk-java/src/main/java/com/databricks/sdk/core/oauth/FileIDTokenSource.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,18 @@ public IDToken getIDToken(String audience) {
7676
throw new DatabricksException("Invalid file path: " + filePath, e);
7777
}
7878

79+
boolean isFileExists;
7980
try {
80-
if (!Files.exists(path)) {
81-
throw new DatabricksException(String.format(ERROR_FILE_NOT_FOUND, filePath));
82-
}
81+
isFileExists = Files.exists(path);
8382
} catch (SecurityException e) {
8483
throw new DatabricksException(
8584
String.format(ERROR_SECURITY_CHECK, filePath, e.getMessage()), e);
8685
}
8786

87+
if (!isFileExists) {
88+
throw new DatabricksException(String.format(ERROR_FILE_NOT_FOUND, filePath));
89+
}
90+
8891
List<String> rawLines;
8992
try {
9093
rawLines = Files.readAllLines(path, StandardCharsets.UTF_8);

0 commit comments

Comments
 (0)