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

14
LINES

< > BotCompany Repo | #1009728 // cleanUpAndGetWeakReferencesList

JavaX fragment (include)

static <A> L<A> cleanUpAndGetWeakReferencesList(L<WeakReference<A>> l) {
  if (l == null) null;
  synchronized(l) {
    new L<A> out;
    for (int i = 0; i < l(l); i++) {
      A a = l.get(i).get();
      if (a == null)
        l.remove(i--);
      else
        out.add(a);
    }
    ret out;
  }
}

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: 472 / 506
Version history: 1 change(s)
Referenced in: [show references]