Issue1642
Created on 2010-08-15.20:02:34 by denis.rangel, last changed 2010-10-14.12:54:37 by juneau001.
msg5974 (view) |
Author: Denis Guedes Rangel (denis.rangel) |
Date: 2010-08-15.20:02:33 |
|
There is an error when the argument and zero in jsr223 proxy! correction follows below.
Index: src/org/python/jsr223/PyScriptEngine.java
===================================================================
--- src/org/python/jsr223/PyScriptEngine.java (revisão 7093)
+++ src/org/python/jsr223/PyScriptEngine.java (cópia de trabalho)
@@ -144,7 +144,13 @@
PyObject pyMethod = thiz.__findattr__(method.getName());
if (pyMethod == null)
throw new NoSuchMethodException(method.getName());
- PyObject result = pyMethod.__call__(Py.javas2pys(args));
+
+ PyObject result;
+ if(args != null) {
+ result = pyMethod.__call__(Py.javas2pys(args));
+ } else {
+ result = pyMethod.__call__();
+ }
return result.__tojava__(Object.class);
} catch (PyException pye) {
throw scriptException(pye);
|
msg5998 (view) |
Author: Jim Baker (zyasoft) |
Date: 2010-08-21.04:16:46 |
|
This patch looks reasonable to me. Would you mind adding some unit tests, so we can see all the expected cases you expect this to handle?
Probably this would best be done by modifying tests/java/org/python/jsr223/ScriptEngineTest.java
Thanks!
|
msg6090 (view) |
Author: Juneau001 (juneau001) |
Date: 2010-09-22.23:46:58 |
|
I will write some unit tests for this.
|
msg6092 (view) |
Author: Denis Guedes Rangel (denis.rangel) |
Date: 2010-09-23.13:37:40 |
|
Sorry for the delay. My computer broke, so I can buy one for Christmas ;-(. Here's the complete diff
|
msg6166 (view) |
Author: Juneau001 (juneau001) |
Date: 2010-10-14.12:54:36 |
|
Accepted the patch for PyScriptEngine.java. I had to alter some tests in ScriptEngineTest.java as compared to the .diff that was provided, but everything seems to work fine. Patch changes have been committed.
|
|
Date |
User |
Action |
Args |
2010-10-14 12:54:37 | juneau001 | set | status: open -> closed resolution: accepted messages:
+ msg6166 |
2010-09-23 13:37:42 | denis.rangel | set | files:
+ jython.diff keywords:
+ patch messages:
+ msg6092 |
2010-09-22 23:46:58 | juneau001 | set | assignee: juneau001 messages:
+ msg6090 nosy:
+ juneau001 |
2010-09-08 19:34:09 | zyasoft | set | priority: high |
2010-08-21 04:20:19 | zyasoft | set | title: JSR223 ScriptEngine#getInterface returns a NPE when called with zero args -> JSR223 PyScriptEngine#getInterface returns a NPE when called with zero args |
2010-08-21 04:20:11 | zyasoft | set | title: Proxy jsr223 Nullpointer no arguments -> JSR223 ScriptEngine#getInterface returns a NPE when called with zero args |
2010-08-21 04:16:46 | zyasoft | set | nosy:
+ zyasoft messages:
+ msg5998 |
2010-08-15 20:02:34 | denis.rangel | create | |
|