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

18
LINES

< > BotCompany Repo | #1016501 // allLiveMethods_skipOverridden_sortByNameWithinClass

JavaX fragment (include)

1  
static L<Method> allLiveMethods_skipOverridden_sortByNameWithinClass(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  
    new L<Method> newMethods;
8  
    for (Method m : c.getDeclaredMethods())
9  
      if (isInstance != isStaticMethod(m)) {
10  
        Pair<S, L<Class>> sig = pair(m.getName(), methodArgumentTypes(m));
11  
        if (seenSignatures.add(sig))
12  
          newMethods.add(m);
13  
      }
14  
    addAll(methods, sortMethodsByNameIC(newMethods));
15  
    c = c.getSuperclass();
16  
  }
17  
  ret methods;
18  
}

Author comment

Began life as a copy of #1016499

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: #1016501
Snippet name: allLiveMethods_skipOverridden_sortByNameWithinClass
Eternal ID of this version: #1016501/1
Text MD5: 221e434160919b8d5f82b013414401e3
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 17:00:30
Source code size: 618 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 309 / 329
Referenced in: [show references]