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

7
LINES

< > BotCompany Repo | #1030657 // syncReplaceCollection - replaceCollection synchronizing on target collection

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

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

static <A> void syncReplaceCollection(Cl<A> dest, Cl<A> src) {
  if (dest == src) ret;
  synchronized(collectionMutex(dest)) {
    dest.clear();
    if (src != null) dest.addAll(src);
  }
}

Author comment

Began life as a copy of #1002097

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1030657
Snippet name: syncReplaceCollection - replaceCollection synchronizing on target collection
Eternal ID of this version: #1030657/1
Text MD5: 65497e723754e4fd95efc779118f5599
Transpilation MD5: 86c3ee756acd4abba87dd5bbf578b6b8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-02-20 16:15:06
Source code size: 195 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 174 / 240
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)