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

13
LINES

< > BotCompany Repo | #1025165 - fixOuterRefs - fix this$1 for classes that have more than one instance and only one field is set

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

Libraryless. Click here for Pure Java version (2127L/14K).

1  
svoid fixOuterRefs(O o) ctex {
2  
  if (o == null) ret;
3  
  Field[] l = thisDollarOneFields(o.getClass());
4  
  if (l.length <= 1) ret;
5  
  O father = null;
6  
  for (Field f : l) {
7  
    father = f.get(o);
8  
    if (father != null) break;
9  
  }
10  
  if (father == null) ret;
11  
  for (Field f : l)
12  
    f.set(o, father);
13  
}

download  show line numbers  debug dex   

Travelled to 2 computer(s): mqqgnosmbjvj, tvejysmllsmz

No comments. add comment

Snippet ID: #1025165
Snippet name: fixOuterRefs - fix this$1 for classes that have more than one instance and only one field is set
Eternal ID of this version: #1025165/7
Text MD5: ed188976ab4c8b9ac45914553eabcd83
Transpilation MD5: ee470e365fd243b16ef80922726076ad
Author: stefan
Category: javax / internal fixing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-09 23:49:22
Source code size: 309 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 28 / 56
Version history: 6 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1025165 & http://1025165.tinybrain.de