Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

18
LINES

< > BotCompany Repo | #1020645 // findMethod_precise - better method resolution

JavaX fragment (include)

1  
static Method findMethod_precise(O o, S method, O... args) ctex {
2  
  if (o cast Class) {
3  
    _MethodCache cache = callOpt_getCache(o);
4  
    L<Method> methods = cache.cache.get(method);
5  
    new Lowest<Method> best;
6  
    if (methods != null) for (Method m : methods) {
7  
      continue unless isStaticMethod(m);
8  
      int score = methodApplicabilityScore(m, args);
9  
      if (score < Int.MAX_VALUE) {
10  
        if (preciseCall_debug)
11  
          print("Method score: " + m + " " + score);
12  
        best.put(m, score);
13  
      }
14  
    }
15  
    ret best!;
16  
  } else
17  
    throw todo();
18  
}

Author comment

Began life as a copy of #1007856

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020645
Snippet name: findMethod_precise - better method resolution
Eternal ID of this version: #1020645/3
Text MD5: 681dcaba21fbeecb7d81db3ced7aabaf
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-30 12:14:50
Source code size: 581 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 337 / 364
Version history: 2 change(s)
Referenced in: [show references]