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

16
LINES

< > BotCompany Repo | #1016499 // allLiveMethods_skipOverridden

JavaX fragment (include)

static L<Method> allLiveMethods_skipOverridden(O o) {
  Class c = _getClass(o);
  bool isInstance = c != o;
  new L<Method> methods;
  Set<Pair<S, L<Class>>> seenSignatures = new HashSet;
  while (c != null) {
    for (Method m : c.getDeclaredMethods())
      if (isInstance != isStaticMethod(m)) {
        Pair<S, L<Class>> sig = pair(m.getName(), methodArgumentTypes(m));
        if (seenSignatures.add(sig))
          methods.add(m);
      }
    c = c.getSuperclass();
  }
  ret methods;
}

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: 356 / 369
Version history: 4 change(s)
Referenced in: [show references]