123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409 |
- .class Lokhttp3/internal/platform/OptionalMethod;
- .super Ljava/lang/Object;
- .source ""
- # annotations
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- ">",
- "Ljava/lang/Object;"
- }
- .end annotation
- # instance fields
- .field private final methodName:Ljava/lang/String;
- .field private final methodParams:[Ljava/lang/Class;
- .field private final returnType:Ljava/lang/Class;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/lang/Class<",
- "*>;"
- }
- .end annotation
- .end field
- # direct methods
- .method varargs constructor <init>(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)V
- .locals 0
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljava/lang/Class<",
- "*>;",
- "Ljava/lang/String;",
- "[",
- "Ljava/lang/Class;",
- ")V"
- }
- .end annotation
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- iput-object p1, p0, Lokhttp3/internal/platform/OptionalMethod;->returnType:Ljava/lang/Class;
- iput-object p2, p0, Lokhttp3/internal/platform/OptionalMethod;->methodName:Ljava/lang/String;
- iput-object p3, p0, Lokhttp3/internal/platform/OptionalMethod;->methodParams:[Ljava/lang/Class;
- return-void
- .end method
- .method private getMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
- .locals 3
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljava/lang/Class<",
- "*>;)",
- "Ljava/lang/reflect/Method;"
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/platform/OptionalMethod;->methodName:Ljava/lang/String;
- const/4 v1, 0x0
- if-eqz v0, :cond_1
- iget-object v2, p0, Lokhttp3/internal/platform/OptionalMethod;->methodParams:[Ljava/lang/Class;
- invoke-static {p1, v0, v2}, Lokhttp3/internal/platform/OptionalMethod;->getPublicMethod(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
- move-result-object p1
- if-eqz p1, :cond_0
- iget-object v0, p0, Lokhttp3/internal/platform/OptionalMethod;->returnType:Ljava/lang/Class;
- if-eqz v0, :cond_0
- invoke-virtual {p1}, Ljava/lang/reflect/Method;->getReturnType()Ljava/lang/Class;
- move-result-object v2
- invoke-virtual {v0, v2}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z
- move-result v0
- if-nez v0, :cond_0
- goto :goto_0
- :cond_0
- move-object v1, p1
- :cond_1
- :goto_0
- return-object v1
- .end method
- .method private static getPublicMethod(Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Ljava/lang/Class<",
- "*>;",
- "Ljava/lang/String;",
- "[",
- "Ljava/lang/Class;",
- ")",
- "Ljava/lang/reflect/Method;"
- }
- .end annotation
- const/4 v0, 0x0
- :try_start_0
- invoke-virtual {p0, p1, p2}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;
- move-result-object p0
- :try_end_0
- .catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_0
- :try_start_1
- invoke-virtual {p0}, Ljava/lang/reflect/Method;->getModifiers()I
- move-result p1
- :try_end_1
- .catch Ljava/lang/NoSuchMethodException; {:try_start_1 .. :try_end_1} :catch_1
- and-int/lit8 p1, p1, 0x1
- if-nez p1, :cond_0
- :catch_0
- move-object p0, v0
- :catch_1
- :cond_0
- return-object p0
- .end method
- # virtual methods
- .method public varargs invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- .locals 3
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(TT;[",
- "Ljava/lang/Object;",
- ")",
- "Ljava/lang/Object;"
- }
- .end annotation
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/lang/reflect/InvocationTargetException;
- }
- .end annotation
- invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
- move-result-object v0
- invoke-direct {p0, v0}, Lokhttp3/internal/platform/OptionalMethod;->getMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
- move-result-object v0
- if-eqz v0, :cond_0
- :try_start_0
- invoke-virtual {v0, p1, p2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object p1
- :try_end_0
- .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
- return-object p1
- :catch_0
- move-exception p1
- new-instance p2, Ljava/lang/AssertionError;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- const-string v2, "Unexpectedly could not call: "
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object v0
- invoke-direct {p2, v0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
- invoke-virtual {p2, p1}, Ljava/lang/AssertionError;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
- throw p2
- :cond_0
- new-instance p2, Ljava/lang/AssertionError;
- new-instance v0, Ljava/lang/StringBuilder;
- invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
- const-string v1, "Method "
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- iget-object v1, p0, Lokhttp3/internal/platform/OptionalMethod;->methodName:Ljava/lang/String;
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- const-string v1, " not supported for object "
- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {p2, p1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
- throw p2
- .end method
- .method public varargs invokeOptional(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- .locals 2
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(TT;[",
- "Ljava/lang/Object;",
- ")",
- "Ljava/lang/Object;"
- }
- .end annotation
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/lang/reflect/InvocationTargetException;
- }
- .end annotation
- invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
- move-result-object v0
- invoke-direct {p0, v0}, Lokhttp3/internal/platform/OptionalMethod;->getMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
- move-result-object v0
- const/4 v1, 0x0
- if-nez v0, :cond_0
- return-object v1
- :cond_0
- :try_start_0
- invoke-virtual {v0, p1, p2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object p1
- :try_end_0
- .catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
- return-object p1
- :catch_0
- return-object v1
- .end method
- .method public varargs invokeOptionalWithoutCheckedException(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(TT;[",
- "Ljava/lang/Object;",
- ")",
- "Ljava/lang/Object;"
- }
- .end annotation
- :try_start_0
- invoke-virtual {p0, p1, p2}, Lokhttp3/internal/platform/OptionalMethod;->invokeOptional(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object p1
- :try_end_0
- .catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
- return-object p1
- :catch_0
- move-exception p1
- invoke-virtual {p1}, Ljava/lang/reflect/InvocationTargetException;->getTargetException()Ljava/lang/Throwable;
- move-result-object p1
- instance-of p2, p1, Ljava/lang/RuntimeException;
- if-eqz p2, :cond_0
- check-cast p1, Ljava/lang/RuntimeException;
- throw p1
- :cond_0
- new-instance p2, Ljava/lang/AssertionError;
- const-string v0, "Unexpected exception"
- invoke-direct {p2, v0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
- invoke-virtual {p2, p1}, Ljava/lang/AssertionError;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
- throw p2
- .end method
- .method public varargs invokeWithoutCheckedException(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(TT;[",
- "Ljava/lang/Object;",
- ")",
- "Ljava/lang/Object;"
- }
- .end annotation
- :try_start_0
- invoke-virtual {p0, p1, p2}, Lokhttp3/internal/platform/OptionalMethod;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object p1
- :try_end_0
- .catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
- return-object p1
- :catch_0
- move-exception p1
- invoke-virtual {p1}, Ljava/lang/reflect/InvocationTargetException;->getTargetException()Ljava/lang/Throwable;
- move-result-object p1
- instance-of p2, p1, Ljava/lang/RuntimeException;
- if-eqz p2, :cond_0
- check-cast p1, Ljava/lang/RuntimeException;
- throw p1
- :cond_0
- new-instance p2, Ljava/lang/AssertionError;
- const-string v0, "Unexpected exception"
- invoke-direct {p2, v0}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
- invoke-virtual {p2, p1}, Ljava/lang/AssertionError;->initCause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
- throw p2
- .end method
- .method public isSupported(Ljava/lang/Object;)Z
- .locals 0
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(TT;)Z"
- }
- .end annotation
- invoke-virtual {p1}, Ljava/lang/Object;->getClass()Ljava/lang/Class;
- move-result-object p1
- invoke-direct {p0, p1}, Lokhttp3/internal/platform/OptionalMethod;->getMethod(Ljava/lang/Class;)Ljava/lang/reflect/Method;
- move-result-object p1
- if-eqz p1, :cond_0
- const/4 p1, 0x1
- goto :goto_0
- :cond_0
- const/4 p1, 0x0
- :goto_0
- return p1
- .end method
|