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

17
LINES

< > BotCompany Repo | #1017146 - replaceACCInClassLoader

JavaX fragment (include)

svoid replaceACCInClassLoader(O o, AccessControlContext newACC) {
  ClassLoader cl = getClassLoaderOrSame(o);
  if (cl instanceof URLClassLoader) pcall {
    setOpt(cl, acc := newACC);
    try {
      setOpt((O) getOpt(cl, 'ucp), acc := newACC);
    } catch e {
      ifdef replaceACCInClassLoader_fullException
        printStackTrace(e);
      endifdef
      printShortException("replaceACCInClassLoader: ", e);
      if (java10OrHigher())
        if (addDefaultVMOption("--add-opens java.base/jdk.internal.loader=ALL-UNNAMED"))
          print("Please restart the OS");
    }
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1017146
Snippet name: replaceACCInClassLoader
Eternal ID of this version: #1017146/11
Text MD5: b05aa323320d051a6cd43398a6f31bc1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-06 17:36:54
Source code size: 600 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 190 / 225
Version history: 10 change(s)
Referenced in: [show references]

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