You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Ilya Kasnacheev (Jira)" <ji...@apache.org> on 2020/06/03 08:49:00 UTC

[jira] [Commented] (IGNITE-13104) Spring data 2.0 IgniteRepositoryImpl#deleteAllById contains wrong code

    [ https://issues.apache.org/jira/browse/IGNITE-13104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17124769#comment-17124769 ] 

Ilya Kasnacheev commented on IGNITE-13104:
------------------------------------------

I have added some code coments. Do you have MTCGA visa?

> Spring data 2.0 IgniteRepositoryImpl#deleteAllById contains wrong code
> ----------------------------------------------------------------------
>
>                 Key: IGNITE-13104
>                 URL: https://issues.apache.org/jira/browse/IGNITE-13104
>             Project: Ignite
>          Issue Type: Improvement
>          Components: springdata
>    Affects Versions: 2.8.1
>            Reporter: Alexey Kuznetsov
>            Assignee: Alexey Kuznetsov
>            Priority: Major
>             Fix For: 2.9
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> {code}
>     /** {@inheritDoc} */
>     @Override public void deleteAllById(Iterable<ID> ids) {
>         if (ids instanceof Set)
>             cache.removeAll((Set<ID>)ids);
>         if (ids instanceof Collection)
>             cache.removeAll(new HashSet<>((Collection<ID>)ids));
>         TreeSet<ID> keys = new TreeSet<>();
>         for (ID id : ids)
>             keys.add(id);
>         cache.removeAll(keys);
>     }
> {code}
> As you can see cache.removeAll may be executed THREE times in some situations.
> Also this method can throw ClassCast exception if ids collection contains objects that are not implement Comparable interface.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)