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

5
LINES

< > BotCompany Repo | #1035131 // putOrCreateSyncMap - make syncHashMap if null. allow null keys and values

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

Libraryless. Click here for Pure Java version (72L/1K).

static <A, B> Map<A, B> putOrCreateSyncMap(Map<A, B> map, A key, B value) {
  if (map == null) map = syncHashMap();
  map.put(key, value);
  ret map;
}

Author comment

Began life as a copy of #1030902

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035131
Snippet name: putOrCreateSyncMap - make syncHashMap if null. allow null keys and values
Eternal ID of this version: #1035131/1
Text MD5: 0d56e06e7db72fdc866e3833452ba09d
Transpilation MD5: 40c3541cd1a87253fcef0cd32bb0e517
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-30 20:08:01
Source code size: 155 bytes / 5 lines
Pitched / IR pitched: No / No
Views / Downloads: 126 / 180
Referenced in: [show references]