Skip to content

Commit 04e998f

Browse files
committed
Allow use of Class.forName() in patched OkHttp Platform class
1 parent 71a9f37 commit 04e998f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

communication/src/main/java/okhttp3/internal/platform/PatchPlatform.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717
package okhttp3.internal.platform;
1818

19+
import de.thetaphi.forbiddenapis.SuppressForbidden;
1920
import java.io.IOException;
2021
import java.lang.reflect.Field;
2122
import java.net.InetSocketAddress;
@@ -91,6 +92,7 @@ public String getPrefix() {
9192
return "OkHttp";
9293
}
9394

95+
@SuppressForbidden // allow this use of Class.forName()
9496
protected @Nullable X509TrustManager trustManager(SSLSocketFactory sslSocketFactory) {
9597
// Attempt to get the trust manager from an OpenJDK socket factory. We attempt this on all
9698
// platforms in order to support Robolectric, which mixes classes from both Android and the

0 commit comments

Comments
 (0)