Skip to content

Commit

Permalink
Assert instead of checkArgument
Browse files Browse the repository at this point in the history
  • Loading branch information
erm-g committed Oct 3, 2024
1 parent 0fec530 commit 435e95a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/io/grpc/internal/SpiffeUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,7 @@ private static List<X509Certificate> extractCert(List<Map<String, ?>> keysNode,
Collection<? extends Certificate> certs = CertificateFactory.getInstance("X509")
.generateCertificates(stream);
X509Certificate[] certsArray = certs.toArray(new X509Certificate[0]);
checkArgument(certsArray.length == 1, "Unexpected size of certsArray: " +
certsArray.length);
assert certsArray.length == 1;
result.add(certsArray[0]);
} catch (CertificateException e) {
throw new IllegalArgumentException(String.format("Certificate can't be parsed. Certificate "
Expand Down

0 comments on commit 435e95a

Please sign in to comment.