MCPcopy Index your code
hub / github.com/clojure/clojure / intern

Method intern

src/jvm/clojure/lang/Keyword.java:34–53  ·  view source on GitHub ↗
(Symbol sym)

Source from the content-addressed store, hash-verified

32transient String _str;
33
34public 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
55public static Keyword intern(String ns, String name){
56 return intern(Symbol.intern(ns, name));

Callers 15

mainMethod · 0.95
AgentClass · 0.95
VarClass · 0.95
CompilerClass · 0.95
StaticMethodExprClass · 0.95
ParserClass · 0.95
InvokeExprClass · 0.95
InvokeExprMethod · 0.95
parseMethod · 0.95
isMutableMethod · 0.95
isVolatileMethod · 0.95
CompilerExceptionClass · 0.95

Calls 7

clearCacheMethod · 0.95
internMethod · 0.95
putIfAbsentMethod · 0.80
getMethod · 0.65
metaMethod · 0.65
withMetaMethod · 0.65
removeMethod · 0.65

Tested by

no test coverage detected