-
-
Save M66B/1e1186719992a4916e657b04df4654f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/src/main/java/eu/faircode/xlua/XParam.java b/app/src/main/java/eu/faircode/xlua/XParam.java | |
index 6ce29bd..e75eb5d 100644 | |
--- a/app/src/main/java/eu/faircode/xlua/XParam.java | |
+++ b/app/src/main/java/eu/faircode/xlua/XParam.java | |
@@ -147,8 +147,18 @@ public class XParam { | |
this.param.setThrowable((Throwable) result); | |
else { | |
if (BuildConfig.DEBUG) | |
- Log.i(TAG, "Set " + this.getPackageName() + ":" + this.getUid() + " result=" + result); | |
+ Log.i(TAG, "Set " + this.getPackageName() + ":" + this.getUid() + | |
+ " result=" + result + " return=" + this.returnType); | |
if (result != null && this.returnType != null) { | |
+ if (result instanceof String && int.class.equals(this.returnType)) | |
+ result = Integer.parseInt((String) result); | |
+ else if (result instanceof String && long.class.equals(this.returnType)) | |
+ result = Long.parseLong((String) result); | |
+ else if (result instanceof String && float.class.equals(this.returnType)) | |
+ result = Float.parseFloat((String) result); | |
+ else if (result instanceof String && double.class.equals(this.returnType)) | |
+ result = Double.parseDouble((String) result); | |
+ else | |
result = coerceValue(this.returnType, result); | |
if (!boxType(this.returnType).isInstance(result)) | |
throw new IllegalArgumentException( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment