mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8265474: Dubious 'null' assignment in CompactByteArray.expand
Reviewed-by: alanb, naoto
This commit is contained in:
parent
515113d858
commit
ee5536183a
1 changed files with 3 additions and 9 deletions
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue