Skip to content

ByteEnumer Legacy Method? #208

Open
Open
@MikaylaRay44

Description

@MikaylaRay44

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationRelating to inline documentationproposalAccepted SDL Evolution ProposalquestionA question, not a defect or feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions