Skip to content

Commit a2fb3a5

Browse files
committed
fix:add okhttp3 shading.
1 parent 02bd788 commit a2fb3a5

File tree

3 files changed

+8
-2
lines changed
  • polaris-distribution/polaris-all
  • polaris-plugins/polaris-plugins-loadbalancer/loadbalancer-ringhash/src/main/java/com/tencent/polaris/plugins/loadbalancer/ringhash

3 files changed

+8
-2
lines changed

polaris-distribution/polaris-all/pom.xml

+4
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@
111111
<pattern>com.squareup.okhttp</pattern>
112112
<shadedPattern>shade.polaris.com.squareup.okhttp</shadedPattern>
113113
</relocation>
114+
<relocation>
115+
<pattern>okhttp3</pattern>
116+
<shadedPattern>shade.polaris.okhttp3</shadedPattern>
117+
</relocation>
114118
<relocation>
115119
<pattern>org.checkerframework</pattern>
116120
<shadedPattern>shade.polaris.org.checkerframework

polaris-plugins/polaris-plugins-loadbalancer/loadbalancer-ringhash/src/main/java/com/tencent/polaris/plugins/loadbalancer/ringhash/MurmurHash.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.tencent.polaris.plugins.loadbalancer.ringhash;
1919

20+
import java.nio.Buffer;
2021
import java.nio.ByteBuffer;
2122
import java.nio.ByteOrder;
2223

@@ -54,7 +55,8 @@ public int getHashCode(String origin) {
5455
ByteOrder.LITTLE_ENDIAN);
5556
// for big-endian version, do this first:
5657
// finish.position(8-buf.remaining());
57-
finish.put(buf).rewind();
58+
// Compatible with lower version SDK
59+
((Buffer)finish.put(buf)).rewind();
5860
h ^= finish.getLong();
5961
h *= m;
6062
}

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
<properties>
6666
<!-- Project revision -->
67-
<revision>1.12.9</revision>
67+
<revision>1.12.10</revision>
6868

6969
<timestamp>${maven.build.timestamp}</timestamp>
7070
<skip.maven.deploy>false</skip.maven.deploy>

0 commit comments

Comments
 (0)