Skip to content

Commit b6cf196

Browse files
cemerickChouser
authored andcommitted
make clojure.lang.Keyword Serializable, fixes #174
Signed-off-by: Chouser <chouser@n01se.net>
1 parent abca86e commit b6cf196

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/jvm/clojure/lang/Keyword.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@
1212

1313
package clojure.lang;
1414

15+
import java.io.ObjectStreamException;
16+
import java.io.Serializable;
1517
import java.util.concurrent.ConcurrentHashMap;
1618

1719

18-
public class Keyword implements IFn, Comparable, Named{
20+
public class Keyword implements IFn, Comparable, Named, Serializable {
1921

2022
private static ConcurrentHashMap<Symbol, Keyword> table = new ConcurrentHashMap();
2123
public final Symbol sym;
@@ -76,6 +78,10 @@ public String getName(){
7678
return sym.getName();
7779
}
7880

81+
private Object readResolve() throws ObjectStreamException{
82+
return intern(sym);
83+
}
84+
7985
/**
8086
* Indexer implements IFn for attr access
8187
*

0 commit comments

Comments
 (0)