Skip to content

Commit

Permalink
Restore constant field for max array length to fix tests
Browse files Browse the repository at this point in the history
Follow-up #9961
  • Loading branch information
niloc132 committed May 31, 2024
1 parent f7ffe6d commit a1d21a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit a1d21a1

Please sign in to comment.