Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/jruby-1_7'
Browse files Browse the repository at this point in the history
Conflicts:
	core/src/main/java/org/jruby/RubyProc.java
	core/src/main/java/org/jruby/javasupport/JavaMethod.java
	core/src/main/java/org/jruby/javasupport/JavaSupport.java

This commit puts JavaSupport back the way it was, so we can git mv
instead and get merging across that move.
  • Loading branch information
headius committed Mar 2, 2015
2 parents 15ec551 + e61b737 commit 2366bd6
Show file tree
Hide file tree
Showing 27 changed files with 720 additions and 733 deletions.
3 changes: 1 addition & 2 deletions core/src/main/java/org/jruby/Ruby.java
Expand Up @@ -52,7 +52,6 @@
import org.jruby.ext.thread.ThreadLibrary;
import org.jruby.ir.IRScriptBody;
import org.jruby.javasupport.JavaSupport;
import org.jruby.javasupport.JavaSupportImpl;
import org.jruby.lexer.yacc.ISourcePosition;
import org.jruby.parser.StaticScope;
import org.objectweb.asm.util.TraceClassVisitor;
Expand Down Expand Up @@ -1321,7 +1320,7 @@ && getInstanceConfig().getCompileMode() != CompileMode.TRUFFLE) {
}

public JavaSupport loadJavaSupport() {
return new JavaSupportImpl(this);
return new JavaSupport(this);
}

private void loadBundler() {
Expand Down
9 changes: 5 additions & 4 deletions core/src/main/java/org/jruby/RubyModule.java
Expand Up @@ -452,24 +452,25 @@ public String getBaseName() {
*/
public void setBaseName(String name) {
baseName = name;
cachedName = null;
}

/**
* Generate a fully-qualified class name or a #-style name for anonymous and singleton classes.
*
*
* Ruby C equivalent = "classname"
*
*
* @return The generated class name
*/
public String getName() {
if (cachedName != null) return cachedName;
return calculateName();
}

/**
* Get the "simple" name for the class, which is either the "base" name or
* the "anonymous" class name.
*
*
* @return the "simple" name of the class
*/
public String getSimpleName() {
Expand Down
Expand Up @@ -3,7 +3,6 @@
import java.lang.reflect.Method;
import java.util.List;

import org.jruby.Ruby;
import org.jruby.RubyModule;
import org.jruby.RubyProc;
import org.jruby.java.proxies.JavaProxy;
Expand All @@ -26,7 +25,7 @@ public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule claz
JavaProxy proxy = castJavaProxy(self);

int len = args.length;
Object[] convertedArgs = new Object[len];
final Object[] convertedArgs;
JavaMethod method = (JavaMethod)findCallable(self, name, args, len);
if (method.isVarArgs()) {
len = method.getParameterTypes().length - 1;
Expand Down Expand Up @@ -82,6 +81,7 @@ public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule claz
return method.invokeDirect(context, proxy.getObject(), cArg0, cArg1, cArg2);
}

@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
if (block.isGiven()) {
JavaProxy proxy = castJavaProxy(self);
Expand Down
15 changes: 8 additions & 7 deletions core/src/main/java/org/jruby/java/invokers/MethodInvoker.java
Expand Up @@ -9,33 +9,34 @@
import org.jruby.javasupport.JavaMethod;

public abstract class MethodInvoker extends RubyToJavaInvoker {

MethodInvoker(RubyModule host, List<Method> methods) {
super(host, methods.toArray(new Method[methods.size()]));
trySetAccessible(getAccessibleObjects());
}

MethodInvoker(RubyModule host, Method method) {
super(host, new Method[] {method});
super(host, new Method[] { method });
trySetAccessible(getAccessibleObjects());
}

@Override
protected JavaCallable createCallable(Ruby ruby, Member member) {
return JavaMethod.create(ruby, (Method)member);
protected final JavaCallable createCallable(Ruby runtime, Member member) {
return JavaMethod.create(runtime, (Method) member);
}

@Override
protected JavaCallable[] createCallableArray(JavaCallable callable) {
return new JavaMethod[] {(JavaMethod)callable};
protected final JavaCallable[] createCallableArray(JavaCallable callable) {
return new JavaMethod[] { (JavaMethod) callable };
}

@Override
protected JavaCallable[] createCallableArray(int size) {
protected final JavaCallable[] createCallableArray(int size) {
return new JavaMethod[size];
}

@Override
protected JavaCallable[][] createCallableArrayArray(int size) {
protected final JavaCallable[][] createCallableArrayArray(int size) {
return new JavaMethod[size][];
}

Expand Down

0 comments on commit 2366bd6

Please sign in to comment.