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

Severin Gehwolf sgehwolf at openjdk.org
Tue Nov 19 11:46:03 UTC 2024


On Mon, 18 Nov 2024 17:22:22 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.
>
> Radek Čáp has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Backport 93b2aa48598ef26f645e673ad111885d2acd18ef

The test passes if the product code is reverted, but I see the same happened for the JDK 17 version. Only a few style issues to fix and this is good to go.

src/hotspot/share/opto/gcm.cpp line 688:

> 686:   worklist_store.push(initial_mem);
> 687:   worklist_visited.push(initial_mem);
> 688:   worklist_mem.push(NULL);

OK. The JDK 17u version has the `nullptr` vs `NULL` changes. Hence the patch is not deemed clean.

test/hotspot/jtreg/compiler/controldependency/TestAntiDependencyForPinnedLoads.java line 44:

> 42:       if (!revStr.equals("日DD月MM年YYYY")) throw new InternalError("FAIL");
> 43:     }
> 44:   }

Style: The JDK 17u patch has 4 space indent instead of 2. Please don't add changes like that in a backport. Use the same indentation as the JDK 17u patch.

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

PR Review: https://git.openjdk.org/jdk11u-dev/pull/2961#pullrequestreview-2445117981
PR Review Comment: https://git.openjdk.org/jdk11u-dev/pull/2961#discussion_r1848148650
PR Review Comment: https://git.openjdk.org/jdk11u-dev/pull/2961#discussion_r1848146806


More information about the jdk-updates-dev mailing list