~ubuntu-branches/ubuntu/trusty/jruby/trusty-proposed

« back to all changes in this revision

Viewing changes to src/org/jruby/java/invokers/StaticFieldSetter.java

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Delafond
  • Date: 2009-12-10 12:34:42 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091210123442-df7t1v36qtfkj5df
Tags: 1.4.0-1
* New upstream release.
* Updated watch file.
* Updated copyright file to reflect addition of new third-party jars.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
import java.lang.reflect.Field;
4
4
import org.jruby.RubyModule;
5
 
import org.jruby.javasupport.JavaUtil;
6
5
import org.jruby.runtime.ThreadContext;
7
6
import org.jruby.runtime.builtin.IRubyObject;
8
7
 
15
14
    @Override
16
15
    public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject arg) {
17
16
        try {
18
 
            field.set(null, JavaUtil.convertArgumentToType(context, arg, field.getType()));
 
17
            field.set(null, arg.toJava(field.getType()));
19
18
        } catch (IllegalAccessException iae) {
20
19
            throw context.getRuntime().newTypeError("illegal access setting variable: " + iae.getMessage());
21
20
        }