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

26
LINES

< > BotCompany Repo | #1031818 // _registerWeakCollection

JavaX fragment (include)

1  
static L _registerWeakCollection_preList;
2  
3  
static <A> A _registerWeakCollection(A cl) {
4  
  if (javax() == null) {
5  
    // We're in class init
6  
    if (_registerWeakCollection_preList == null) _registerWeakCollection_preList = synchroList();
7  
    _registerWeakCollection_preList.add(cl);
8  
    ret cl;
9  
  }
10  
  
11  
  try {
12  
    call(javax(), '_registerWeakCollection, cl);
13  
  } catch e {
14  
    printException(e);
15  
    print("Upgrade JavaX!!");
16  
  }
17  
  ret cl;
18  
}
19  
20  
static void _onLoad_registerWeakCollection() {
21  
  assertNotNull(javax());
22  
  if (_registerWeakCollection_preList == null) ret;
23  
  for (O o : _registerWeakCollection_preList)
24  
    _registerWeakCollection(o);
25  
  _registerWeakCollection_preList = null;
26  
}

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: 95 / 118
Referenced in: [show references]