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

26
LINES

< > BotCompany Repo | #1031818 // _registerWeakCollection

JavaX fragment (include)

static L _registerWeakCollection_preList;

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

static void _onLoad_registerWeakCollection() {
  assertNotNull(javax());
  if (_registerWeakCollection_preList == null) ret;
  for (O o : _registerWeakCollection_preList)
    _registerWeakCollection(o);
  _registerWeakCollection_preList = null;
}

Author comment

Began life as a copy of #1010619

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1031818
Snippet name: _registerWeakCollection
Eternal ID of this version: #1031818/1
Text MD5: 56a52a2d4b226435d029bd5730d26e8a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-07-11 16:12:35
Source code size: 714 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 86 / 108
Referenced in: [show references]