未验证 提交 2aeefcec 编写于 作者: 匿名A.'s avatar 匿名A. 提交者: GitHub

Make okhttp3 ,feign http9.x plugin to support Java 14 (#5745)

上级 0c4827d0
......@@ -7,6 +7,8 @@ Release Notes.
#### Project
#### Java Agent
Make the Feign plugin to support Java 14
Make the okhttp3 plugin to support Java 14
#### OAP-Backend
* Add the `@SuperDataset` annotation for BrowserErrorLog.
......
......@@ -22,7 +22,6 @@ import feign.Request;
import feign.Response;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
......@@ -103,10 +102,6 @@ public class DefaultHttpClientInterceptor implements InstanceMethodsAroundInterc
}
Field headersField = Request.class.getDeclaredField("headers");
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(headersField, headersField.getModifiers() & ~Modifier.FINAL);
headersField.setAccessible(true);
Map<String, Collection<String>> headers = new LinkedHashMap<String, Collection<String>>();
CarrierItem next = contextCarrier.items();
......
......@@ -20,7 +20,6 @@ package org.apache.skywalking.apm.plugin.okhttp.v3;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import okhttp3.Request;
......@@ -74,10 +73,6 @@ public class AsyncCallInterceptor implements InstanceConstructorInterceptor, Ins
SpanLayer.asHttp(span);
Field headersField = Request.class.getDeclaredField("headers");
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(headersField, headersField.getModifiers() & ~Modifier.FINAL);
headersField.setAccessible(true);
Headers.Builder headerBuilder = request.headers().newBuilder();
CarrierItem next = contextCarrier.items();
......
......@@ -20,7 +20,6 @@ package org.apache.skywalking.apm.plugin.okhttp.v3;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import okhttp3.Headers;
import okhttp3.HttpUrl;
import okhttp3.Request;
......@@ -70,10 +69,6 @@ public class RealCallInterceptor implements InstanceMethodsAroundInterceptor, In
SpanLayer.asHttp(span);
Field headersField = Request.class.getDeclaredField("headers");
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
modifiersField.setInt(headersField, headersField.getModifiers() & ~Modifier.FINAL);
headersField.setAccessible(true);
Headers.Builder headerBuilder = request.headers().newBuilder();
CarrierItem next = contextCarrier.items();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册