From: Alexis Laferrière Date: Tue, 26 Feb 2019 15:18:03 +0000 (-0500) Subject: Java FFI: fix a few warnings and improve doc X-Git-Url: http://nitlanguage.org Java FFI: fix a few warnings and improve doc Signed-off-by: Alexis Laferrière --- diff --git a/src/c_tools.nit b/src/c_tools.nit index 1783c8e..61c1f9c 100644 --- a/src/c_tools.nit +++ b/src/c_tools.nit @@ -119,6 +119,7 @@ class ExternFile fun compiles_to_o_file: Bool do return false + # Is `self` a Java file to include in the JAR archive? fun add_to_jar: Bool do return false # Additional libraries needed for the compilation diff --git a/src/compiler/compiler_ffi/light.nit b/src/compiler/compiler_ffi/light.nit index 4adbf05..ce0f71b 100644 --- a/src/compiler/compiler_ffi/light.nit +++ b/src/compiler/compiler_ffi/light.nit @@ -29,7 +29,7 @@ redef class MModule return v.compiler.modelbuilder.mmodule2node(self) end - redef fun finalize_ffi(compiler: AbstractCompiler) + redef fun finalize_ffi(compiler) do if not uses_ffi then return diff --git a/src/ffi/java.nit b/src/ffi/java.nit index 0dd65be..a222885 100644 --- a/src/ffi/java.nit +++ b/src/ffi/java.nit @@ -165,6 +165,9 @@ class JavaLanguage redef fun compile_to_files(mmodule, compdir) do + var ffi_ccu = ffi_ccu + assert ffi_ccu != null + # Make sure we have a .java file mmodule.ensure_java_files @@ -172,7 +175,7 @@ class JavaLanguage mmodule.insert_compiler_options # Enable linking C callbacks to java native methods - mmodule.ensure_linking_callback_methods(ffi_ccu.as(not null)) + mmodule.ensure_linking_callback_methods(ffi_ccu) # Java implementation code var java_file = mmodule.java_file @@ -343,7 +346,7 @@ class JavaClassTemplate fun write_to_files(compdir: String): ExternFile do var filename = "{java_class_name}.java" - var filepath = "{compdir}/{filename}" + var filepath = compdir/filename write_to_file filepath