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

24
LINES

< > BotCompany Repo | #1006909 // unstructureInRealm - unstructure in another class loader realm

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

Transpiled version (6421L) is out of date.

1  
static O unstructureInRealm(S s, fO realm) {
2  
  Class mc = mainClass(realm);
3  
  S mcDollar = mc.getName() + "$";
4  
  printVars unstructureInRealm(+mc, +mcDollar);
5  
  
6  
  O classFinder = callOpt(mc, "_defaultClasFinder");
7  
  if (classFinder != null)
8  
    print("Using realm's class finder");
9  
  else classFinder = func(S name) {
10  
    S rewrittenName = replacePrefix("main$", mcDollar, name);
11  
    printVars("classFinder in realm: ", +name, +rewrittenName);
12  
    O result = getClass_noConvertName(realm, rewrittenName);
13  
    print("result: " + result);
14  
    ret result;
15  
  };
16  
  
17  
  // notify module that we are loading (old)
18  
  temp tempSetTL((ThreadLocal) callOpt(mc, 'dynamicObjectIsLoading_threadLocal), true);
19  
  
20  
  // because this is now global anyway
21  
  temp tempSetTL(dynamicObjectIsLoading_threadLocal(), true);
22  
  
23  
  ret unstructure(s, false, classFinder);
24  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1006909
Snippet name: unstructureInRealm - unstructure in another class loader realm
Eternal ID of this version: #1006909/9
Text MD5: 31821370ca225e8959bd9f29358350bd
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-30 03:29:44
Source code size: 868 bytes / 24 lines
Pitched / IR pitched: No / No
Views / Downloads: 550 / 688
Version history: 8 change(s)
Referenced in: [show references]