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

29
LINES

< > BotCompany Repo | #1003910 // veryQuickJava_refresh - drop translator instance & clean disk transpilation cache

JavaX fragment (include)

1  
// returns true if a translator had been loaded
2  
static synchronized bool veryQuickJava_refresh() {
3  
  bool change = false;
4  
  
5  
  pcall {
6  
    // TODO: Why are we dropping these?
7  
    for (File f : listFiles(new File(javaxCodeDir(), "Transpilations")))
8  
      if (ewic(f.getName(), ".java")) {
9  
        change = true;
10  
        f.delete();
11  
      }
12  
  }
13  
  
14  
  Lock lock = cast getOpt(mc(), 'transpileRaw_lock);
15  
  if (lock != null) {
16  
    lock lock;
17  
    O trans = getOpt(mc(), 'transpileRaw_trans);
18  
    if (trans != null) {
19  
      cleanUp(trans);
20  
      setOpt(mc(), 'transpileRaw_trans, null);
21  
      change = true;
22  
    }
23  
  }
24  
  
25  
  // Also clear standard functions
26  
  callOpt(getOpt(mc(), 'loadFunctions_cache), 'clear);
27  
  
28  
  ret change;
29  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1003910
Snippet name: veryQuickJava_refresh - drop translator instance & clean disk transpilation cache
Eternal ID of this version: #1003910/6
Text MD5: efd421792cae4b63d705b226204ff9ea
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-11 17:03:27
Source code size: 749 bytes / 29 lines
Pitched / IR pitched: No / No
Views / Downloads: 561 / 558
Version history: 5 change(s)
Referenced in: [show references]