kpm1985 commented on issue #987: Possible misleading calculation of 
notifications size in the queue is fixed.
URL: https://github.com/apache/fluo/pull/987#issuecomment-353683489
 
 
   Humble point: If the intent is to guard against overflow, it should be cast
   to long before any arithmetic happens. If arithmetic happens on ints and
   they overflow and THEN are cast to long it isn't helpful.
   
   On Fri, Dec 22, 2017 at 2:12 PM, Furkan KAMACI <[email protected]>
   wrote:
   
   > *@kamaci* commented on this pull request.
   > ------------------------------
   >
   > In modules/core/src/main/java/org/apache/fluo/core/worker/
   > NotificationProcessor.java
   > <https://github.com/apache/fluo/pull/987#discussion_r158563969>:
   >
   > > @@ -77,8 +77,8 @@ public Integer getValue() {
   >
   >      private long size(RowColumn rowCol) {
   >        Column col = rowCol.getColumn();
   > -      return rowCol.getRow().length() + col.getFamily().length() + 
col.getQualifier().length()
   > -          + col.getVisibility().length();
   > +      return (long) rowCol.getRow().length() + col.getFamily().length()
   >
   > @keith-turner <https://github.com/keith-turner> Exactly! Expression is
   > evaluated as int and than converted to long which may conclude with an
   > undesired result.
   >
   > ?
   > You are receiving this because you are subscribed to this thread.
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/fluo/pull/987#discussion_r158563969>, or mute
   > the thread
   > 
<https://github.com/notifications/unsubscribe-auth/Acg-LJgqbmnpxTCaEHwgprUsTqdICdOLks5tDCk3gaJpZM4RLbnO>
   > .
   >
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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

Reply via email to