Skip to content

Commit d2f33ce

Browse files
slandelleretronym
authored andcommitted
[asm-cherry-pick] Fill exception message for max String literal length
Gatling compiles Scala classes on the fly with Zinc. Be it a program bug or a user error, some Strings sometimes end up being longer than the maximum String length. It would be nice if we could get an Exception with the proper message. I guess there's the same issue with maximum file size and maximum method size, will check.
1 parent a6a43f7 commit d2f33ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/scala/tools/asm/ByteVector.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ public ByteVector putLong(final long longValue) {
242242
public ByteVector putUTF8(final String stringValue) {
243243
int charLength = stringValue.length();
244244
if (charLength > 65535) {
245-
throw new IllegalArgumentException();
245+
throw new IllegalArgumentException("Maximum String literal length exceeded");
246246
}
247247
int currentLength = length;
248248
if (currentLength + 2 + charLength > data.length) {

0 commit comments

Comments
 (0)