Skip to content

Commit 6093ca0

Browse files
authored
Merge pull request #424 from microsoftgraph/bugfix/arithmetic-overflow
bugfix/arithmetic-overflow
2 parents 0a82540 + e1fc81f commit 6093ca0

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.configuration.updateBuildConfiguration": "interactive"
3+
}

src/main/java/com/microsoft/graph/requests/extensions/ChunkedUploadRequest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class ChunkedUploadRequest {
3131
/**
3232
* The seconds for retry delay.
3333
*/
34-
private static final int RETRY_DELAY = 2 * 1000;
34+
private static final long RETRY_DELAY = 2000L; // 2 seconds
3535

3636
/**
3737
* The chunk data sent to the server.
@@ -46,12 +46,12 @@ public class ChunkedUploadRequest {
4646
/**
4747
* The max retry for a single request.
4848
*/
49-
private final int maxRetry;
49+
private final long maxRetry;
5050

5151
/**
5252
* The retry counter.
5353
*/
54-
private int retryCount;
54+
private long retryCount;
5555

5656
/**
5757
* Construct the ChunkedUploadRequest
@@ -75,8 +75,8 @@ public ChunkedUploadRequest(final String requestUrl,
7575
final long totalLength) {
7676
this.data = new byte[chunkSize];
7777
System.arraycopy(chunk, 0, this.data, 0, chunkSize);
78-
this.retryCount = 0;
79-
this.maxRetry = maxRetry;
78+
this.retryCount = 0L;
79+
this.maxRetry = (long)maxRetry;
8080
this.baseRequest = new BaseRequest(requestUrl, client, options, ChunkedUploadResult.class) {
8181
};
8282
this.baseRequest.setHttpMethod(HttpMethod.PUT);

0 commit comments

Comments
 (0)