[Jython-dev] Possible bug?
by Iwan Vosloo other posts by this author
Nov 2 2004 8:12PM messages near this date
Re: [Jython-dev] Question on Windows XP SP2 support
|
[Jython-dev] Testimonial for the "Who uses Jython" page
Hi there,
would you agree that this is an abscure bug??:
The following works fine assuming the java code marked [java code] below:
javac -d . I.java I2.java A.java run.java; java run
If I substitute run.py (just above the java code) for run.java, and execute:
javac -d . I.java I2.java A.java; jython run.py
I get:
foo
Traceback (innermost last):
File "run.py", line 10, in ?
AttributeError: abstract method "bar" not implemented
It gets more interesting - the following addition to run.py makes jython go into a busy-wait
loop:
<in class run>
def bar(self):
A.bar(self)
#--[ run.py ]----------
import I2
import A
class run(I2,A):
def foo(self):
print "foo"
p = run()
p.foo()
p.bar()
--------------------------------------------------[java code]
//--[ I.java ]----------
public interface I
{
public void bar();
}
//----------[ A.java ]
public class A implements I
{
public void bar()
{ System.out.println("bar"); }
}
//--[ I2.java ]----------
public interface I2 extends I
{
public void foo();
}
//--[ run.java ]----------
public class run extends A implements I2
{
public void foo()
{ System.out.println("foo"); }
public static void main(String[] args)
{
run p = new run();
p.foo();
p.bar();
}
}
-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Jython-dev mailing list
Jython-dev@[...].net
https://lists.sourceforge.net/lists/listinfo/jython-dev
|