[jdk11u-dev] RFR: 8337066: Repeated call of StringBuffer.reverse with double byte string returns wrong result

Radek Čáp duke at openjdk.org
Mon Nov 18 14:00:59 UTC 2024


On Fri, 8 Nov 2024 12:44:55 GMT, Radek Čáp <duke at openjdk.org> wrote:

> Backport for https://bugs.openjdk.org/browse/JDK-8337066
> 
> When calling StringBuffer/StringBuilder.reverse with 2byte string repeatedly, the API returns wrong result.
> 
> This is a clean backport.

I run tier1 locally and it's passing:

==============================
Test summary
==============================
   TEST                                              TOTAL  PASS  FAIL ERROR   
   jtreg:test/hotspot/jtreg:tier1                     1497  1497     0     0   
   jtreg:test/jdk:tier1                               1898  1898     0     0   
   jtreg:test/langtools:tier1                         3937  3937     0     0   
   jtreg:test/nashorn:tier1                              0     0     0     0   
   jtreg:test/jaxp:tier1                                 0     0     0     0   
==============================
TEST SUCCESS

Finished building target 'run-test-tier1' in configuration 'linux-x86_64-normal-server-release'


I had issues with running the test with 
`make run-test TEST="jtreg:test/hotspot/jtreg/compiler/controldependency/TestAntiDependencyForPinnedLoads.java"`

because it leads to some kind of fallback to US-ASCII:

test/8337066/test/hotspot/jtreg/compiler/controldependency/TestAntiDependencyForPinnedLoads.java:39: error: unmappable character (0xE5) for encoding US-ASCII
      String str = "YYYY\ufffd\ufffd\ufffdMM\ufffd\ufffd\ufffdDD\ufffd\ufffd\ufffd";


A manual jtreg run pass the test.

-------------

PR Comment: https://git.openjdk.org/jdk11u-dev/pull/2961#issuecomment-2483125840


More information about the jdk-updates-dev mailing list