Libraryless. Click here for Pure Java version (10102L/56K).
1 | static Map<Method, Int> scoredMethods_withPrimitiveWidening_onTypes(O o, S method, Class... argTypes) ctex {
|
2 | if (o cast Class) {
|
3 | _MethodCache cache = callOpt_getCache(o); |
4 | L<Method> methods = cache.cache.get(method); |
5 | new Map<Method, Int> scores; |
6 | if (methods != null) for (Method m : methods) {
|
7 | continue unless isStaticMethod(m); |
8 | int score = methodApplicabilityScore_withPrimitiveWidening_onTypes(m, argTypes); |
9 | if (score < Int.MAX_VALUE) |
10 | scores.put(m, score); |
11 | } |
12 | ret scores; |
13 | } else {
|
14 | if (o == null) null; |
15 | _MethodCache cache = callOpt_getCache(o.getClass()); |
16 | L<Method> methods = cache.cache.get(method); |
17 | new Map<Method, Int> scores; |
18 | if (methods != null) for (Method m : methods) {
|
19 | int score = methodApplicabilityScore_withPrimitiveWidening_onTypes(m, argTypes); |
20 | if (score < Int.MAX_VALUE) |
21 | scores.put(m, score); |
22 | } |
23 | ret scores; |
24 | } |
25 | } |
Began life as a copy of #1036431
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1036432 |
| Snippet name: | scoredMethods_withPrimitiveWidening_onTypes - even better method resolution |
| Eternal ID of this version: | #1036432/1 |
| Text MD5: | 6434b19c674968135ac6df3e2c3a1c36 |
| Transpilation MD5: | 7688a589f936e0155fe4727437fe6a7f |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-12-11 23:15:03 |
| Source code size: | 954 bytes / 25 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 400 / 494 |
| Referenced in: | [show references] |