Browse files

#45 Fix assert serialization

  • Loading branch information...
1 parent 3ca0d80 commit b02ea54e8a9f9fe783fd916fbbb0ca9adeea68fe @timowest committed Mar 6, 2013
View
3 scalagen/src/main/scala/com/mysema/scalagen/ScalaDumpVisitor.scala
@@ -982,8 +982,9 @@ class ScalaDumpVisitor extends VoidVisitor[ScalaDumpVisitor.Context] with Helper
}
def visit(n: AssertStmt, arg: Context) {
- printer.print("assert ")
+ printer.print("assert(")
n.getCheck.accept(this, arg)
+ printer.print(")")
if (n.getMessage != null) {
printer.print(" : ")
n.getMessage.accept(this, arg)
View
9 scalagen/src/test/scala/com/mysema/examples/Asserts2.java
@@ -0,0 +1,9 @@
+package com.mysema.examples;
+
+public class Asserts2 {
+
+ public Asserts2(boolean a, boolean b) {
+ assert a && b;
+ }
+
+}
View
2 scalagen/src/test/scala/com/mysema/scalagen/ScalaCompilationTest.scala
@@ -28,7 +28,7 @@ class ScalaCompilationTest extends AbstractParserTest with CompileTestUtils {
val resources = List[File](new File("src/test/scala/com/mysema/examples").listFiles():_*)
// parallel compilation
- val failures = resources.filter(_.getName.endsWith(".java")).par.map { f =>
+ val failures = resources.filter(_.getName.endsWith(".java")).map { f =>
var unit = JavaParser.parse(new FileInputStream(f))
val source = toScala(unit)
try {

0 comments on commit b02ea54

Please sign in to comment.