File tree Expand file tree Collapse file tree
java/core/src/test/java/com/google/protobuf Expand file tree Collapse file tree Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments