Message4337
A simple java class hierarchy:
package somepackage;
public class Banana {
public void amethod() {}
public void amethod(int x, int y) {}
}
---
and:
package somepackage;
public class Pear extends Banana {
public void amethod(int x, int y)
{
}
}
---
Inside Jython as it ships:
Jython 2.5b3 (Release_2_5beta3:6092, Mar 10 2009, 15:34:57)
[Java HotSpot(TM) Client VM (Apple Inc.)] on java1.5.0_16
Type "help", "copyright", "credits" or "license" for more information.
>>> from somepackage import *
>>> x = Pear()
>>> x.amethod()
All ok.
with python.security.respectJavaAccessibility = false
Jython 2.5b3 (Release_2_5beta3:6092, Mar 10 2009, 15:34:57)
[Java HotSpot(TM) Client VM (Apple Inc.)] on java1.5.0_16
Type "help", "copyright", "credits" or "license" for more information.
>>> from somepackage import *
>>> x = Pear()
>>> x.amethod()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: amethod(): expected 2 args; got 0
It's broken at least this far:
>>> print x.amethod.argslist
array(org.python.core.ReflectedArgs, [class somepackage.Pear, false, 0, public void
somepackage.Pear.amethod(int,int)
(int, int, )])
----
I can't say for sure how long this behavior has been in place (at least as far back as beta1, but maybe
I've gotten lucky for a lot longer than that). Since every method that's implicated here is public I
find it very odd (and very inconvenient) that respectJavaAccessibility = false appears to reduce the
visibility of the method. I'm stepping through PyJavaType#init but I haven't found anything obviously
wrong yet. |
|
Date |
User |
Action |
Args |
2009-03-23 03:02:46 | marcdownie | set | recipients:
+ marcdownie |
2009-03-23 03:02:45 | marcdownie | set | messageid: <1237777365.97.0.549037905522.issue1285@psf.upfronthosting.co.za> |
2009-03-23 03:02:45 | marcdownie | link | issue1285 messages |
2009-03-23 03:02:44 | marcdownie | create | |
|