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

6
LINES

< > BotCompany Repo | #1031558 // syncMapPut2

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

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

static <A, B> void syncMapPut2(Map<A, B> map, A key, B value) {
  if (map != null && key != null) synchronized(collectionMutex(map)) {
    if (value != null) map.put(key, value);
    else map.remove(key);
  }
}

Author comment

Began life as a copy of #1024464

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031558
Snippet name: syncMapPut2
Eternal ID of this version: #1031558/1
Text MD5: 5a47413971660fb727edeafa60b0b5a7
Transpilation MD5: 875df769bce7ffb65bd6b6bbf074f793
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-06-22 00:36:31
Source code size: 215 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 93 / 135
Referenced in: [show references]