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)

1  
static L<Method> allLiveMethods(O o) {
2  
  Class c = _getClass(o);
3  
  bool isInstance = c != o;
4  
  new L<Method> methods;
5  
  while (c != null) {
6  
    for (Method m : c.getDeclaredMethods())
7  
      if (isInstance != isStaticMethod(m))
8  
        methods.add(m);
9  
    c = c.getSuperclass();
10  
  }
11  
  ret methods;
12  
}

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: 427 / 456
Version history: 3 change(s)
Referenced in: [show references]