jdanekrh commented on a change in pull request #2650: ARTEMIS-2320 Multiple
math-related fixes
URL: https://github.com/apache/activemq-artemis/pull/2650#discussion_r279201613
##########
File path:
artemis-journal/src/main/java/org/apache/activemq/artemis/core/io/mapped/MappedSequentialFile.java
##########
@@ -110,7 +110,7 @@ public void open(int maxIO, boolean useExecutor) throws
IOException {
@Override
public boolean fits(int size) {
checkIsOpen();
- final long newPosition = this.mappedFile.position() + size;
+ final long newPosition = (long) this.mappedFile.position() + size;
final boolean hasRemaining = newPosition <= this.mappedFile.length();
Review comment:
```
jshell> Integer.MAX_VALUE + Integer.MAX_VALUE
$2 ==> -2
jshell> (long) Integer.MAX_VALUE + Integer.MAX_VALUE
$3 ==> 4294967294
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services