Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore constant field for max array length to fix tests #9963

Merged
merged 1 commit into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ public final class ServerSerializationStreamWriter extends
* array literals.
*/
public static class LengthConstrainedArray {
public static final int MAXIMUM_ARRAY_LENGTH_DEFAULT = 1 << 15;
private static final String POSTLUDE = "])";
private static final String PRELUDE = "].concat([";

private final StringBuffer buffer;
private final int maximumArrayLength = Integer.getInteger("gwt.rpc.maxPayloadChunkSize", 1 << 15);
private final int maximumArrayLength = Integer.getInteger("gwt.rpc.maxPayloadChunkSize",
MAXIMUM_ARRAY_LENGTH_DEFAULT);
private int count = 0;
private boolean needsComma = false;
private int total = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void testVersion8Fallbacks() {

// Fallbacks to 7 if array size reached maximum
int maxArrayLength =
ServerSerializationStreamWriter.LengthConstrainedArray.MAXIMUM_ARRAY_LENGTH + 100;
ServerSerializationStreamWriter.LengthConstrainedArray.MAXIMUM_ARRAY_LENGTH_DEFAULT + 100;
writer = new ServerSerializationStreamWriter(null, 8);
for (int i = 0; i < maxArrayLength; i++) {
writer.writeInt(i);
Expand Down