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

26
LINES

< > BotCompany Repo | #1010619 // _registerWeakMap

JavaX fragment (include)

static L _registerWeakMap_preList;

static <A> A _registerWeakMap(A map) {
  if (javax() == null) {
    // We're in class init
    if (_registerWeakMap_preList == null) _registerWeakMap_preList = synchroList();
    _registerWeakMap_preList.add(map);
    ret map;
  }
  
  try {
    call(javax(), '_registerWeakMap, map);
  } catch e {
    printException(e);
    print("Upgrade JavaX!!");
  }
  ret map;
}

static void _onLoad_registerWeakMap() {
  assertNotNull(javax());
  if (_registerWeakMap_preList == null) ret;
  for (O o : _registerWeakMap_preList)
    _registerWeakMap(o);
  _registerWeakMap_preList = null;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010619
Snippet name: _registerWeakMap
Eternal ID of this version: #1010619/8
Text MD5: 55a0697b893db54c0747314912ca24fc
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-23 20:38:55
Source code size: 642 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 488 / 551
Version history: 7 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1010620 - cleanWeakMap - we assume that getting the size of a weak map cleans it
#1011912 - _registerDangerousWeakMap - register a weak map to be cleared regularly, automatically
#1031818 - _registerWeakCollection