Message4337

Author marcdownie
Recipients marcdownie
Date 2009-03-23.03:02:44
SpamBayes Score 2.46414e-13
Marked as misclassified No
Message-id <1237777365.97.0.549037905522.issue1285@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-03-23 03:02:46marcdowniesetrecipients: + marcdownie
2009-03-23 03:02:45marcdowniesetmessageid: <1237777365.97.0.549037905522.issue1285@psf.upfronthosting.co.za>
2009-03-23 03:02:45marcdownielinkissue1285 messages
2009-03-23 03:02:44marcdowniecreate