[
https://issues.apache.org/jira/browse/IGNITE-4823?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15925702#comment-15925702
]
ASF GitHub Bot commented on IGNITE-4823:
----------------------------------------
GitHub user daradurvs opened a pull request:
https://github.com/apache/ignite/pull/1624
IGNITE-4823
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/daradurvs/ignite ignite-4823
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ignite/pull/1624.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1624
----
commit 69f9bc93d59d736c518279f60e14b4c7a85a06be
Author: Vyacheslav Daradur <[email protected]>
Date: 2017-03-15T07:56:43Z
ignite-4823: unit-tests for whole SpringCache class were added
commit 5c6373900f8a51f7014ad428edb18cc6a5b8873f
Author: Vyacheslav Daradur <[email protected]>
Date: 2017-03-15T07:57:21Z
ignite-4823: putIfAbsent-method implementation was fixed
----
> SpringCache#putIfAbsent - wrong implementation
> ----------------------------------------------
>
> Key: IGNITE-4823
> URL: https://issues.apache.org/jira/browse/IGNITE-4823
> Project: Ignite
> Issue Type: Bug
> Components: cache
> Reporter: Vyacheslav Daradur
> Assignee: Vyacheslav Daradur
>
> *Current implementation:*
> {code}
> Object old;
> if (val == null)
> old = cache.withSkipStore().putIfAbsent(key, NULL);
> else
> old = cache.putIfAbsent(key, val);
> return old != null ? fromValue(old) : null;
> {code}
> cache.putIfAbsent(key, val) - return boolean, not cached value
> *Excepted behavior (according to the Spring-docs)*
> {code}
> Object existingValue = cache.get(key);
> if (existingValue == null) {
> cache.put(key, value);
> return null;
> } else {
> return existingValue;
> }
> {code}
> 1. Need to fix implementation
> 2. Cover SpringCache class with unit-tests
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)