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

16
LINES

< > BotCompany Repo | #1016499 // allLiveMethods_skipOverridden

JavaX fragment (include)

1  
static L<Method> allLiveMethods_skipOverridden(O o) {
2  
  Class c = _getClass(o);
3  
  bool isInstance = c != o;
4  
  new L<Method> methods;
5  
  Set<Pair<S, L<Class>>> seenSignatures = new HashSet;
6  
  while (c != null) {
7  
    for (Method m : c.getDeclaredMethods())
8  
      if (isInstance != isStaticMethod(m)) {
9  
        Pair<S, L<Class>> sig = pair(m.getName(), methodArgumentTypes(m));
10  
        if (seenSignatures.add(sig))
11  
          methods.add(m);
12  
      }
13  
    c = c.getSuperclass();
14  
  }
15  
  ret methods;
16  
}

Author comment

Began life as a copy of #1016496

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016499
Snippet name: allLiveMethods_skipOverridden
Eternal ID of this version: #1016499/5
Text MD5: f9a519a5629810bf5dc85bb6326d1dcb
Author: stefan
Category: javax / introspection
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-20 16:57:32
Source code size: 507 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 361 / 374
Version history: 4 change(s)
Referenced in: [show references]