From: <no...@so...> - 2001-02-16 07:03:59
|
Bug #122847, was updated on 2000-Nov-18 11:31 Here is a current snapshot of the bug. Project: Jython Category: Core Status: Open Resolution: None Bug Group: None Priority: 1 Submitted by: bckfnn Assigned to : nobody Summary: Can't acces public member of package private base class Details: For some reason, JPython cannot access a public method that is defined in the package private base class of my object instance. public Foo extends (package private) Bar. Bar defines public String hi(). If I instantiate Foo and call hi() on the instance, I get an IllegalAccessException. Java classes: -------------------------------------------------------------- package testpackage; public class Foo extends Bar { } class Bar { public String hi() { return "hi"; } } --------------------------------------------------------------- Python code: --------------------------------------------------------------- >>> from testpackage import Foo >>> f = Foo() >>> f.hi() --------------------------------------------------------------- Resulting exception: --------------------------------------------------------------- Traceback (innermost last): File "<console>", line 1, in ? java.lang.IllegalAccessException: testpackage/Bar at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:158) at org.python.core.PyMethod.__call__(PyMethod.java:66) at org.python.core.PyObject.__call__(PyObject.java:260) at org.python.core.PyInstance.invoke(PyInstance.java:254) at org.python.pycode._pyx5.f$0(<console>) at org.python.pycode._pyx5.call_function(<console>) at org.python.core.PyTableCode.call(PyTableCode.java:155) at org.python.core.Py.runCode(Py.java:937) at org.python.core.Py.exec(Py.java:951) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:121) at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:82) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:63) at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:42) at org.python.util.InteractiveConsole.push(InteractiveConsole.java:84) at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:63) at org.python.util.jpython.main(jpython.java:141) java.lang.IllegalAccessException: java.lang.IllegalAccessException: testpackage/Bar Follow-Ups: Date: 2001-Feb-15 23:05 By: ianzsk Comment: this is a similar bug to #132462 I've altered a few methods in PyJavaClass and added another Options flag to use the JavaAccessibility.setAccessible() to "mimic" the equivalent Java access. (Now if I can only give jython classes access to protected members of Java super classes!) ------------------------------------------------------- Date: 2000-Nov-23 01:06 By: bckfnn Comment: I don't think this is solvable at all! The method is accessible through java but inaccessible through reflection! ------------------------------------------------------- For detailed info, follow this link: http://sourceforge.net/bugs/?func=detailbug&bug_id=122847&group_id=12867 |