(Symbol sym)
| 32 | transient String _str; |
| 33 | |
| 34 | public static Keyword intern(Symbol sym){ |
| 35 | Keyword k = null; |
| 36 | Reference<Keyword> existingRef = table.get(sym); |
| 37 | if(existingRef == null) |
| 38 | { |
| 39 | Util.clearCache(rq, table); |
| 40 | if(sym.meta() != null) |
| 41 | sym = (Symbol) sym.withMeta(null); |
| 42 | k = new Keyword(sym); |
| 43 | existingRef = table.putIfAbsent(sym, new WeakReference<Keyword>(k, rq)); |
| 44 | } |
| 45 | if(existingRef == null) |
| 46 | return k; |
| 47 | Keyword existingk = existingRef.get(); |
| 48 | if(existingk != null) |
| 49 | return existingk; |
| 50 | //entry died in the interim, do over |
| 51 | table.remove(sym, existingRef); |
| 52 | return intern(sym); |
| 53 | } |
| 54 | |
| 55 | public static Keyword intern(String ns, String name){ |
| 56 | return intern(Symbol.intern(ns, name)); |
no test coverage detected