You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Andrey Gura (JIRA)" <ji...@apache.org> on 2017/09/21 15:49:00 UTC
[jira] [Commented] (IGNITE-6470) Wrong casting of long value to int
leads to incorrect results
[ https://issues.apache.org/jira/browse/IGNITE-6470?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16174981#comment-16174981 ]
Andrey Gura commented on IGNITE-6470:
-------------------------------------
Fixed and merged to master branch.
> 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)