#1576 Fix Java sys method reflection

dsav Fri 15 Jul 2011

I want to get InStream for the file specified by a Uri. The following works fine:

f := `file:/path/to/file`.get
in := f.in

But when I try

in := `file:/path/to/file`.get->in

I got an exception:

fan.sys.Method.invoke (Method.java:582)
fan.sys.Method$MethodFunc.callOn (Method.java:230)
fan.sys.FanObj.doTrap (FanObj.java:192)
fan.sys.FanObj.trap (FanObj.java:183)
fan.sys.FanObj.trap (FanObj.java:177)
diff::FileExample.main (FileExample.fan:12)
java.lang.reflect.Method.invoke (Method.java:597)
fan.sys.Method.invoke (Method.java:552)
fan.sys.Method$MethodFunc.callList (Method.java:198)
fan.sys.Method.callList (Method.java:138)
fanx.tools.Fan.callMain (Fan.java:135)
fanx.tools.Fan.executeType (Fan.java:102)
fanx.tools.Fan.execute (Fan.java:38)
fanx.tools.Fan.run (Fan.java:250)
fanx.tools.Fan.main (Fan.java:288)

Is it a bug?

brian Fri 15 Jul 2011

Promoted to ticket #1576 and assigned to brian

Definitely looks like a bug. Sometimes the reflection code in the sys package gets tricky since it is all mixed up with Java code.

brian Fri 15 Jul 2011

Renamed from NPE when Uri.get->in to Fix Java sys method reflection

brian Fri 15 Jul 2011

Ticket resolved in 1.0.60

I pushed a fix - changeset

Login or Signup to reply.