Skip to content

Commit

Permalink
Add note about usage of StringBuilder for loading strings
Browse files Browse the repository at this point in the history
Co-authored-by: Ladislav Thon <lthon@redhat.com>
  • Loading branch information
geoand and Ladicek committed Apr 12, 2023
1 parent 7ff6379 commit 1e0b6ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/io/quarkus/gizmo/BytecodeCreatorImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,11 @@ ResultHandle getOutgoingResultHandle() {

}

/**
* Implementation detail: when the string to be loaded is larger than {@link BytecodeCreatorImpl#MAX_STRING_LENGTH},
* then a {@link StringBuilder} is used to construct the final String. This is done because strings constants cannot be larger
* than {@link BytecodeCreatorImpl#MAX_STRING_LENGTH}.
*/
@Override
public ResultHandle load(String val) {
Objects.requireNonNull(val);
Expand Down

0 comments on commit 1e0b6ec

Please sign in to comment.