NPE when attempting to set Java primitive field to nil
------------------------------------------------------
Key: JRUBY-2273
URL: http://jira.codehaus.org/browse/JRUBY-2273
Project: JRuby
Issue Type: Bug
Reporter: Bill Dortch
Assignee: Bill Dortch
Fix For: JRuby 1.1RC3
NPE when attempting to set public Java primitive field to nil. Happens with
any primitive type.
{code}
public class A {
public int x;
}
{code}
{noformat}
a = A.new
a.x = nil
Exception in thread "main" java.lang.NullPointerException
at org.jruby.javasupport.JavaUtil.convertArgument(JavaUtil.java:472)
at org.jruby.javasupport.JavaField.set_value(JavaField.java:145)
at
org.jruby.javasupport.JavaClass$InstanceFieldSetter.execute(JavaClass.java:236)
at
org.jruby.internal.runtime.methods.SimpleCallbackMethod.call(SimpleCallbackMethod.jav
a:67)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:66)
at
org.jruby.evaluator.ASTInterpreter.attrAssignNode(ASTInterpreter.java:598)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:293)
at org.jruby.evaluator.ASTInterpreter.rootNode(ASTInterpreter.java:1615)
at
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:458)
at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
at
org.jruby.evaluator.ASTInterpreter.evalWithBinding(ASTInterpreter.java:222)
etc.
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email