siranovel / jniscrteng

javaのScriptEngineを利用して、動的プログラム内の関数及びメソッドを、呼び出すアダプターです。
GNU General Public License v2.0
0 stars 0 forks source link

javascriptファイル以外の動的プログラムファイルの解析できず #9

Closed siranovel closed 3 years ago

siranovel commented 4 years ago

name: Bug report about: バグを知らせてね title: '' labels: '' assignees: ''


Describe the bug javascriptファイル以外の動的プログラムファイルの解析できず

To Reproduce

テストデータ [sira@localhost test]$ cat test.rb def test_paramX() print "test_paramX\n" end def test_paramN(iv, lv, fv, dv) printf "test_paramN in\n" printf "iv:%d\n", iv printf "lv:%d\n", lv printf "fv:%f\n", fv printf "dv:%f\n", dv end

実行 [sira@localhost test]$ make test

LD_LIBRARY_PATH=../lib jniscrteng sample2.js

LD_LIBRARY_PATH=../lib jniscrteng testruby.rb /opt/jruby/jruby-9.2.11.0/lib

LD_LIBRARY_PATH=../lib jniscrteng test.rb /opt/jruby/jruby-9.2.11.0/lib

実行結果 Exception in thread "main" org.jruby.embed.ParseFailedException: java.lang.ClassCastException: class java.io.FileReader cannot be cast to class java.io.InputStream (java.io.FileReader and java.io.InputStream are in module java.base of loader 'bootstrap') at org.jruby.dist/org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.runParser(EmbedRubyRuntimeAdapterImpl.java:207) at org.jruby.dist/org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.parse(EmbedRubyRuntimeAdapterImpl.java:94) at org.jruby.dist/org.jruby.embed.ScriptingContainer.parse(ScriptingContainer.java:1227) at org.jruby.dist/org.jruby.embed.jsr223.JRubyCompiledScript.(JRubyCompiledScript.java:59) at org.jruby.dist/org.jruby.embed.jsr223.JRubyEngine.compile(JRubyEngine.java:69) Caused by: java.lang.ClassCastException: class java.io.FileReader cannot be cast to class java.io.InputStream (java.io.FileReader and java.io.InputStream are in module java.base of loader 'bootstrap') at org.jruby.dist/org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.runParser(EmbedRubyRuntimeAdapterImpl.java:190) ... 4 more jniscrteng: CScriptEngine.c:151: CScriptEngine_doEval: アサーション `NULL != _compiledScript' に失敗しました。 make: *** [test] 中止 [sira@localhost test]$

Expected behavior 上記のExceptionが、無くなること

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context 特になし

siranovel commented 4 years ago

同じメゾッドが複数あるとき、先頭を見つけようとしている。

対象方法は、わからない。

siranovel commented 3 years ago

パラメータがオブジェクトを指定した時、メソッドをみつけられない時がある。

メソッドの引数の型が、スーパークラスやインタフェースの時

siranovel commented 3 years ago

上記に伴い、libproxyjniをしないようにする。