fix java/jni: imports for interfaces
@@ -84,18 +84,20 @@ pub(in java_jni) fn generate_java_code_for_interface(
let path = output_dir.join(format!("{}.java", interface.name));
let mut file = File::create(&path)
.map_err(|err| format!("Couldn't create {:?}: {}", path, err))?;
+ let imports = get_null_annotation_imports(use_null_annotation, methods_sign);
let interface_comments = doc_comments_to_java_comments(&interface.doc_comments, true);
write!(
file,
r#"// Automaticaly generated by rust_swig
package {package_name};
-
+{imports}
{doc_comments}
public interface {interface_name} {{
"#,
package_name = package_name,
interface_name = interface.name,
doc_comments = interface_comments,
+ imports = imports,
).map_err(&map_write_err)?;
for (method, f_method) in interface.items.iter().zip(methods_sign) {
