97 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
			
		
		
	
	
			97 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			Java
		
	
	
	
	
	
| package kotlin.internal;
 | |
| 
 | |
| import java.lang.reflect.Method;
 | |
| import java.util.List;
 | |
| import java.util.regex.MatchResult;
 | |
| import kotlin.Metadata;
 | |
| import kotlin.collections.ArraysKt;
 | |
| import kotlin.collections.CollectionsKt;
 | |
| import kotlin.jvm.internal.Intrinsics;
 | |
| import kotlin.random.FallbackThreadLocalRandom;
 | |
| import kotlin.random.Random;
 | |
| import kotlin.text.MatchGroup;
 | |
| 
 | |
| /* compiled from: PlatformImplementations.kt */
 | |
| @Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010 \n\u0002\b\u0002\b\u0010\u0018\u00002\u00020\u0001:\u0001\u0012B\u0005¢\u0006\u0002\u0010\u0002J\u0018\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u0006H\u0016J\b\u0010\b\u001a\u00020\tH\u0016J\u001a\u0010\n\u001a\u0004\u0018\u00010\u000b2\u0006\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u000fH\u0016J\u0016\u0010\u0010\u001a\b\u0012\u0004\u0012\u00020\u00060\u00112\u0006\u0010\u0007\u001a\u00020\u0006H\u0016¨\u0006\u0013"}, d2 = {"Lkotlin/internal/PlatformImplementations;", "", "()V", "addSuppressed", "", "cause", "", "exception", "defaultPlatformRandom", "Lkotlin/random/Random;", "getMatchResultNamedGroup", "Lkotlin/text/MatchGroup;", "matchResult", "Ljava/util/regex/MatchResult;", "name", "", "getSuppressed", "", "ReflectThrowable", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
 | |
| /* loaded from: classes.dex */
 | |
| public class PlatformImplementations {
 | |
| 
 | |
|     /* compiled from: PlatformImplementations.kt */
 | |
|     @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\bÂ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0012\u0010\u0003\u001a\u0004\u0018\u00010\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000R\u0012\u0010\u0005\u001a\u0004\u0018\u00010\u00048\u0006X\u0087\u0004¢\u0006\u0002\n\u0000¨\u0006\u0006"}, d2 = {"Lkotlin/internal/PlatformImplementations$ReflectThrowable;", "", "()V", "addSuppressed", "Ljava/lang/reflect/Method;", "getSuppressed", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
 | |
|     private static final class ReflectThrowable {
 | |
|         public static final ReflectThrowable INSTANCE = new ReflectThrowable();
 | |
|         public static final Method addSuppressed;
 | |
|         public static final Method getSuppressed;
 | |
| 
 | |
|         private ReflectThrowable() {
 | |
|         }
 | |
| 
 | |
|         static {
 | |
|             Method method;
 | |
|             Method method2;
 | |
|             Method[] throwableMethods = Throwable.class.getMethods();
 | |
|             Intrinsics.checkNotNullExpressionValue(throwableMethods, "throwableMethods");
 | |
|             int length = throwableMethods.length;
 | |
|             int i = 0;
 | |
|             int i2 = 0;
 | |
|             while (true) {
 | |
|                 method = null;
 | |
|                 if (i2 >= length) {
 | |
|                     method2 = null;
 | |
|                     break;
 | |
|                 }
 | |
|                 method2 = throwableMethods[i2];
 | |
|                 if (Intrinsics.areEqual(method2.getName(), "addSuppressed")) {
 | |
|                     Class<?>[] parameterTypes = method2.getParameterTypes();
 | |
|                     Intrinsics.checkNotNullExpressionValue(parameterTypes, "it.parameterTypes");
 | |
|                     if (Intrinsics.areEqual(ArraysKt.singleOrNull(parameterTypes), Throwable.class)) {
 | |
|                         break;
 | |
|                     }
 | |
|                 }
 | |
|                 i2++;
 | |
|             }
 | |
|             addSuppressed = method2;
 | |
|             int length2 = throwableMethods.length;
 | |
|             while (true) {
 | |
|                 if (i >= length2) {
 | |
|                     break;
 | |
|                 }
 | |
|                 Method method3 = throwableMethods[i];
 | |
|                 if (Intrinsics.areEqual(method3.getName(), "getSuppressed")) {
 | |
|                     method = method3;
 | |
|                     break;
 | |
|                 }
 | |
|                 i++;
 | |
|             }
 | |
|             getSuppressed = method;
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     public void addSuppressed(Throwable cause, Throwable exception) {
 | |
|         Intrinsics.checkNotNullParameter(cause, "cause");
 | |
|         Intrinsics.checkNotNullParameter(exception, "exception");
 | |
|         Method method = ReflectThrowable.addSuppressed;
 | |
|         if (method != null) {
 | |
|             method.invoke(cause, exception);
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     public List<Throwable> getSuppressed(Throwable exception) {
 | |
|         Object invoke;
 | |
|         List<Throwable> asList;
 | |
|         Intrinsics.checkNotNullParameter(exception, "exception");
 | |
|         Method method = ReflectThrowable.getSuppressed;
 | |
|         return (method == null || (invoke = method.invoke(exception, new Object[0])) == null || (asList = ArraysKt.asList((Throwable[]) invoke)) == null) ? CollectionsKt.emptyList() : asList;
 | |
|     }
 | |
| 
 | |
|     public MatchGroup getMatchResultNamedGroup(MatchResult matchResult, String name) {
 | |
|         Intrinsics.checkNotNullParameter(matchResult, "matchResult");
 | |
|         Intrinsics.checkNotNullParameter(name, "name");
 | |
|         throw new UnsupportedOperationException("Retrieving groups by name is not supported on this platform.");
 | |
|     }
 | |
| 
 | |
|     public Random defaultPlatformRandom() {
 | |
|         return new FallbackThreadLocalRandom();
 | |
|     }
 | |
| }
 |