pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/jruby/jruby/commit/02b8e01b4686b05da6762dd69950835d57dcd653

/> Remove MiniJava and all the tendrils it extended through JRuby. Usefu… · jruby/jruby@02b8e01 · GitHub
Skip to content

Commit 02b8e01

Browse files
committed
Remove MiniJava and all the tendrils it extended through JRuby. Useful remainder moved to org.jruby.java.codegen.RealClassGenerator.
1 parent 1a20754 commit 02b8e01

14 files changed

Lines changed: 825 additions & 2120 deletions

File tree

samples/minijava/arraylist.rb

Lines changed: 0 additions & 38 deletions
This file was deleted.

samples/minijava/arrays.rb

Lines changed: 0 additions & 49 deletions
This file was deleted.

samples/minijava/interfaces.rb

Lines changed: 0 additions & 103 deletions
This file was deleted.

samples/minijava/method_missing.rb

Lines changed: 0 additions & 11 deletions
This file was deleted.

samples/minijava/swing.rb

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/org/jruby/Ruby.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,9 +1340,6 @@ private void createSysErr(int i, String name) {
13401340
private void initBuiltins() {
13411341
addLazyBuiltin("java.rb", "java", "org.jruby.javasupport.Java");
13421342
addLazyBuiltin("jruby.rb", "jruby", "org.jruby.libraries.JRubyLibrary");
1343-
1344-
addLazyBuiltin("minijava.rb", "minijava", "org.jruby.java.MiniJava");
1345-
13461343
addLazyBuiltin("jruby/ext.rb", "jruby/ext", "org.jruby.RubyJRuby$ExtLibrary");
13471344
addLazyBuiltin("jruby/util.rb", "jruby/util", "org.jruby.RubyJRuby$UtilLibrary");
13481345
addLazyBuiltin("jruby/core_ext.rb", "jruby/core_ext", "org.jruby.RubyJRuby$CoreExtLibrary");

src/org/jruby/RubyClass.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@
4848
import org.jruby.compiler.impl.SkinnyMethodAdapter;
4949
import org.jruby.internal.runtime.methods.DynamicMethod;
5050
import org.jruby.internal.runtime.methods.JavaMethod;
51-
import org.jruby.java.MiniJava;
52-
import org.jruby.java.proxies.JavaInterfaceTemplate;
51+
import org.jruby.java.codegen.RealClassGenerator;
5352
import org.jruby.javasupport.Java;
54-
import org.jruby.javasupport.JavaClass;
5553
import org.jruby.javasupport.util.RuntimeHelpers;
5654
import org.jruby.runtime.Block;
5755
import org.jruby.runtime.CallSite;
@@ -1154,10 +1152,10 @@ public synchronized void reify(String classDumpDir) {
11541152

11551153
m.aload(0); // self
11561154
m.ldc(methodName); // method name
1157-
MiniJava.coerceArgumentsToRuby(m, params, rubyIndex);
1155+
RealClassGenerator.coerceArgumentsToRuby(m, params, rubyIndex);
11581156
m.invokevirtual(javaPath, "callMethod", sig(IRubyObject.class, String.class, IRubyObject[].class));
11591157

1160-
MiniJava.coerceResultAndReturn(m, methodSignature[0]);
1158+
RealClassGenerator.coerceResultAndReturn(m, methodSignature[0]);
11611159
}
11621160

11631161
m.end();

src/org/jruby/RubyFixnum.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import org.jruby.anno.JRubyClass;
4343
import org.jruby.anno.JRubyMethod;
4444
import org.jruby.common.IRubyWarnings.ID;
45-
import org.jruby.java.MiniJava;
4645
import org.jruby.runtime.Block;
4746
import org.jruby.runtime.BlockBody;
4847
import org.jruby.runtime.ClassIndex;
@@ -1095,16 +1094,6 @@ public static RubyFixnum unmarshalFrom(UnmarshalStream input) throws java.io.IOE
10951094
public static IRubyObject induced_from(IRubyObject recv, IRubyObject other) {
10961095
return RubyNumeric.num2fix(other);
10971096
}
1098-
1099-
@Override
1100-
public IRubyObject to_java() {
1101-
return MiniJava.javaToRuby(getRuntime(), Long.valueOf(value));
1102-
}
1103-
1104-
@Override
1105-
public IRubyObject as(Class javaClass) {
1106-
return MiniJava.javaToRuby(getRuntime(), coerceToJavaType(getRuntime(), this, javaClass));
1107-
}
11081097

11091098
private static Object coerceToJavaType(Ruby ruby, RubyFixnum self, Class javaClass) {
11101099
if (!Number.class.isAssignableFrom(javaClass)) {

src/org/jruby/RubyObject.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,14 +1497,6 @@ public IRubyObject op_not_match(ThreadContext context, IRubyObject arg) {
14971497
return context.getRuntime().newBoolean(! callMethod(context, "=~", arg).isTrue());
14981498
}
14991499

1500-
public IRubyObject to_java() {
1501-
throw getRuntime().newTypeError(getMetaClass().getBaseName() + " cannot coerce to a Java type.");
1502-
}
1503-
1504-
public IRubyObject as(Class javaClass) {
1505-
throw getRuntime().newTypeError(getMetaClass().getBaseName() + " cannot coerce to a Java type.");
1506-
}
1507-
15081500

15091501
//
15101502
// INSTANCE VARIABLE RUBY METHODS

src/org/jruby/RubyProc.java

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,10 @@
3434
***** END LICENSE BLOCK *****/
3535
package org.jruby;
3636

37-
import java.lang.reflect.InvocationHandler;
38-
import java.lang.reflect.Method;
39-
import java.lang.reflect.Proxy;
4037
import org.jruby.anno.JRubyMethod;
4138
import org.jruby.anno.JRubyClass;
4239
import org.jruby.exceptions.JumpException;
4340
import org.jruby.internal.runtime.JumpTarget;
44-
import org.jruby.java.MiniJava;
4541
import org.jruby.parser.BlockStaticScope;
4642
import org.jruby.parser.StaticScope;
4743
import org.jruby.runtime.Block;
@@ -273,23 +269,4 @@ public RubyFixnum arity() {
273269
public RubyProc to_proc() {
274270
return this;
275271
}
276-
277-
@Override
278-
public IRubyObject as(Class asClass) {
279-
final Ruby ruby = getRuntime();
280-
if (!asClass.isInterface()) {
281-
throw ruby.newTypeError(asClass.getCanonicalName() + " is not an interface");
282-
}
283-
284-
return MiniJava.javaToRuby(ruby, Proxy.newProxyInstance(Ruby.getClassLoader(), new Class[] {asClass}, new InvocationHandler() {
285-
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
286-
IRubyObject[] rubyArgs = new IRubyObject[args.length + 1];
287-
rubyArgs[0] = RubySymbol.newSymbol(ruby, method.getName());
288-
for (int i = 1; i < rubyArgs.length; i++) {
289-
rubyArgs[i] = MiniJava.javaToRuby(ruby, args[i - 1]);
290-
}
291-
return MiniJava.rubyToJava(call(ruby.getCurrentContext(), rubyArgs));
292-
}
293-
}));
294-
}
295272
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy