armeria icon indicating copy to clipboard operation
armeria copied to clipboard

Consider changing the type of `Unwrappable.unwrap`

Open jrhee17 opened this issue 2 years ago • 1 comments

Currently, Unwrappable#unwrap has the following method signature.

https://github.com/line/armeria/blob/88e8d3e6bf7cd204af60166e49c36c8f18e2ea4e/core/src/main/java/com/linecorp/armeria/common/util/Unwrappable.java#L87-L89

However, @ikhoon made a good point that although the return type is Unwrappable, the object can't really be unwrapped.

We may want to consider modifying the return type to Object

default Object unwrap() {
    return this;
}

default Object unwrapAll() {
    return this;
}

jrhee17 avatar Jul 14 '22 07:07 jrhee17

Note: unwrapAll and unwrap return types are inconsistent until 2.0.0 https://github.com/line/armeria/pull/4338#discussion_r923119208

jrhee17 avatar Jul 19 '22 02:07 jrhee17