From: Tetsu S. <tet...@gm...> - 2010-07-08 06:33:50
|
Hello everyone, I have a question on accessing array object through native java code integration feature which is available in version 2.0.4. Hope you can help out there. I have following X10 code: @Native("java", "Stub.send(#1, #2)") static native def send(recv:String, args:Rail[Any]):Any; And after compile the code, I get following Java code: native static java.lang.Object send( final java.lang.String recv, final x10.core.Rail<java.lang.Object> args); Please notice that the Rail[Any] in X10 is converted to x10.core.Rail<java.lang.Object> in Java. It means at the runtime the X10 code expect a Java method with x10.core.Rail as parameter. Is it appropriate code generation? IMHO, the Rail object should be convert to an array in Java, just like the Rail[String] parameter in X10 main method is translated to String[] object. Well, if the above code generation is correct, how can I create a corresponding Java method that uses the x10.core.Rail object in java? I had tried to compile such Java code with X10 runtime library (X10_HOME/lib/x10.jar) but failed. Thanks in advanced. -Tetsu |