1 | static Map<S, Class> classForNameOpt_cache = synchroHashMap(); |
2 | |
3 | static Class classForNameOpt(S name) ctex {
|
4 | if (classForNameOpt_cache.containsKey(name)) |
5 | ret classForNameOpt_cache.get(name); |
6 | Class c = null; |
7 | try { c = Class.forName(name); } catch {}
|
8 | classForNameOpt_cache.put(name, c); |
9 | ret c; |
10 | } |
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: | 918 / 952 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |