Permalink
Browse files

CLJ-852: add special cases for "int" ... "boolean" to tagToClass()

This causes the test to pass.

Signed-off-by: Stuart Halloway <stu@thinkrelevance.com>
  • Loading branch information...
1 parent 38e2133 commit 3297866c23dd01a5b0db14ed836336d128972aac @bpsm bpsm committed with stuarthalloway Oct 15, 2011
Showing with 29 additions and 12 deletions.
  1. +29 −12 src/jvm/clojure/lang/Compiler.java
View
41 src/jvm/clojure/lang/Compiler.java
@@ -966,7 +966,8 @@ private static Class maybeClass(Object form, boolean stringOk) {
c = RT.classForName(sym.name);
}
catch(Exception e){
- //aargh
+ // aargh
+ // leave c set to null -> return null
}
}
}
@@ -1013,17 +1014,33 @@ else if(sym.name.equals("ints"))
else if(sym.name.equals("longs"))
c = long[].class;
else if(sym.name.equals("floats"))
- c = float[].class;
- else if(sym.name.equals("doubles"))
- c = double[].class;
- else if(sym.name.equals("chars"))
- c = char[].class;
- else if(sym.name.equals("shorts"))
- c = short[].class;
- else if(sym.name.equals("bytes"))
- c = byte[].class;
- else if(sym.name.equals("booleans"))
- c = boolean[].class;
+ c = float[].class;
+ else if(sym.name.equals("doubles"))
+ c = double[].class;
+ else if(sym.name.equals("chars"))
+ c = char[].class;
+ else if(sym.name.equals("shorts"))
+ c = short[].class;
+ else if(sym.name.equals("bytes"))
+ c = byte[].class;
+ else if(sym.name.equals("booleans"))
+ c = boolean[].class;
+ else if(sym.name.equals("int"))
+ c = Integer.TYPE;
+ else if(sym.name.equals("long"))
+ c = Long.TYPE;
+ else if(sym.name.equals("float"))
+ c = Float.TYPE;
+ else if(sym.name.equals("double"))
+ c = Double.TYPE;
+ else if(sym.name.equals("char"))
+ c = Character.TYPE;
+ else if(sym.name.equals("short"))
+ c = Short.TYPE;
+ else if(sym.name.equals("byte"))
+ c = Byte.TYPE;
+ else if(sym.name.equals("boolean"))
+ c = Boolean.TYPE;
}
}
if(c != null)

0 comments on commit 3297866

Please sign in to comment.