jasonsantos / luajava

LuaJava is a scripting tool for Java. The goal of this tool is to allow scripts written in Lua to manipulate components developed in Java. LuaJava allows Java components to be accessed from Lua using the same syntax that is used for accessing Lua`s native objects, without any need for declarations or any kind of preprocessing. LuaJava also allows Java to implement an interface using Lua. This way any interface can be implemented in Lua and passed as parameter to any method, and when called, the equivalent function will be called in Lua, and it's result passed back to Java.
http://www.keplerproject.org/luajava/
MIT License
378 stars 126 forks source link

luajava.createProxy() does not create Object.hashCode/equals() #1

Open vadi2 opened 12 years ago

vadi2 commented 12 years ago

It seems that luajava.createProxy() does not create the appropriate object.hashCode() method - or it is wrong. Either way, calling hashCode() in a Dalvik VM was resulting in an NPE:

java.lang.NullPointerException: null result when primitive expected at $Proxy2.hashCode(Native Method)

This can be worked around by implementing hashCode() function in the table that you pass to createProxy.

edti: same is with the case of equals()

Is this by design?