Skip to content
Browse files

JRUBY-2106: Regression after recent JI changes: Some unit tests cannot

be executed, just exit.

Also, added the regression test.


git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@5915 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information...
1 parent 4b734b2 commit a98bbaf3112cb1eb14076c2e1282e1b77963a4a4 @vvs vvs committed Feb 12, 2008
Showing with 14 additions and 1 deletion.
  1. +7 −0 src/org/jruby/javasupport/Java.java
  2. +7 −1 test/test_higher_javasupport.rb
View
7 src/org/jruby/javasupport/Java.java
@@ -53,13 +53,15 @@
import org.jruby.RubyBignum;
import org.jruby.RubyClass;
import org.jruby.RubyClassPathVariable;
+import org.jruby.RubyException;
import org.jruby.RubyFixnum;
import org.jruby.RubyFloat;
import org.jruby.RubyModule;
import org.jruby.RubyProc;
import org.jruby.RubyString;
import org.jruby.RubyTime;
import org.jruby.common.IRubyWarnings.ID;
+import org.jruby.exceptions.RaiseException;
import org.jruby.javasupport.proxy.JavaProxyClass;
import org.jruby.javasupport.proxy.JavaProxyConstructor;
import org.jruby.javasupport.proxy.JavaProxyMethod;
@@ -561,6 +563,11 @@ public static RubyModule getProxyOrPackageUnderPackage(final Ruby runtime, RubyM
// package name. (and seriously, folks, look into best practices...)
try {
return getProxyClass(runtime, JavaClass.forName(runtime, fullName));
+ } catch (RaiseException re) { /* expected */
+ RubyException rubyEx = re.getException();
+ if (rubyEx.kind_of_p(runtime.getStandardError()).isTrue()) {
+ RuntimeHelpers.setErrorInfo(runtime, runtime.getNil());
+ }
} catch (Exception e) { /* expected */ }
RubyModule packageModule;
View
8 test/test_higher_javasupport.rb
@@ -672,5 +672,11 @@ def test_package_module_aliased_methods
java.lang.String # ensure java.lang.String has been loaded
assert java.lang.__constants__.include?('String')
end
-end
+ # JRUBY-2106
+ def test_package_load_doesn_set_error
+ $! = nil
+ undo = javax.swing.undo
+ assert_nil($!)
+ end
+end

0 comments on commit a98bbaf

Please sign in to comment.
Something went wrong with that request. Please try again.