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

4
LINES

< > BotCompany Repo | #1016981 // syncAddIfNotThere - addIfNotThere & synchronize on collection

JavaX fragment (include)

1  
static <A> bool syncAddIfNotThere(Collection<A> c, A b) {
2  
  if (c == null) false;
3  
  synchronized(c) { ret addIfNotThere(c, b); }
4  
}

Author comment

Began life as a copy of #1016979

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016981
Snippet name: syncAddIfNotThere - addIfNotThere & synchronize on collection
Eternal ID of this version: #1016981/1
Text MD5: 2ace436fbc01c6e0d240aad7693ae08b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-09 20:25:16
Source code size: 133 bytes / 4 lines
Pitched / IR pitched: No / No
Views / Downloads: 455 / 480
Referenced in: [show references]