This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new cbe177bb8 [KYUUBI #5961][FOLLOWUP] Prevent NPE when checking ticket
cache exists
cbe177bb8 is described below
commit cbe177bb879d9f897b91aec2973ea6680915246d
Author: Fei Wang <[email protected]>
AuthorDate: Tue Jan 16 12:09:26 2024 +0800
[KYUUBI #5961][FOLLOWUP] Prevent NPE when checking ticket cache exists
# :mag: Description
Followup #5961
```
scala> Files.exists(Paths.get(null))
<console>:14: error: ambiguous reference to overloaded definition,
both method get in class Paths of type (x$1: java.net.URI)java.nio.file.Path
and method get in class Paths of type (x$1: String, x$2:
String*)java.nio.file.Path
match argument types (Null) and expected result type java.nio.file.Path
Files.exists(Paths.get(null))
^
scala> Files.exists(Paths.get(""))
res0: Boolean = true
scala>
```
## Issue References ๐
This pull request fixes #
## Describe Your Solution ๐ง
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that are
required for this change.
## Types of changes :bookmark:
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
## Test Plan ๐งช
#### Behavior Without This Pull Request :coffin:
#### Behavior With This Pull Request :tada:
#### Related Unit Tests
---
# Checklist ๐
- [ ] This patch was not authored or co-authored using [Generative
Tooling](https://www.apache.org/legal/generative-tooling.html)
**Be nice. Be informative.**
Closes #5980 from turboFei/fix_npe.
Closes #5961
99d4a1695 [Fei Wang] fix npe
Authored-by: Fei Wang <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
---
.../org/apache/kyuubi/jdbc/hive/auth/KerberosAuthentication.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/auth/KerberosAuthentication.java
b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/auth/KerberosAuthentication.java
index 774569437..51999bed2 100644
---
a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/auth/KerberosAuthentication.java
+++
b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/auth/KerberosAuthentication.java
@@ -107,10 +107,10 @@ public class KerberosAuthentication {
if (StringUtils.isBlank(ticketCache)) {
ticketCache = System.getenv("KRB5CCNAME");
}
- if (!Files.exists(Paths.get(ticketCache))) {
- LOG.warn("TicketCache {} does not exist", ticketCache);
- }
if (StringUtils.isNotBlank(ticketCache)) {
+ if (!Files.exists(Paths.get(ticketCache))) {
+ LOG.warn("TicketCache {} does not exist", ticketCache);
+ }
optionsBuilder.put("ticketCache", ticketCache);
}
return createConfiguration(optionsBuilder);