{"action":"created","issue":{"url":"https://api.github.com/repos/ethereum/ethereumj/issues/706","repository_url":"https://api.github.com/repos/ethereum/ethereumj","labels_url":"https://api.github.com/repos/ethereum/ethereumj/issues/706/labels{/name}","comments_url":"https://api.github.com/repos/ethereum/ethereumj/issues/706/comments","events_url":"https://api.github.com/repos/ethereum/ethereumj/issues/706/events","html_url":"https://github.com/ethereum/ethereumj/issues/706","id":202675639,"number":706,"title":"Make DataWord immutable ","user":{"login":"Nashatyrev","id":8173857,"avatar_url":"https://avatars1.githubusercontent.com/u/8173857?v=3","gravatar_id":"","url":"https://api.github.com/users/Nashatyrev","html_url":"https://github.com/Nashatyrev","followers_url":"https://api.github.com/users/Nashatyrev/followers","following_url":"https://api.github.com/users/Nashatyrev/following{/other_user}","gists_url":"https://api.github.com/users/Nashatyrev/gists{/gist_id}","starred_url":"https://api.github.com/users/Nashatyrev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nashatyrev/subscriptions","organizations_url":"https://api.github.com/users/Nashatyrev/orgs","repos_url":"https://api.github.com/users/Nashatyrev/repos","events_url":"https://api.github.com/users/Nashatyrev/events{/privacy}","received_events_url":"https://api.github.com/users/Nashatyrev/received_events","type":"User","site_admin":false},"labels":[{"id":110205032,"url":"https://api.github.com/repos/ethereum/ethereumj/labels/refactor","name":"refactor","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-01-23T22:56:13Z","updated_at":"2017-03-17T02:05:50Z","closed_at":null,"body":"Mutable `DataWord` introduces wide possibilities for hardly debugable issues while performance gains are not evident in the current implementation"},"comment":{"url":"https://api.github.com/repos/ethereum/ethereumj/issues/comments/287246701","html_url":"https://github.com/ethereum/ethereumj/issues/706#issuecomment-287246701","issue_url":"https://api.github.com/repos/ethereum/ethereumj/issues/706","id":287246701,"user":{"login":"arsalankhalid","id":5307218,"avatar_url":"https://avatars1.githubusercontent.com/u/5307218?v=3","gravatar_id":"","url":"https://api.github.com/users/arsalankhalid","html_url":"https://github.com/arsalankhalid","followers_url":"https://api.github.com/users/arsalankhalid/followers","following_url":"https://api.github.com/users/arsalankhalid/following{/other_user}","gists_url":"https://api.github.com/users/arsalankhalid/gists{/gist_id}","starred_url":"https://api.github.com/users/arsalankhalid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arsalankhalid/subscriptions","organizations_url":"https://api.github.com/users/arsalankhalid/orgs","repos_url":"https://api.github.com/users/arsalankhalid/repos","events_url":"https://api.github.com/users/arsalankhalid/events{/privacy}","received_events_url":"https://api.github.com/users/arsalankhalid/received_events","type":"User","site_admin":false},"created_at":"2017-03-17T02:05:50Z","updated_at":"2017-03-17T02:05:50Z","body":"What about all the setters in the class? Would they need to be abstracted into a mutable class? \r\nI.e: \r\n\r\n// TODO: improve with no BigInteger\r\n    public void sub(DataWord word) {\r\n        BigInteger result = value().subtract(word.value());\r\n        this.data = ByteUtil.copyToArray(result.and(MAX_VALUE));\r\n    }\r\n\r\n    // TODO: improve with no BigInteger\r\n    public void exp(DataWord word) {\r\n        BigInteger result = value().modPow(word.value(), _2_256);\r\n        this.data = ByteUtil.copyToArray(result);\r\n\r\nIt seems like we're actually setting the values of this.data, so the class simply can't be made immutable by adding final and privatizing the object's instances. \r\n\r\nDo you follow what I'm saying, or am I just totally wrong here? \r\n\r\nCheers!"}}
{"actor":{"display_login":"arsalankhalid"}}