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

17
LINES

< > BotCompany Repo | #1010616 // getMountedObject

JavaX fragment (include)

static Map getMountedObjects(O mounted, O key) {
  if (mounted == null) null;
  Map generalMap = vm_generalMap();
  if (generalMap == null) fail("Please upgrade JavaX");
  synchronized(generalMap) {
    Map map = cast generalMap.get("mounts");
    if (map == null) {
      pcall-short {
        map = (Map) nuForeignObject(javax(), className(javax()) + '$WeakIdentityHashMap);
      }
      if (map == null) map = new WeakIdentityHashMap; // older JavaX
      generalMap.put("mounts", map);
    }
    Map m = cast map.get(mounted);
    ret m == null ? null : m.get(key);
  }
}

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: 352 / 386
Version history: 2 change(s)
Referenced in: