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

20
LINES

< > BotCompany Repo | #1019857 // hotwireWithParents

JavaX fragment (include)

1  
// parentMap: class name, ClassLoader, class name, ClassLoader, ...
2  
static Class<?> hotwireWithParents(S progIDOrSrc, O... parentMap) ctex {
3  
  // compile!
4  
  
5  
  S progID = isSnippetID(progIDOrSrc) ? progIDOrSrc : null;
6  
  Pair<File, S> p = progID != null
7  
    ? CompilerBot.compileSnippet2(progID)
8  
    : pair(CompilerBot.compile(progIDOrSrc), progIDOrSrc);
9  
  File jar = p.a;
10  
  S javaSource = p.b;
11  
  assertTrue(f2s(jar), jar.isFile());
12  
  
13  
  L<File> files = hotwire_collectJars(jar);
14  
  
15  
  // make class loader
16  
  JavaXClassLoaderWithParents classLoader = new(progID, files);
17  
  putAll(classLoader.parentMap, litorderedmap(parentMap));
18  
19  
  ret hotwire_finish(classLoader, progID, p.b);
20  
}

Author comment

Began life as a copy of #1011217

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019857
Snippet name: hotwireWithParents
Eternal ID of this version: #1019857/5
Text MD5: 9ed4e6d1b674511959d33169dcbf3604
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-28 23:36:55
Source code size: 697 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 314 / 337
Version history: 4 change(s)
Referenced in: [show references]