Use long instead of integer #1085
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello colleagues,
I found a problem with the cf-java-client.
If you create an application with more than 2GB of memory/disk_quota and try to get the process statistics for this application the JSON parsing fails because the controller returns "memory/disk_quota" in bytes and exceeds the integer limits.
Check:
Numeric value (2147483648) out of range of int (-2147483648 - 2147483647)
at [Source: (byte[])"{
"resources": [
{
"type": "web",
"index": 0,
"state": "RUNNING",
"usage": {
"time": "2021-01-15T13:46:43+00:00",
"cpu": 0.0,
"mem": 285628069,
"disk": 250437632
},
"host": "10.0.137.7",
"uptime": 2,
"mem_quota": 2147483648,
"disk_quota": 1073741824,
"fds_quota": 16384,
"isolation_segment": null,
"details": null,
"instance_ports": [
{
"external": 61028,
"[truncated 1073 bytes]; line: 15, column: 30] (through reference chain: org.cloudfoundry.client.v3.applications.GetApplicationProcessStatisticsResponse$Json["resources"]->java.util.ArrayList[0]->org.cloudfoundry.client.v3.processes.ProcessStatisticsResource$Json["mem_quota"])
This fix is pretty simple and I would be happy to contribute it.