Review comments
diff --git a/common/src/jni/main/cpp/conscrypt/native_crypto.cc b/common/src/jni/main/cpp/conscrypt/native_crypto.cc
index feeb444..21c7049 100644
--- a/common/src/jni/main/cpp/conscrypt/native_crypto.cc
+++ b/common/src/jni/main/cpp/conscrypt/native_crypto.cc
@@ -3994,8 +3994,9 @@
JNI_TRACE("GENERAL_NAME_to_jobject(%p) => IPv4 %s", gen, buffer);
return env->NewStringUTF(buffer);
} else if (ASN1_STRING_length(gen->d.ip) == 16) {
- // IPv6 addresses are returned as eight 16-bit components. Note this does not quite
- // match inet_ntop, which will abbreviate "0:0:0:0:0:0:0:1" as "::1".
+ // IPv6 addresses are returned as eight 16-bit components. Note that Java requires
+ // the long form syntax (e.g. "0:0:0:0:0:0:0:1"), while inet_ntop will abbreviate
+ // strings of zeros (e.g. "::1").
char buffer[8 * 4 + 7 + 1]; // 8 4-digit fields, 7 separators, and a NUL.
snprintf(buffer, sizeof(buffer), "%x:%x:%x:%x:%x:%x:%x:%x",
(uint16_t(data[0]) << 8) | data[1], (uint16_t(data[2]) << 8) | data[3],
diff --git a/common/src/test/java/org/conscrypt/java/security/cert/X509CertificateTest.java b/common/src/test/java/org/conscrypt/java/security/cert/X509CertificateTest.java
index c0c3d01..26a130c 100644
--- a/common/src/test/java/org/conscrypt/java/security/cert/X509CertificateTest.java
+++ b/common/src/test/java/org/conscrypt/java/security/cert/X509CertificateTest.java
@@ -34,6 +34,7 @@
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
+import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
@@ -338,7 +339,7 @@
// Although there is a natural order (the order in the certificate), Java's API returns a
// Collection, so there is no guarantee of the provider using a particular order. Normalize
// the order before comparing.
- result.sort(new Comparator<Pair<Integer, String>>() {
+ Collections.sort(result, new Comparator<Pair<Integer, String>>() {
@Override
public int compare(Pair<Integer, String> a, Pair<Integer, String> b) {
int cmp = a.getFirst().compareTo(b.getFirst());