Issue Details (XML | Word | Printable)

Key: JRUBY-177
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Ola Bini
Reporter: Sundararajan
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
JRuby

Attempting to create a java.lang.reflect.Proxy instance results in StackOverflow

Created: 06/Oct/06 04:44 AM   Updated: 30/Apr/07 03:12 AM   Resolved: 29/Dec/06 09:24 AM
Return to search
Component/s: Interpreter
Affects Version/s: JRuby 0.9.0
Fix Version/s: JRuby 0.9.8

Time Tracking:
Not Specified

Environment: Windows 2000, JRuby 0.9.0 through jsr223 script engine


 Description  « Hide

Attempted to create a java.lang.reflect.Proxy using the following code:

require 'java';

include_class('java.lang.reflect.InvocationHandler');
include_class('java.lang.reflect.Proxy') {

x "JProxy"
};

include_class('java.lang.Runnable');
include_class('java.util.concurrent.Callable');
include_class("java.lang.reflect.Array") {

x "JArray"
};

include_class("java.lang.Class") {

x "JClass"
}

class MyRunnable < InvocationHandler
def invoke(obj, name, args)
puts name + " called"
end
end

include_class('java.lang.Runnable')

types = JArray.newInstance(JClass, 2);
types[0] = Runnable
types[1] = Callable

m = MyRunnable.new
r = JProxy.newProxyInstance(nil, types, m);

puts r.kind_of?(Runnable)
puts r.kind_of?(Callable)

---------------

At JProxy.newInstance line "stack level too deep" error is thrown; searched for this string in JRuby 0.9.0 source base - found that in org.jruby.evaluator.EvaluationState class.



Ola Bini made changes - 29/Dec/06 09:24 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Assignee Ola Bini [ olagus ]
Fix Version/s JRuby 0.9.3 [ 13069 ]
Resolution Fixed [ 1 ]
Charles Oliver Nutter made changes - 30/Apr/07 03:12 AM
Status Resolved [ 5 ] Closed [ 6 ]