Message4155
I'm working on using the Java library Restlet with Jython (going well,
plan to write an article about it soon) and I'm encountering this problem:
------------------------------------------------------------------
from org.restlet.resource import Resource
class my_resource(Resource):
def __init__(self):
Resource.__init__(self)
# By default, modifiable is False. Let's set it to True.
self.setModifiable(True)
# Prints True as one would expect
print my_resource().isModifiable()
# Create an instance using Java reflection
obj = my_resource.getClass(my_resource).getConstructor(my_resource,
None).newInstance(None)
# Prints False, which means that when one uses Java reflection, the
Jython subclass' constructor isn't properly called, or something
print obj.isModifiable()
------------------------------------------------------------------
result:
------------------------------------------------------------------
True
False
------------------------------------------------------------------
This is a showstopper for me, because Restlet internally uses reflection
all over the place.
Other than this issue, the project is going well. I look forward to
verification that my observation about this behaviour is correct! |
|
Date |
User |
Action |
Args |
2009-02-22 04:37:54 | aviflax | set | recipients:
+ aviflax |
2009-02-22 04:37:53 | aviflax | set | messageid: <1235277473.87.0.423374690538.issue1265@psf.upfronthosting.co.za> |
2009-02-22 04:37:53 | aviflax | link | issue1265 messages |
2009-02-22 04:37:52 | aviflax | create | |
|