Libraryless. Click here for Pure Java version (2487L/15K).
1 | svoid forwardSwappableFunctionToObject(O o, S swappableMethodName, O target) { |
2 | forwardSwappableFunctionToObject(o, swappableMethodName, target, swappableMethodName); |
3 | } |
4 | |
5 | svoid forwardSwappableFunctionToObject(O o, S swappableMethodName, O target, S methodNameOnTarget) { |
6 | if (o == null || target == null) ret; |
7 | Class type = fieldType(o, swappableMethodName); |
8 | if (type == null) ret; // field doesn't exist |
9 | S proxyMethodName = type == Runnable.class ? "run" : "get"; |
10 | set(o, swappableMethodName, singleObjectMethodProxy2(type, target, proxyMethodName, methodNameOnTarget)); |
11 | } |
Began life as a copy of #1027671
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1027672 |
Snippet name: | forwardSwappableFunctionToObject |
Eternal ID of this version: | #1027672/5 |
Text MD5: | 9afe6b3001623e4780b6a3dc5bcaf7b8 |
Transpilation MD5: | 5a3f478d7610ee9e47854cd8e49fab98 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-03-29 23:41:35 |
Source code size: | 591 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 216 / 300 |
Version history: | 4 change(s) |
Referenced in: | [show references] |