[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commit-cp] [bugs #12255] all Java Proxy classes do not handle arguments
From: |
Robert Schuster |
Subject: |
[commit-cp] [bugs #12255] all Java Proxy classes do not handle arguments properly |
Date: |
Wed, 9 Mar 2005 02:27:22 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.5) Gecko/20050107 |
URL:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=12255>
Summary: all Java Proxy classes do not handle arguments
properly
Project: classpath
Submitted by: rschuster
Submitted on: Wed 03/09/2005 at 02:27
Category: classpath
Severity: 5 - Average
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Platform Version: None
_______________________________________________________
Details:
If I create a Proxy instance for an interface where the called methods has
arguments the actual values (instances) are missing in the argument-array of
InvocationHandler.invoke(). However the length of the array matches what I
would expect.
Here is a small test that demonstrates the problem:
import java.beans.EventHandler;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.lang.reflect.Proxy;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
public class EHTest3 implements InvocationHandler {
public static void main(String args[]) throws Exception {
new EHTest3();
}
EHTest3() throws Exception {
ActionListener al = (ActionListener)
Proxy.newProxyInstance(ActionListener.class.getClassLoader(),
new Class[] { ActionListener.class }, this);
al.actionPerformed(new ActionEvent(this, 0, "GNU yourself!"));
}
public Object invoke(Object proxy, Method method, Object[] args) throws
Throwable {
System.out.println("invoke: " + method);
System.out.println("args.length: " + args.length);
System.out.println("args[0]: " + args[0]);
return null;
}
}
On JamVM 1.2.5 this will say:
invoke: public abstract void
java.awt.event.ActionListener.actionPerformed(java.awt.event.A ctionEvent)
args.length: 1
args[0]: null
But args[0] should be the ActionEvent not null.
I am using the pure Java solution for Proxy class generation .
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=12255>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [commit-cp] [bugs #12255] all Java Proxy classes do not handle arguments properly,
Robert Schuster <=