8265474: Dubious 'null' assignment in CompactByteArray.expand

Reviewed-by: alanb, naoto
This commit is contained in:
Andrey Turbanov 2021-07-26 16:31:13 +00:00 committed by Naoto Sato
parent 515113d858
commit ee5536183a

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -129,7 +129,7 @@ public final class CompactByteArray implements Cloneable {
{
if (isCompact)
expand();
values[(int)index] = value;
values[index] = value;
touchBlock(index >> BLOCKSHIFT, value);
}
@ -326,17 +326,11 @@ public final class CompactByteArray implements Cloneable {
for (i = 0; i < INDEXCOUNT; ++i) {
indices[i] = (short)(i<<BLOCKSHIFT);
}
values = null;
values = tempArray;
isCompact = false;
}
}
private byte[] getArray()
{
return values;
}
private static final int BLOCKSHIFT =7;
private static final int BLOCKCOUNT =(1<<BLOCKSHIFT);
private static final int INDEXSHIFT =(16-BLOCKSHIFT);
@ -347,4 +341,4 @@ public final class CompactByteArray implements Cloneable {
private short indices[];
private boolean isCompact;
private int[] hashes;
};
}