Skip to content

Commit

Permalink
Merge pull request #88 from WuFengXue/master
Browse files Browse the repository at this point in the history
fix checkCompatibleMethods's return type check
  • Loading branch information
rk700 authored Dec 26, 2018
2 parents 8f5b005 + 1355530 commit 1e7f20c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/src/main/java/lab/galaxy/yahfa/HookMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private static void checkCompatibleMethods(Object original, Method replacement,
}

if (original instanceof Method
&& !((Method) original).getReturnType().isAssignableFrom(replacement.getReturnType())) {
&& !replacement.getReturnType().isAssignableFrom(((Method) original).getReturnType())) {
throw new IllegalArgumentException("Incompatible return types. " + originalName + ": " + ((Method) original).getReturnType() + ", " + replacementName + ": " + replacement.getReturnType());
} else if (original instanceof Constructor) {
if (replacement.getReturnType().equals(Void.class)) {
Expand Down

0 comments on commit 1e7f20c

Please sign in to comment.