Message4155

Author aviflax
Recipients aviflax
Date 2009-02-22.04:37:52
SpamBayes Score 1.5287771e-13
Marked as misclassified No
Message-id <1235277473.87.0.423374690538.issue1265@psf.upfronthosting.co.za>
In-reply-to
Content
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!
History
Date User Action Args
2009-02-22 04:37:54aviflaxsetrecipients: + aviflax
2009-02-22 04:37:53aviflaxsetmessageid: <1235277473.87.0.423374690538.issue1265@psf.upfronthosting.co.za>
2009-02-22 04:37:53aviflaxlinkissue1265 messages
2009-02-22 04:37:52aviflaxcreate