Skip to content
Permalink
Browse files
8265474: Dubious 'null' assignment in CompactByteArray.expand
Reviewed-by: alanb, naoto
  • Loading branch information
turbanoff authored and naotoj committed Jul 26, 2021
1 parent 515113d commit ee5536183a9df90d1209d9effe5d2aa61d86abd3
Showing 1 changed file 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 void setElementAt(char index, byte value)
{
if (isCompact)
expand();
values[(int)index] = value;
values[index] = value;
touchBlock(index >> BLOCKSHIFT, value);
}

@@ -326,17 +326,11 @@ private void expand()
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 @@ private byte[] getArray()
private short indices[];
private boolean isCompact;
private int[] hashes;
};
}

1 comment on commit ee55361

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on ee55361 Jul 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.