We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 567c688 commit 1f21da7Copy full SHA for 1f21da7
src/java.base/share/classes/java/lang/StringConcatHelper.java
@@ -1,5 +1,5 @@
1
/*
2
- * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
3
* Copyright (c) 2024, Alibaba Group Holding Limited. All Rights Reserved.
4
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5
*
@@ -52,6 +52,9 @@ static abstract class StringConcatBase {
52
byte coder = String.LATIN1;
53
for (String c : constants) {
54
length += c.length();
55
+ if (length < 0) {
56
+ throw new OutOfMemoryError("Total length of constants is out of range");
57
+ }
58
coder |= c.coder();
59
}
60
this.constants = constants;
0 commit comments