ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> Jython-dev
Jython-dev
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved