{"action":"created","issue":{"url":"https://api.github.com/repos/smartdevicelink/sdl_android/issues/208","labels_url":"https://api.github.com/repos/smartdevicelink/sdl_android/issues/208/labels{/name}","comments_url":"https://api.github.com/repos/smartdevicelink/sdl_android/issues/208/comments","events_url":"https://api.github.com/repos/smartdevicelink/sdl_android/issues/208/events","html_url":"https://github.com/smartdevicelink/sdl_android/issues/208","id":84038323,"number":208,"title":"ByteEnumer Legacy Method?","user":{"login":"MikaylaRay44","id":7975830,"avatar_url":"https://avatars.githubusercontent.com/u/7975830?v=3","gravatar_id":"","url":"https://api.github.com/users/MikaylaRay44","html_url":"https://github.com/MikaylaRay44","followers_url":"https://api.github.com/users/MikaylaRay44/followers","following_url":"https://api.github.com/users/MikaylaRay44/following{/other_user}","gists_url":"https://api.github.com/users/MikaylaRay44/gists{/gist_id}","starred_url":"https://api.github.com/users/MikaylaRay44/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikaylaRay44/subscriptions","organizations_url":"https://api.github.com/users/MikaylaRay44/orgs","repos_url":"https://api.github.com/users/MikaylaRay44/repos","events_url":"https://api.github.com/users/MikaylaRay44/events{/privacy}","received_events_url":"https://api.github.com/users/MikaylaRay44/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/smartdevicelink/sdl_android/labels/documentation","name":"documentation","color":"03a9f4"},{"url":"https://api.github.com/repos/smartdevicelink/sdl_android/labels/proposal","name":"proposal","color":"ff9800"},{"url":"https://api.github.com/repos/smartdevicelink/sdl_android/labels/question","name":"question","color":"9c27b0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-02T14:02:44Z","updated_at":"2015-06-24T19:23:43Z","closed_at":null,"body":"> _com/smartdevicelink/util/ByteEnumer_\r\n\r\nIn the [ByteEnumer](https://github.com/smartdevicelink/sdl_android/blob/develop/sdl_android_lib/src/com/smartdevicelink/util/ByteEnumer.java) class the following two methods are redundant, but I am wondering if they are there as legacy code? \r\n\r\n```java\r\n    public boolean equals(ByteEnumer other) {\r\n\treturn name == other.getName();\r\n    }\r\n\t\r\n    public boolean eq(ByteEnumer other) { // Legacy?\r\n\treturn equals(other);\r\n    }\r\n\r\n    public byte getValue() { return value; }\r\n\r\n    public byte value() { // Legacy?\r\n\treturn value;\r\n    }\r\n```\r\n\r\nIf it is legacy code intended to support library developers then the `eq(ByteEnumer)` method should be deprecated and documented, but this method should not be used within library; it is currently seen in [WiProProtocol](https://github.com/smartdevicelink/sdl_android/blob/develop/sdl_android_lib/src/com/smartdevicelink/protocol/WiProProtocol.java) and [SdlProxyBase](https://github.com/smartdevicelink/sdl_android/blob/develop/sdl_android_lib/src/com/smartdevicelink/proxy/SdlProxyBase.java), but so is the replacement method `equals(ByteEnumer)` which causes an inconsistency and should be adjusted.\r\n\r\nThe `value()` method should also be deprecated and documented and it's use in the library replaced with the new method. Currently the method appears in the [ProtocolFrameHeader](https://github.com/smartdevicelink/sdl_android/blob/develop/sdl_android_lib/src/com/smartdevicelink/protocol/ProtocolFrameHeader.java) and [ProtocolFrameHeaderFactory](https://github.com/smartdevicelink/sdl_android/blob/develop/sdl_android_lib/src/com/smartdevicelink/protocol/ProtocolFrameHeaderFactory.java) classes. The replacement method is used in [SdlTrace](https://github.com/smartdevicelink/sdl_android/blob/develop/sdl_android_lib/src/com/smartdevicelink/trace/SdlTrace.java) and [WiProProtocol](https://github.com/smartdevicelink/sdl_android/blob/develop/sdl_android_lib/src/com/smartdevicelink/protocol/WiProProtocol.java) which causes a similar library inconsistency as seen before.\r\n\r\n@mrapitis "},"comment":{"url":"https://api.github.com/repos/smartdevicelink/sdl_android/issues/comments/114986054","html_url":"https://github.com/smartdevicelink/sdl_android/issues/208#issuecomment-114986054","issue_url":"https://api.github.com/repos/smartdevicelink/sdl_android/issues/208","id":114986054,"user":{"login":"MikaylaRay44","id":7975830,"avatar_url":"https://avatars.githubusercontent.com/u/7975830?v=3","gravatar_id":"","url":"https://api.github.com/users/MikaylaRay44","html_url":"https://github.com/MikaylaRay44","followers_url":"https://api.github.com/users/MikaylaRay44/followers","following_url":"https://api.github.com/users/MikaylaRay44/following{/other_user}","gists_url":"https://api.github.com/users/MikaylaRay44/gists{/gist_id}","starred_url":"https://api.github.com/users/MikaylaRay44/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikaylaRay44/subscriptions","organizations_url":"https://api.github.com/users/MikaylaRay44/orgs","repos_url":"https://api.github.com/users/MikaylaRay44/repos","events_url":"https://api.github.com/users/MikaylaRay44/events{/privacy}","received_events_url":"https://api.github.com/users/MikaylaRay44/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T19:23:43Z","updated_at":"2015-06-24T19:23:43Z","body":"This can become obsolete if #209 is merged."}}