=== tests/src/UnparseTests.java
==================================================================
--- tests/src/UnparseTests.java	(revision 74798)
+++ tests/src/UnparseTests.java	(revision 74799)
@@ -93,6 +93,7 @@
         s.addTest(new UnparseTests("testSimple"));
         s.addTest(new UnparseTests("testParens"));
         s.addTest(new UnparseTests("testMany"));
+        s.addTest(new UnparseTests("testLiterals"));
         s.addTest(new UnparseTests("testParseUnparseParseJanino"));
         return s;
     }
@@ -397,6 +398,22 @@
             UnparseTests.helpTestExpr(input, expectNoSimplify, false);
         }
     }
+    
+    public void testLiterals() throws Exception {
+        Object[][] tests = new Object[][] {
+                { new Java.Literal(null, new Short((short)1)), "((short)1)" },
+                { new Java.Literal(null, new Byte((byte)1)),   "((byte)1)"  },
+        };
+        for(int i = 0; i < tests.length; ++i) {
+            Atom expr = (Atom) tests[i][0];
+            String expected = (String) tests[i][1];
+            
+            StringWriter sw = new StringWriter();
+            UnparseVisitor uv = new UnparseVisitor(sw);
+            expr.accept(uv);
+            Assert.assertEquals(expected, sw.toString());
+        }
+    }
 
     public void testParseUnparseParseJanino() throws Exception {
 
=== src/org/codehaus/janino/Scanner.java
==================================================================
--- src/org/codehaus/janino/Scanner.java	(revision 74798)
+++ src/org/codehaus/janino/Scanner.java	(revision 74799)
@@ -459,6 +459,12 @@
         if (v instanceof Boolean) {
             return v.toString();
         }
+        if(v instanceof Byte) {
+            return "((byte)"+v.toString()+")";
+        }
+        if(v instanceof Short) {
+            return "((short)"+v.toString()+")";
+        }
         if (v == null) {
             return "null";
         }

