Message822
Given an abstract java class with the following excerpt:
<JAVA CODE>
protected Operator(String title){
this.title=title;
this.parameters=new Vector();
setDefaultParameters();
}
abstract public void setDefaultParameters();
</JAVA CODE>
Then subclass this with the following in jython
<JYTHON CODE>
class pyTest(Operator):
def setDefaultParameters(self):
print "in SDP"
def __init__(self):
self.setDefaultParameters()
if __name__ == "__main__":
tester=pyTest()
</JYTHON CODE>
This generates an error when you run the script through jython
<ERROR>
Traceback (innermost last):
File ".../pyTest.py", line 23, in ?
TypeError: Default constructor failed for Java superclass Operator
</ERROR>
It appears that jython is not truly overriding the default methods in the class.
pfpeterson@anl.gov |
|
| Date |
User |
Action |
Args |
| 2008-02-20 17:17:14 | admin | link | issue713373 messages |
| 2008-02-20 17:17:14 | admin | create | |
|