Skip to content

Commit b32dc0e

Browse files
internal changes
PiperOrigin-RevId: 853852987
1 parent 0bc4192 commit b32dc0e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

java/core/src/test/java/com/google/protobuf/LazyStringArrayListTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ public void testConversionBackAndForth() {
100100
assertThat(cPrime).isNotSameInstanceAs(STRING_C);
101101
assertThat(cPrime).isEqualTo(STRING_C);
102102

103-
// String c and c should stay the same once cached.
104-
assertThat(list.get(1)).isSameInstanceAs(bPrime);
105-
assertThat(list.get(2)).isSameInstanceAs(cPrime);
103+
// Unlike ByteString, String b and c are not cached.
104+
assertThat(list.get(1)).isNotSameInstanceAs(bPrime);
105+
assertThat(list.get(2)).isNotSameInstanceAs(cPrime);
106106

107-
// ByteString needs to be computed from string for both a and b
107+
// ByteString does not need to be computed from string as we cache ByteString.
108108
ByteString aPrimeByteString = list.getByteString(0);
109109
assertThat(aPrimeByteString).isEqualTo(BYTE_STRING_A);
110110
ByteString bPrimeByteString = list.getByteString(1);
111-
assertThat(bPrimeByteString).isNotSameInstanceAs(BYTE_STRING_B);
111+
assertThat(bPrimeByteString).isSameInstanceAs(BYTE_STRING_B);
112112
assertThat(list.getByteString(1)).isEqualTo(BYTE_STRING_B);
113113

114114
// Once cached, ByteString should stay cached.

0 commit comments

Comments
 (0)