static Map<S, Class> classForNameOpt_cache = synchroHashMap(); static Class classForNameOpt(S name) ctex { if (classForNameOpt_cache.containsKey(name)) ret classForNameOpt_cache.get(name); Class c = null; try { c = Class.forName(name); } catch {} classForNameOpt_cache.put(name, c); ret c; }
Began life as a copy of #1011694
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: | #1015400 |
| Snippet name: | classForNameOpt - null if not found, always fast |
| Eternal ID of this version: | #1015400/2 |
| Text MD5: | 6562131c86617ee9b9367f4cf99b1a1e |
| Author: | stefan |
| Category: | javax |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2019-08-25 15:36:43 |
| Source code size: | 315 bytes / 10 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 917 / 951 |
| Version history: | 1 change(s) |
| Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1033985 - classForNameOpt_noCache - null if not found |