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

12
LINES

< > BotCompany Repo | #1016496 // allLiveMethods - does not return static methods if you pass an instance

JavaX fragment (include)

static L<Method> allLiveMethods(O o) {
  Class c = _getClass(o);
  bool isInstance = c != o;
  new L<Method> methods;
  while (c != null) {
    for (Method m : c.getDeclaredMethods())
      if (isInstance != isStaticMethod(m))
        methods.add(m);
    c = c.getSuperclass();
  }
  ret methods;
}

Author comment

Began life as a copy of #1002019

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016496
Snippet name: allLiveMethods - does not return static methods if you pass an instance
Eternal ID of this version: #1016496/4
Text MD5: 18259c083207fae04c6c93c2973a136a
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:42:20
Source code size: 309 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 428 / 456
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1016499 - allLiveMethods_skipOverridden
#1031516 - allLiveMethodsBelowClass - does not return static methods if you pass an instance. returns only methods declared or overridden below the named class