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

14
LINES

< > BotCompany Repo | #1035155 // nonDefaultInterfaceMethods - cached version of findNonDefaultInterfaceMethods

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (7744L/44K).

scope nonDefaultInterfaceMethods

// TODO: convert to regularly cleared normal map
static Map<Class, Method[]> #cache = newDangerousWeakHashMap();

static Method[] nonDefaultInterfaceMethods(Class c) {
  Method[] methods;
  synchronized(cache) {
    methods = cache.get(c);
    if (methods == null)
      cache.put(c, methods = toTypedArray(Method.class, findNonDefaultInterfaceMethods(c)));
  }
  ret methods;
}

Author comment

Began life as a copy of #1034765

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035155
Snippet name: nonDefaultInterfaceMethods - cached version of findNonDefaultInterfaceMethods
Eternal ID of this version: #1035155/3
Text MD5: 0de4046a50b14ce70a5041fdb67f563d
Transpilation MD5: c2ea5f8b1a68df7e4afa381fcc45dec5
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-02 18:08:21
Source code size: 425 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 57 / 86
Version history: 2 change(s)
Referenced in: [show references]