Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.5.15
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Patch Submitted:Yes
-
Number of attachments :
Description
The following test will fail with a RuntimeException. While parsed java cannot create a literal Byte or Short value, it is fairly easy to create them directly from the AST, and handling them is quite simple.
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()); } }
Applied the patch.
Please test.