Skip to content

Commit 844bbe9

Browse files
committed
refactored the metadata comparison to avoid objects refrence comparisions
1 parent 142e378 commit 844bbe9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

auth/src/main/java/io/grpc/auth/ClientAuthInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected void checkedStart(Listener<RespT> responseListener, Metadata headers)
7777
// JWT. However, today it does not cache JWT and so we won't bother tring to cache its
7878
// return value based on the URI.
7979
Map<String, List<String>> latestMetadata = getRequestMetadata(uri);
80-
if (lastMetadata == null || lastMetadata != latestMetadata) {
80+
if (lastMetadata.equals(null) || !Objects.equals(lastMetadata, latestMetadata)) {
8181
lastMetadata = latestMetadata;
8282
cached = toHeaders(lastMetadata);
8383
}

0 commit comments

Comments
 (0)