ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Gura (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-6470) Wrong casting of long value to int leads to incorrect results
Date Thu, 21 Sep 2017 15:35:01 GMT
Andrey Gura created IGNITE-6470:
-----------------------------------

             Summary: Wrong casting of long value to int leads to incorrect results
                 Key: IGNITE-6470
                 URL: https://issues.apache.org/jira/browse/IGNITE-6470
             Project: Ignite
          Issue Type: Bug
    Affects Versions: 2.2
            Reporter: Andrey Gura
            Assignee: Andrey Gura
             Fix For: 2.3


Wrong casting of long value to int leads to incorrect results:

{code:java}
    /** {@inheritDoc} */
    @Override public int pages() {
        if (!inited)
            return 0;
        
        // allocated.get() returns long value. We should cast it to int after division.
        return (int)((allocated.get() - headerSize()) / pageSize);
    }

{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message