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

This commit is contained in:
hsoftxl 2020-10-29 10:52:13 +08:00 committed by GitHub
parent 0c4827d056
commit 2aeefceca0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 15 deletions

View File

@ -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.

View File

@ -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();

View File

@ -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();

View File

@ -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();