Skip to content

ThriftEnumMetadata's constructor is not skipping bridge method #137

@Branhub

Description

@Branhub

if the method annotated with @ThriftEnumValue is a method overriding generic super method which return type is generic ,then the ThriftEnumMetadata's constructor will check its bridge method's return type and raise an Exception
add these code to the TestThriftEnumMetadata.java and it will show the Exception

    public interface CodeInterface<T> {
        T getCode();
    }

    @ThriftEnum
    public enum CodeWithBridgeEnum implements CodeInterface<Integer> {
        A(1),;

        private final Integer code;

        CodeWithBridgeEnum(Integer code) {
            this.code = code;
        }

        @ThriftEnumValue
        @Override
        public Integer getCode() {
            return code;
        }
    }

    @Test
    public void testCodeWithBridgeEnum() {
        thriftEnumMetadata(CodeWithBridgeEnum.class);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions