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

17
LINES

< > BotCompany Repo | #1010616 // getMountedObject

JavaX fragment (include)

1  
static Map getMountedObjects(O mounted, O key) {
2  
  if (mounted == null) null;
3  
  Map generalMap = vm_generalMap();
4  
  if (generalMap == null) fail("Please upgrade JavaX");
5  
  synchronized(generalMap) {
6  
    Map map = cast generalMap.get("mounts");
7  
    if (map == null) {
8  
      pcall-short {
9  
        map = (Map) nuForeignObject(javax(), className(javax()) + '$WeakIdentityHashMap);
10  
      }
11  
      if (map == null) map = new WeakIdentityHashMap; // older JavaX
12  
      generalMap.put("mounts", map);
13  
    }
14  
    Map m = cast map.get(mounted);
15  
    ret m == null ? null : m.get(key);
16  
  }
17  
}

Author comment

Began life as a copy of #1010615

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010616
Snippet name: getMountedObject
Eternal ID of this version: #1010616/3
Text MD5: 7699dffc8db19847c44afb8ac8117804
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-23 05:19:53
Source code size: 592 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 351 / 386
Version history: 2 change(s)
Referenced in: [show references]