[ 
https://issues.apache.org/jira/browse/ARTEMIS-2320?focusedWorklogId=234201&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-234201
 ]

ASF GitHub Bot logged work on ARTEMIS-2320:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 28/Apr/19 16:16
            Start Date: 28/Apr/19 16:16
    Worklog Time Spent: 10m 
      Work Description: jdanekrh commented on pull request #2650:  ARTEMIS-2320 
Multiple math-related fixes
URL: https://github.com/apache/activemq-artemis/pull/2650#discussion_r279201353
 
 

 ##########
 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:
   It may change semantics, depending on how large the variables are. You are 
adding together two ints, then assigning to long. Without the cast, you can get 
overflow on the int range, before you assign to that long. (Which is what the 
IntLongMath warning is about).
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 234201)
    Time Spent: 3h 20m  (was: 3h 10m)

> Upgrade errorprone compiler dependency to 2.3.3 and review the new warnings
> ---------------------------------------------------------------------------
>
>                 Key: ARTEMIS-2320
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2320
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>    Affects Versions: 2.7.0
>            Reporter: Jiri Daněk
>            Priority: Minor
>          Time Spent: 3h 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to