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

25
LINES

< > BotCompany Repo | #1025164 // thisDollarOneFields - actually this$1 or this$0

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

Libraryless. Click here for Pure Java version (2784L/16K).

scope thisDollarOneFields.

static Map<Class, Field[]> #cache = newDangerousWeakHashMap();

static Field[] thisDollarOneFields(Class c) {
  synchronized(cache) {
    Field[] l = cache.get(c);
    if (l == null)
      cache.put(c, l = thisDollarOneFields_uncached(c));
    ret l;
  }
}

static Field[] thisDollarOneFields_uncached(Class c) {
  new L<Field> fields;
  do {
    for (Field f : c.getDeclaredFields())
      if (f.getName().startsWith("this$"))
        fields.add(makeAccessible(f));
    c = c.getSuperclass();
  } while (c != null);
  ret toArray(new Field[l(fields)], fields);
}

end scope

Author comment

Began life as a copy of #1005599

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025164
Snippet name: thisDollarOneFields - actually this$1 or this$0
Eternal ID of this version: #1025164/8
Text MD5: 38c85834f19d85eeb6097cdaea20e6be
Transpilation MD5: 32b474f0d91f0552352f42420cde5e0e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-24 21:33:15
Source code size: 626 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 236 / 359
Version history: 7 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)