Message3958

Author crotwell
Recipients akong, crotwell, fwierzbicki, pzack
Date 2008-12-17.21:05:15
SpamBayes Score 1.9984014e-15
Marked as misclassified No
Message-id <1229547917.69.0.0671009848089.issue1002@psf.upfronthosting.co.za>
In-reply-to
Content
Attached is the patch. However, it didn't come from me, but from Zack
Thunemann. I think I have copied his code into
PyReflectedFunction.__call__ in the latest svn and created a patch from
that, attached. It seems to address the issue shown with his MyClass
java code.

However, this patch does not address the original issue. Here is output
from jython with the patch and the class from message 3088. The test of
MyClass now works correctly. However, the original example of
java.net.URL.toString() still fails. Perhaps there is more to it in this
case as toString() is not truely a static method at all, but really an
object method on the object java.lang.Class. I am not sure of how to
modify __call__ to detect this case. 


rabbit:~/dev/jython/jython/dist crotwell$ bin/jython
Jython 2.5b0+ (trunk:5774M, Dec 17 2008, 15:46:30) 
[Java HotSpot(TM) Client VM ("Apple Computer, Inc.")] on java1.5.0_16
Type "help", "copyright", "credits" or "license" for more information.
>>> from test import MyClass

mc = MyClass()
print mc.func()
print MyClass.func(mc)
print 'Test complete'
>>> >>> >>> In class method
>>> In static function
>>> Test complete
>>> 
>>> 
>>> from java.net import URL
>>> URL.toString()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: toString(): expected 1 args; got 0
History
Date User Action Args
2008-12-17 21:05:17crotwellsetmessageid: <1229547917.69.0.0671009848089.issue1002@psf.upfronthosting.co.za>
2008-12-17 21:05:17crotwellsetrecipients: + crotwell, fwierzbicki, akong, pzack
2008-12-17 21:05:17crotwelllinkissue1002 messages
2008-12-17 21:05:16crotwellcreate