You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
283 lines
7.1 KiB
283 lines
7.1 KiB
.class Lcom/google/common/eventbus/EventSubscriber; |
|
.super Ljava/lang/Object; |
|
.source "EventSubscriber.java" |
|
|
|
|
|
# instance fields |
|
.field private final method:Ljava/lang/reflect/Method; |
|
|
|
.field private final target:Ljava/lang/Object; |
|
|
|
|
|
# direct methods |
|
.method constructor <init>(Ljava/lang/Object;Ljava/lang/reflect/Method;)V |
|
.locals 1 |
|
|
|
.prologue |
|
.line 53 |
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V |
|
|
|
.line 54 |
|
const-string v0, "EventSubscriber target cannot be null." |
|
|
|
invoke-static {p1, v0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
.line 56 |
|
const-string v0, "EventSubscriber method cannot be null." |
|
|
|
invoke-static {p2, v0}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
.line 58 |
|
iput-object p1, p0, Lcom/google/common/eventbus/EventSubscriber;->target:Ljava/lang/Object; |
|
|
|
.line 59 |
|
iput-object p2, p0, Lcom/google/common/eventbus/EventSubscriber;->method:Ljava/lang/reflect/Method; |
|
|
|
.line 60 |
|
const/4 v0, 0x1 |
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/reflect/Method;->setAccessible(Z)V |
|
|
|
.line 61 |
|
return-void |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method public equals(Ljava/lang/Object;)Z |
|
.locals 3 |
|
.param p1 # Ljava/lang/Object; |
|
.annotation runtime Ljavax/annotation/Nullable; |
|
.end annotation |
|
.end param |
|
|
|
.prologue |
|
const/4 v0, 0x0 |
|
|
|
.line 98 |
|
instance-of v1, p1, Lcom/google/common/eventbus/EventSubscriber; |
|
|
|
if-eqz v1, :cond_0 |
|
|
|
.line 99 |
|
check-cast p1, Lcom/google/common/eventbus/EventSubscriber; |
|
|
|
.line 103 |
|
iget-object v1, p0, Lcom/google/common/eventbus/EventSubscriber;->target:Ljava/lang/Object; |
|
|
|
iget-object v2, p1, Lcom/google/common/eventbus/EventSubscriber;->target:Ljava/lang/Object; |
|
|
|
if-ne v1, v2, :cond_0 |
|
|
|
iget-object v1, p0, Lcom/google/common/eventbus/EventSubscriber;->method:Ljava/lang/reflect/Method; |
|
|
|
iget-object v2, p1, Lcom/google/common/eventbus/EventSubscriber;->method:Ljava/lang/reflect/Method; |
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/reflect/Method;->equals(Ljava/lang/Object;)Z |
|
|
|
move-result v1 |
|
|
|
if-eqz v1, :cond_0 |
|
|
|
const/4 v0, 0x1 |
|
|
|
.line 105 |
|
:cond_0 |
|
return v0 |
|
.end method |
|
|
|
.method public getMethod()Ljava/lang/reflect/Method; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 113 |
|
iget-object v0, p0, Lcom/google/common/eventbus/EventSubscriber;->method:Ljava/lang/reflect/Method; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public getSubscriber()Ljava/lang/Object; |
|
.locals 1 |
|
|
|
.prologue |
|
.line 109 |
|
iget-object v0, p0, Lcom/google/common/eventbus/EventSubscriber;->target:Ljava/lang/Object; |
|
|
|
return-object v0 |
|
.end method |
|
|
|
.method public handleEvent(Ljava/lang/Object;)V |
|
.locals 4 |
|
|
|
.prologue |
|
.line 72 |
|
invoke-static {p1}, Lcom/google/common/base/Preconditions;->checkNotNull(Ljava/lang/Object;)Ljava/lang/Object; |
|
|
|
.line 74 |
|
:try_start_0 |
|
iget-object v0, p0, Lcom/google/common/eventbus/EventSubscriber;->method:Ljava/lang/reflect/Method; |
|
|
|
iget-object v1, p0, Lcom/google/common/eventbus/EventSubscriber;->target:Ljava/lang/Object; |
|
|
|
const/4 v2, 0x1 |
|
|
|
new-array v2, v2, [Ljava/lang/Object; |
|
|
|
const/4 v3, 0x0 |
|
|
|
aput-object p1, v2, v3 |
|
|
|
invoke-virtual {v0, v1, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; |
|
:try_end_0 |
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0 |
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1 |
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_2 |
|
|
|
.line 85 |
|
return-void |
|
|
|
.line 75 |
|
:catch_0 |
|
move-exception v0 |
|
|
|
.line 76 |
|
new-instance v1, Ljava/lang/Error; |
|
|
|
new-instance v2, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
const-string v3, "Method rejected target/argument: " |
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v2 |
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v2 |
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v2 |
|
|
|
invoke-direct {v1, v2, v0}, Ljava/lang/Error;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V |
|
|
|
throw v1 |
|
|
|
.line 77 |
|
:catch_1 |
|
move-exception v0 |
|
|
|
.line 78 |
|
new-instance v1, Ljava/lang/Error; |
|
|
|
new-instance v2, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
const-string v3, "Method became inaccessible: " |
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v2 |
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v2 |
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v2 |
|
|
|
invoke-direct {v1, v2, v0}, Ljava/lang/Error;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V |
|
|
|
throw v1 |
|
|
|
.line 79 |
|
:catch_2 |
|
move-exception v0 |
|
|
|
.line 80 |
|
invoke-virtual {v0}, Ljava/lang/reflect/InvocationTargetException;->getCause()Ljava/lang/Throwable; |
|
|
|
move-result-object v1 |
|
|
|
instance-of v1, v1, Ljava/lang/Error; |
|
|
|
if-eqz v1, :cond_0 |
|
|
|
.line 81 |
|
invoke-virtual {v0}, Ljava/lang/reflect/InvocationTargetException;->getCause()Ljava/lang/Throwable; |
|
|
|
move-result-object v0 |
|
|
|
check-cast v0, Ljava/lang/Error; |
|
|
|
throw v0 |
|
|
|
.line 83 |
|
:cond_0 |
|
throw v0 |
|
.end method |
|
|
|
.method public hashCode()I |
|
.locals 2 |
|
|
|
.prologue |
|
.line 92 |
|
.line 93 |
|
iget-object v0, p0, Lcom/google/common/eventbus/EventSubscriber;->method:Ljava/lang/reflect/Method; |
|
|
|
invoke-virtual {v0}, Ljava/lang/reflect/Method;->hashCode()I |
|
|
|
move-result v0 |
|
|
|
add-int/lit8 v0, v0, 0x1f |
|
|
|
mul-int/lit8 v0, v0, 0x1f |
|
|
|
iget-object v1, p0, Lcom/google/common/eventbus/EventSubscriber;->target:Ljava/lang/Object; |
|
|
|
invoke-static {v1}, Ljava/lang/System;->identityHashCode(Ljava/lang/Object;)I |
|
|
|
move-result v1 |
|
|
|
add-int/2addr v0, v1 |
|
|
|
return v0 |
|
.end method |
|
|
|
.method public toString()Ljava/lang/String; |
|
.locals 2 |
|
|
|
.prologue |
|
.line 88 |
|
new-instance v0, Ljava/lang/StringBuilder; |
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V |
|
|
|
const-string v1, "[wrapper " |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
iget-object v1, p0, Lcom/google/common/eventbus/EventSubscriber;->method:Ljava/lang/reflect/Method; |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
const-string v1, "]" |
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; |
|
|
|
move-result-object v0 |
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method
|
|
|