Integrated: 8265474: Dubious 'null' assignment in CompactByteArray.expand

Andrey Turbanov github.com+741251+turbanoff at openjdk.java.net
Mon Jul 26 16:34:58 UTC 2021


On Wed, 23 Dec 2020 16:06:30 GMT, Andrey Turbanov <github.com+741251+turbanoff at openjdk.org> wrote:

> I propose to remove 'null' assignment of field CompactByteArray.values in `expand` method. In the next statement this field is overridden with another value - `tempArray`.
> This code was there from initial load of OpenJDK sources. I believe it was just leftovers from development phase of this class. There is no practical reason to assign `null` to non-volatile field and then overwrite it with another value.
> Also I've removed unused method `getArray`. I hope it's ok to cleanup such unused stuff in the same PR.

This pull request has now been integrated.

Changeset: ee553618
Author:    Andrey Turbanov <turbanoff at gmail.com>
Committer: Naoto Sato <naoto at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/ee5536183a9df90d1209d9effe5d2aa61d86abd3
Stats:     9 lines in 1 file changed: 0 ins; 6 del; 3 mod

8265474: Dubious 'null' assignment in CompactByteArray.expand

Reviewed-by: alanb, naoto

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

PR: https://git.openjdk.java.net/jdk/pull/1880


More information about the core-libs-dev mailing list