Skip to content

Commit

Permalink
remove unneeded things
Browse files Browse the repository at this point in the history
  • Loading branch information
laurit committed Jan 10, 2025
1 parent ee07cb0 commit 6ad303e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ enum DubboHeadersGetter implements TextMapGetter<DubboRequest> {
MethodHandles.Lookup lookup = MethodHandles.lookup();
MethodHandle getObjectAttachments = null;
try {
Class<?> rpcInvocation = Class.forName("org.apache.dubbo.rpc.RpcInvocation");
getObjectAttachments =
lookup.findVirtual(
rpcInvocation, "getObjectAttachments", MethodType.methodType(Map.class));
RpcInvocation.class, "getObjectAttachments", MethodType.methodType(Map.class));
} catch (Throwable t) {
// ignore
}
GET_OBJECT_ATTACHMENTS = getObjectAttachments;
}

@Override
@SuppressWarnings("unchecked") // unchecked for 2.7.6, 2.7.7
@SuppressWarnings("unchecked")
public Iterable<String> keys(DubboRequest request) {
RpcInvocation invocation = request.invocation();
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class DubboHeadersGetterTest {
@Mock RpcInvocation rpcInvocation;

@Test
@SuppressWarnings("deprecation") // deprecation for RpcInvocation()
void testKeys() throws Exception {
when(context.getUrl()).thenReturn(new URL("http", "localhost", 1));
when(context.getRemoteAddress()).thenReturn(new InetSocketAddress(1));
Expand Down

0 comments on commit 6ad303e

Please sign in to comment.