java-ffi: Ignore '\n' in extern types
authorFrédéric Vachon <fredvac@gmail.com>
Fri, 13 Jun 2014 17:43:23 +0000 (13:43 -0400)
committerFrédéric Vachon <fredvac@gmail.com>
Fri, 13 Jun 2014 17:43:23 +0000 (13:43 -0400)
Signed-off-by: Frédéric Vachon <fredvac@gmail.com>

src/common_ffi/java.nit

index 330336f..e220db4 100644 (file)
@@ -463,7 +463,7 @@ redef class MClassType
        do
                var ftype = mclass.ftype
                if ftype isa ForeignJavaType then return ftype.java_type.
-                       replace('/', ".").replace('$', ".").replace(' ', "")
+                       replace('/', ".").replace('$', ".").replace(' ', "").replace('\n',"")
                if mclass.name == "Bool" then return "boolean"
                if mclass.name == "Char" then return "char"
                if mclass.name == "Int" then return "int"
@@ -485,7 +485,7 @@ redef class MClassType
        redef fun jni_format
        do
                var ftype = mclass.ftype
-               if ftype isa ForeignJavaType then return "L{ftype.java_type.replace('.', "/").replace(' ', "")};"
+               if ftype isa ForeignJavaType then return "L{ftype.java_type.replace('.', "/").replace(' ', "").replace('\n', "")};"
                if mclass.name == "Bool" then return "Z"
                if mclass.name == "Char" then return "C"
                if mclass.name == "Int" then return "I"