smartdevicelink / sdl_java_suite

SmartDeviceLink libraries for Android, Java SE, and Java EE
BSD 3-Clause "New" or "Revised" License
186 stars 171 forks source link

ByteEnumer Legacy Method? #208

Open MikaylaRay44 opened 9 years ago

MikaylaRay44 commented 9 years ago

com/smartdevicelink/util/ByteEnumer

In the ByteEnumer class the following two methods are redundant, but I am wondering if they are there as legacy code?

    public boolean equals(ByteEnumer other) {
    return name == other.getName();
    }

    public boolean eq(ByteEnumer other) { // Legacy?
    return equals(other);
    }

    public byte getValue() { return value; }

    public byte value() { // Legacy?
    return value;
    }

If 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 and SdlProxyBase, but so is the replacement method equals(ByteEnumer) which causes an inconsistency and should be adjusted.

The 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 and ProtocolFrameHeaderFactory classes. The replacement method is used in SdlTrace and WiProProtocol which causes a similar library inconsistency as seen before.

@mrapitis

MikaylaRay44 commented 9 years ago

This can become obsolete if #209 is merged.

justinjdickow commented 9 years ago

The methods should be marked as deprecated for 4.0.0