Closed
Description
Affects: 6.*.*
The following test fails:
import static org.junit.jupiter.api.Assertions.*;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import org.junit.jupiter.api.Test;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.DefaultDataBufferFactory;
class DefaultDataBufferStringTransformationTest {
@Test
void test() {
Charset charset = StandardCharsets.UTF_8;
DataBuffer dataBuffer = DefaultDataBufferFactory.sharedInstance.allocateBuffer(DefaultDataBufferFactory.DEFAULT_INITIAL_CAPACITY);
String name = "Müller";
int repeatCount = 19;
for(int i = 0; i < repeatCount; i++) {
dataBuffer.write(name, charset);
}
String expected = name.repeat(repeatCount);
String result = dataBuffer.toString(charset);
assertEquals(expected, result);
}
}
May be it has something to do with this issue.