{"action":"created","issue":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/8149","repository_url":"https://api.github.com/repos/hazelcast/hazelcast","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/8149/labels{/name}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/8149/comments","events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/8149/events","html_url":"https://github.com/hazelcast/hazelcast/issues/8149","id":154275625,"number":8149,"title":"IAtomicReference#alter does not persist changes","user":{"login":"KIC","id":10957396,"avatar_url":"https://avatars.githubusercontent.com/u/10957396?v=3","gravatar_id":"","url":"https://api.github.com/users/KIC","html_url":"https://github.com/KIC","followers_url":"https://api.github.com/users/KIC/followers","following_url":"https://api.github.com/users/KIC/following{/other_user}","gists_url":"https://api.github.com/users/KIC/gists{/gist_id}","starred_url":"https://api.github.com/users/KIC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KIC/subscriptions","organizations_url":"https://api.github.com/users/KIC/orgs","repos_url":"https://api.github.com/users/KIC/repos","events_url":"https://api.github.com/users/KIC/events{/privacy}","received_events_url":"https://api.github.com/users/KIC/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Team:%20Core","name":"Team: Core","color":"109def"},{"url":"https://api.github.com/repos/hazelcast/hazelcast/labels/Type:%20Defect","name":"Type: Defect","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"jerrinot","id":158619,"avatar_url":"https://avatars.githubusercontent.com/u/158619?v=3","gravatar_id":"","url":"https://api.github.com/users/jerrinot","html_url":"https://github.com/jerrinot","followers_url":"https://api.github.com/users/jerrinot/followers","following_url":"https://api.github.com/users/jerrinot/following{/other_user}","gists_url":"https://api.github.com/users/jerrinot/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrinot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrinot/subscriptions","organizations_url":"https://api.github.com/users/jerrinot/orgs","repos_url":"https://api.github.com/users/jerrinot/repos","events_url":"https://api.github.com/users/jerrinot/events{/privacy}","received_events_url":"https://api.github.com/users/jerrinot/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/70","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.7","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/70/labels","id":1346433,"number":70,"title":"3.7","description":"","creator":{"login":"pveentjer","id":105243,"avatar_url":"https://avatars.githubusercontent.com/u/105243?v=3","gravatar_id":"","url":"https://api.github.com/users/pveentjer","html_url":"https://github.com/pveentjer","followers_url":"https://api.github.com/users/pveentjer/followers","following_url":"https://api.github.com/users/pveentjer/following{/other_user}","gists_url":"https://api.github.com/users/pveentjer/gists{/gist_id}","starred_url":"https://api.github.com/users/pveentjer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pveentjer/subscriptions","organizations_url":"https://api.github.com/users/pveentjer/orgs","repos_url":"https://api.github.com/users/pveentjer/repos","events_url":"https://api.github.com/users/pveentjer/events{/privacy}","received_events_url":"https://api.github.com/users/pveentjer/received_events","type":"User","site_admin":false},"open_issues":185,"closed_issues":497,"state":"open","created_at":"2015-10-09T12:16:13Z","updated_at":"2016-05-11T19:12:28Z","due_on":"2016-06-19T21:00:00Z","closed_at":null},"comments":6,"created_at":"2016-05-11T15:41:18Z","updated_at":"2016-05-12T05:04:51Z","closed_at":null,"body":"For some reason when I just want to alter an AtomicReference<MyObject> like so:\r\n\r\n```\r\n  ref.alter(node -> {\r\n            node.nextNodes[0] = lala;\r\n            node.nextKeys[0] = \"lala\";\r\n            return node;\r\n        });\r\n```\r\n\r\nthen nothing changes. A later get will still return the old object. But when i change this to alterAndGet\r\n\r\n```\r\n  ref.alterAndGet(node -> {\r\n            node.nextNodes[0] = lala;\r\n            node.nextKeys[0] = \"lala\";\r\n            return node;\r\n        });\r\n```\r\n\r\nthen everything works as expected. But in fact I do not want so send the whole object over wire, I just want to modify a property.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments/218661136","html_url":"https://github.com/hazelcast/hazelcast/issues/8149#issuecomment-218661136","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/8149","id":218661136,"user":{"login":"KIC","id":10957396,"avatar_url":"https://avatars.githubusercontent.com/u/10957396?v=3","gravatar_id":"","url":"https://api.github.com/users/KIC","html_url":"https://github.com/KIC","followers_url":"https://api.github.com/users/KIC/followers","following_url":"https://api.github.com/users/KIC/following{/other_user}","gists_url":"https://api.github.com/users/KIC/gists{/gist_id}","starred_url":"https://api.github.com/users/KIC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KIC/subscriptions","organizations_url":"https://api.github.com/users/KIC/orgs","repos_url":"https://api.github.com/users/KIC/repos","events_url":"https://api.github.com/users/KIC/events{/privacy}","received_events_url":"https://api.github.com/users/KIC/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T05:04:51Z","updated_at":"2016-05-12T05:04:51Z","body":"Hmmm ... I have tried to add an `equals() { return false; }` but it seems to be the only solution to make a new object. However does this mean with `apply` I am not writing to the original object and every update leads to a serialization of a potentially big object graph? Seems to be uncool :-) Could I configure that behavior?"}}