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

8
LINES

< > BotCompany Repo | #1030047 // syncCloneAndClearList

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2515L/16K).

static <A> L<A> syncCloneAndClearList(Cl<A> l) {
  if (l == null) ret emptyList();
  synchronized(collectionMutex(l)) {
    L<A> l2 = cloneList(l);
    l.clear();
    ret l2;
  }
}

Author comment

Began life as a copy of #1009575

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030047
Snippet name: syncCloneAndClearList
Eternal ID of this version: #1030047/2
Text MD5: 03baa3224f18904b37267e7acede1f47
Transpilation MD5: 9b8e54fecf3cc1176549055a4d89aca3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-11-02 23:02:16
Source code size: 187 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 210 / 302
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)