Issue449956

classification
Title: jythonc 2.1a3 --package problem
Type: Severity: normal
Components: Jythonc compiler Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: pedronis Nosy List: pedronis
Priority: normal Keywords:

Created on 2001-08-10.23:22:59 by anonymous, last changed 2001-11-20.16:56:25 by pedronis.

Messages
msg381 (view) Author: Nobody/Anonymous (nobody) Date: 2001-08-10.23:22:59
Hi!
I've found and (more or less) isolated a bug in jythonc
2.1a3. The bug occurs under the following circumstances:

1. A package derives a subclass A from a java class.
2. The same package derives a subclass B from A.
3. The package gets compiled with the --package option.

When creating java code, jythonc 2.1a3 doubles the
package name in front of B, i.e., if the name of the
package is foo, then it creates the name foo.foo.B,
which causes javac to terminate with an error.

Here's a program that reproduces the bug:
-----------------------------------
import java

class spam(java.lang.Object):
    pass

class eggs(spam):
    pass
-----------------------------------

Here's what happens when the above program is being
compiled with the --package option:

/usr/local/jython-2.1a3/jythonc --package foo jcbug.py

processing jcbug

Required packages:
  java.lang

Creating adapters:

Creating .java files:
  jcbug module
    spam extends java.lang.Object
    eggs extends foo.foo.jcbug.spam

Compiling .java to .class...
Compiling with args: ['/usr/local/jdk1.2.2/bin/javac',
'-classpath',
'/usr/local/jython-2.1a3/jython.jar::./jpywork::/usr/local/jython-2.1a3/Tools/jythonc:/home/brinkman/prog/java/test/.:/usr/local/jython-2.1a3/Lib:/home/brinkman/prog/java/gumbie:/home/brinkman/prog/java',
'./jpywork/foo/jcbug.java']
1  ./jpywork/foo/jcbug.java:103: Superclass
foo.foo.jcbug.spam of nested class foo.jcbug. eggs not
found.
    public static class eggs extends foo.foo.jcbug.spam
implements org.python.core.PyProxy,
org.python.core.ClassDictInit {
                                     ^
1 error

ERROR DURING JAVA COMPILATION... EXITING


This problem does not occur with jythonc 2.0, so it
seems to be new.
Best,
    Peter
    brinkman@math.uiuc.edu
msg382 (view) Author: Samuele Pedroni (pedronis) Date: 2001-11-20.16:50:44
Logged In: YES 
user_id=61408

Added as test339
msg383 (view) Author: Samuele Pedroni (pedronis) Date: 2001-11-20.16:56:25
Logged In: YES 
user_id=61408

Fixed in

jython/Tools/jythonc ObjectFactory.py,2.11 
                     compile.py,2.20
History
Date User Action Args
2001-08-10 23:22:59anonymouscreate