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

25
LINES

< > BotCompany Repo | #1025164 - thisDollarOneFields

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

Transpiled version (2112L) is out of date.

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().equals("this$1"))
        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   

Travelled to 2 computer(s): mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1025164
Snippet name: thisDollarOneFields
Eternal ID of this version: #1025164/6
Text MD5: a91c44945ad1dd5b152f253faf7edcee
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-12 22:39:14
Source code size: 623 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 12 / 35
Version history: 5 change(s)
Referenced in: [show references]