From: Peter B. <bri...@ma...> - 2001-08-16 21:20:12
|
Finn: I've managed to reproduce the jpy$packages problem with a small example. We need the following two files, foo.py and bug.py. -------------------------- foo.py ----------------------------- import java class foo(java.lang.Object): pass --------------------------------------------------------------- -------------------------- bug.py ----------------------------- from foo import foo class bar(foo): pass --------------------------------------------------------------- When compiling this with jythonc --deep bug.py I get the following messages: --------------------------------------------------------------- processing bug processing foo Required packages: java.lang Creating adapters: Creating .java files: foo module foo extends java.lang.Object bug module bar extends foo Compiling .java to .class... Compiling with args: ['/usr/local/j2sdk1.3.1/bin/javac', '-classpath', '/usr/local/jython-2.0/jython.jar::./jpywork::/usr/local/jython-2.0/Tools/jythonc:/home/brinkman/prog/java/gumbie/work/.:/usr/local/jython-2.0/Lib:/home/brinkman/prog/java/gumbie:/home/brinkman/prog/java', './jpywork/foo.java', './jpywork/bug.java']1 ./jpywork/bug.java:60: jpy$packages is inherited from foo and hides variable in outer class bug. An explicit 'this' qualifier must be used to select the desired instance. Py.initProxy(this, "bug", "bar", new Object[] {}, jpy$packages, jpy$properties, "", new String[] {"bug", "foo"}); ^ ./jpywork/bug.java:60: jpy$properties is inherited from foo and hides variable in outer class bug. An explicit 'this' qualifier must be used to select the desired instance. Py.initProxy(this, "bug", "bar", new Object[] {}, jpy$packages, jpy$properties, "", new String[] {"bug", "foo"}); ^ 2 errors ERROR DURING JAVA COMPILATION... EXITING --------------------------------------------------------------- Experiments suggest that the following circumstances are necessary to trigger the bug. 1. The class foo is derived from a java class. 2. The name of the module (foo) is the same as the name of the class. 3. The whole thing gets compiled with the --deep option. Note that these three conditions are not sufficient to trigger the bug; I've got examples satisfying both 1. and 2. that compile just fine. Best, Peter On Thu, Aug 16, 2001 at 07:46:07PM +0000, Finn Bock wrote: > [Peter Brinkmann] > > >Hi! > >I'm afraid I've run into another problem related to jythonc. When compiling > >a rather large project, jythonc quit after javac reported the following > >error: > > > >1 ./jpywork/small.java:183: Variable 'jpy$packages' is inherited in nested class small. newgui, > > and hides a variable of the same name in class small. An explicit 'this' qualifier must ... > > > >Has anyone noticed this kind of problem before? > > It is new to me. > > >I can try to reproduce the > >problem with a small amount of code, but before I do that, I'd like to make > >sure that this one is new. > > An example would make it a lot easier for us. You already know where to > post it: > > http://sourceforge.net/tracker/?group_id=12867&atid=112867 > > regards, > finn > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > http://lists.sourceforge.net/lists/listinfo/jython-users |