{"action":"created","issue":{"url":"https://api.github.com/repos/EPICSTools/etherip/issues/24","repository_url":"https://api.github.com/repos/EPICSTools/etherip","labels_url":"https://api.github.com/repos/EPICSTools/etherip/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/EPICSTools/etherip/issues/24/comments","events_url":"https://api.github.com/repos/EPICSTools/etherip/issues/24/events","html_url":"https://github.com/EPICSTools/etherip/issues/24","id":359842444,"node_id":"MDU6SXNzdWUzNTk4NDI0NDQ=","number":24,"title":"Lambda in Protocol/Transaction class","user":{"login":"kodaman2","id":10265682,"node_id":"MDQ6VXNlcjEwMjY1Njgy","avatar_url":"https://avatars3.githubusercontent.com/u/10265682?v=4","gravatar_id":"","url":"https://api.github.com/users/kodaman2","html_url":"https://github.com/kodaman2","followers_url":"https://api.github.com/users/kodaman2/followers","following_url":"https://api.github.com/users/kodaman2/following{/other_user}","gists_url":"https://api.github.com/users/kodaman2/gists{/gist_id}","starred_url":"https://api.github.com/users/kodaman2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodaman2/subscriptions","organizations_url":"https://api.github.com/users/kodaman2/orgs","repos_url":"https://api.github.com/users/kodaman2/repos","events_url":"https://api.github.com/users/kodaman2/events{/privacy}","received_events_url":"https://api.github.com/users/kodaman2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-13T10:48:26Z","updated_at":"2018-09-13T14:15:30Z","closed_at":null,"author_association":"NONE","body":"Is there any particular reason why one class out of the whole project is using lambda?\r\nProject might reach more people that are still running in java 1.7\r\n\r\nThe only sole reason why the project doesn't compile in java 1.7 is because the lambda function which then gets converted to regular anonymous function, problem is LongBinaryOperation class doesn't exist in 1.7\r\n\r\nModified code, ran Transaction unittest and passed:\r\n```\r\nstatic long nextTransaction()\r\n    {\r\n\r\n        if(transaction.get() > 0xffffffffL){\r\n            transaction.set(1);\r\n        } else{\r\n            transaction.incrementAndGet();\r\n        }\r\n\r\n        return transaction.get();\r\n\r\n```\r\nOriginal code below:\r\n```\r\n\r\n        return transaction.incrementAndGet(1, new LongBinaryOperator() {\r\n            @Override\r\n            public long applyAsLong(long value, long plus) {\r\n                long result = value + plus;\r\n                if (result > 0xffffffffL)\r\n                    return 1;\r\n                return result;\r\n            }\r\n        });\r\n    }\r\n```\r\nI will test in the plc lab, anyways my usage doesn't require tons of transactions I highly doubt I will ever get to the max,I just need to read some tags for a backup utility I am building, and all our servers run on 1.7 and I don't foresee IT's updating anytime soon."},"comment":{"url":"https://api.github.com/repos/EPICSTools/etherip/issues/comments/421022753","html_url":"https://github.com/EPICSTools/etherip/issues/24#issuecomment-421022753","issue_url":"https://api.github.com/repos/EPICSTools/etherip/issues/24","id":421022753,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTAyMjc1Mw==","user":{"login":"kodaman2","id":10265682,"node_id":"MDQ6VXNlcjEwMjY1Njgy","avatar_url":"https://avatars3.githubusercontent.com/u/10265682?v=4","gravatar_id":"","url":"https://api.github.com/users/kodaman2","html_url":"https://github.com/kodaman2","followers_url":"https://api.github.com/users/kodaman2/followers","following_url":"https://api.github.com/users/kodaman2/following{/other_user}","gists_url":"https://api.github.com/users/kodaman2/gists{/gist_id}","starred_url":"https://api.github.com/users/kodaman2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kodaman2/subscriptions","organizations_url":"https://api.github.com/users/kodaman2/orgs","repos_url":"https://api.github.com/users/kodaman2/repos","events_url":"https://api.github.com/users/kodaman2/events{/privacy}","received_events_url":"https://api.github.com/users/kodaman2/received_events","type":"User","site_admin":false},"created_at":"2018-09-13T14:15:30Z","updated_at":"2018-09-13T14:15:30Z","author_association":"NONE","body":"` private static final AtomicLong transaction = new AtomicLong(0);`\r\n\r\nSorry for the mixup, yeah transaction still atomic. Haven't used much lambda to be honest, but in short what I was attempting to say was that when I made the lambda to anonymous function, LongBinaryOperator doesn't exist in 1.7\r\n\r\nWill make PR then. By the way just tested with both L7, and L8 controllers and I was able to connect and read tags. I wasn't sure if I would be able to read Program tags since there is a power point of the etherip on the c repo, and specifically says no program tags. \r\n\r\n![image](https://user-images.githubusercontent.com/10265682/45493851-54e14800-b735-11e8-951c-e40b94680827.png)\r\n"}}
{"actor":{"display_login":"kodaman2"}}