Skip to content

Commit 07729a7

Browse files
committed
Change the annotation of M3TracingHttpInterceptor.INSTANCE from @JvmStatic to @JvmField
1 parent e33c188 commit 07729a7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

jvm/apache-httpclient/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ Add `M3TracingHttpInterceptor` as request/response interceptor of HttpClient.
88

99
```java:
1010
// CAUTION: Must setup as BOTH interceptor otherwise it may cause memory leak.
11-
httpclient.addRequestInterceptor(M3TracingHttpInterceptor.getINSTANCE());
12-
httpclient.addResponseInterceptor(M3TracingHttpInterceptor.getINSTANCE());
11+
httpclient.addRequestInterceptor(M3TracingHttpInterceptor.INSTANCE);
12+
httpclient.addResponseInterceptor(M3TracingHttpInterceptor.INSTANCE);
1313
```
1414

1515
### httpclient 4.3+
1616

1717
```java
1818
CloseableHttpClient httpClient = HttpClientBuilder.create()
19-
.addInterceptorFirst((HttpRequestInterceptor) M3TracingHttpInterceptor.getINSTANCE())
20-
.addInterceptorLast((HttpResponseInterceptor) M3TracingHttpInterceptor.getINSTANCE())
19+
.addInterceptorFirst((HttpRequestInterceptor) M3TracingHttpInterceptor.INSTANCE)
20+
.addInterceptorLast((HttpResponseInterceptor) M3TracingHttpInterceptor.INSTANCE)
2121
.build();
2222
```
2323
}

jvm/apache-httpclient/src/main/kotlin/com/m3/tracing/apache/httpclient/M3TracingHttpInterceptor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ open class M3TracingHttpInterceptor(
1919
protected val tracer: M3Tracer
2020
) : HttpRequestInterceptor, HttpResponseInterceptor {
2121
companion object {
22-
@JvmStatic
22+
@JvmField
2323
public val INSTANCE = M3TracingHttpInterceptor()
2424

2525
private val currentSpan = ThreadLocal<TraceSpan>()

0 commit comments

Comments
 (0)