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

14
LINES

< > BotCompany Repo | #1009728 // cleanUpAndGetWeakReferencesList

JavaX fragment (include)

1  
static <A> L<A> cleanUpAndGetWeakReferencesList(L<WeakReference<A>> l) {
2  
  if (l == null) null;
3  
  synchronized(l) {
4  
    new L<A> out;
5  
    for (int i = 0; i < l(l); i++) {
6  
      A a = l.get(i).get();
7  
      if (a == null)
8  
        l.remove(i--);
9  
      else
10  
        out.add(a);
11  
    }
12  
    ret out;
13  
  }
14  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1009728
Snippet name: cleanUpAndGetWeakReferencesList
Eternal ID of this version: #1009728/2
Text MD5: 5e73396786c2192f4456690f475d353b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-13 14:27:06
Source code size: 311 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 551 / 589
Version history: 1 change(s)
Referenced in: [show references]