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

8
LINES

< > BotCompany Repo | #1016570 // getAndClearMap

JavaX fragment (include)

1  
static <A, B> Map<A, B> getAndClearMap(Map<A, B> map) {
2  
  if (map == null) ret emptyMap();
3  
  synchronized(collectionMutex(map)) {
4  
    Map<A, B> out = cloneMap(map);
5  
    map.clear();
6  
    ret out;
7  
  }
8  
}

Author comment

Began life as a copy of #1015526

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: #1016570
Snippet name: getAndClearMap
Eternal ID of this version: #1016570/1
Text MD5: eaff8010ab08ff6e7118a32701100709
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-23 20:02:36
Source code size: 207 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 444 / 486
Referenced in: [show references]