Re: RFR: 8265474: Dubious 'null' assignment in CompactByteArray.expand

2021-07-23 Thread Naoto Sato
On Wed, 23 Dec 2020 16:06:30 GMT, Andrey Turbanov 
 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.

Yes, it does.

-

Marked as reviewed by naoto (Reviewer).

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


Re: RFR: 8265474: Dubious 'null' assignment in CompactByteArray.expand

2021-07-23 Thread Alan Bateman
On Wed, 23 Dec 2020 16:06:30 GMT, Andrey Turbanov 
 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 cleanup looks okay, @naotoj?

-

Marked as reviewed by alanb (Reviewer).

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


Re: RFR: 8265474: Dubious 'null' assignment in CompactByteArray.expand

2021-06-14 Thread Andrey Turbanov
On Wed, 23 Dec 2020 16:06:30 GMT, Andrey Turbanov 
 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.

Let's keep open this PR with cleanup.

-

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


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

2021-04-25 Thread Andrey Turbanov
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.

-

Commit messages:
 - 8265474: Dubious 'null' assignment in CompactByteArray.expand
 - [PATCH] Remove dubious 'null' assignment to CompactByteArray.values

Changes: https://git.openjdk.java.net/jdk/pull/1880/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=1880=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8265474
  Stats: 9 lines in 1 file changed: 0 ins; 6 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1880.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1880/head:pull/1880

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