Skip to content

Commit

Permalink
Eliminate "base" java class proxy initialization.
Browse files Browse the repository at this point in the history
All it did was define the long-defunct __jsend! method, which is
superceded for many years by java_send.
  • Loading branch information
headius committed Apr 22, 2015
1 parent 68ac7f9 commit 759b924
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 27 deletions.
Expand Up @@ -28,8 +28,6 @@ public RubyModule initialize(RubyModule proxy) {

final State state = new State(runtime, superclass);

super.initializeBase(proxy);

proxyClass.setReifiedClass(javaClass);

runtime.getJavaSupport().getUnfinishedProxyClassCache().get(javaClass).set(proxyClass);
Expand Down
22 changes: 0 additions & 22 deletions core/src/main/java/org/jruby/javasupport/binding/Initializer.java
Expand Up @@ -381,28 +381,6 @@ private static void setJavaClassFor(final Class<?> javaClass, final RubyModule p

public abstract RubyModule initialize(RubyModule proxy);

public void initializeBase(RubyModule proxy) {
proxy.addMethod("__jsend!", new org.jruby.internal.runtime.methods.JavaMethod.JavaMethodNBlock(proxy, PUBLIC) {
@Override
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, String name, IRubyObject[] args, Block block) {
String callName = args[0].asJavaString();

DynamicMethod method = self.getMetaClass().searchMethod(callName);
int v = method.getArity().getValue();

IRubyObject[] newArgs = new IRubyObject[args.length - 1];
System.arraycopy(args, 1, newArgs, 0, newArgs.length);

if(v < 0 || v == (newArgs.length)) {
return Helpers.invoke(context, self, callName, newArgs, Block.NULL_BLOCK);
} else {
RubyClass superClass = self.getMetaClass().getSuperClass();
return Helpers.invokeAs(context, superClass, self, callName, newArgs, Block.NULL_BLOCK);
}
}
});
}

public static class State {

final Map<String, AssignedName> staticNames;
Expand Down
Expand Up @@ -23,8 +23,6 @@ public InterfaceInitializer(Ruby runtime, Class<?> javaClass) {
public RubyModule initialize(RubyModule proxy) {
final State state = new State(runtime, null);

super.initializeBase(proxy);

runtime.getJavaSupport().getUnfinishedProxyClassCache().get(javaClass).set(proxy);

Field[] fields = JavaClass.getDeclaredFields(javaClass);
Expand Down
Expand Up @@ -568,7 +568,6 @@ public static RubyObject get(IRubyObject self, IRubyObject obj) {
EXCLUDE_METHODS.add("java_class");
EXCLUDE_METHODS.add("java_object");
EXCLUDE_METHODS.add("__jcreate!");
EXCLUDE_METHODS.add("__jsend!");
}

@JRubyMethod(meta = true)
Expand Down

0 comments on commit 759b924

Please sign in to comment.