mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8319882: SequenceLayout::toString throws ArithmeticException
Reviewed-by: mcimadamore
This commit is contained in:
parent
6b21ff61da
commit
c9657cad12
2 changed files with 16 additions and 1 deletions
|
@ -179,7 +179,7 @@ public final class SequenceLayoutImpl extends AbstractLayout<SequenceLayoutImpl>
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
boolean max = (Long.MAX_VALUE / elementLayout.byteSize()) == elemCount;
|
||||
boolean max = (Long.MAX_VALUE / Math.max(1, elementLayout.byteSize())) == elemCount;
|
||||
return decorateLayoutString(String.format("[%s:%s]",
|
||||
max ? "*" : elemCount, elementLayout));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue