[fpc-devel] FPC-JVM: Breaking up a cycle

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Aug 28 21:26:04 CEST 2011


On 27 Aug 2011, at 11:33, Sven Barth wrote:

> On 27.08.2011 00:49, Jonas Maebe wrote:
>> 
>> BTW: the javapp program normally solves the ordering problem for you. However, it can't do that if there are circular references... Normally, you'd solve those by specifying the classes whose removal results in breaking the circle(s) using the "-a" parameter of javapp (it will then turn those classes into an empty definition), but that only works for top-level classes.
> 
> Besides the AVViewGroup problem there weren't any circles, but javapp failed to order the other classes correctly...

That's because the behaviour of the topological sort that's used to order them is probably undefined in the presence of cycles. Maybe it simply terminates when it encounters the first cycle to avoid getting stuck in an endless loop later.

> While we're at it: for one class (android.os.FileObserver, see here: http://developer.android.com/reference/android/os/FileObserver.html ) it generated the following:
> 
> === source begin ===
> 
>  public
>    procedure <init>_(para1: JLString); overload; virtual;
>    procedure <init>_(para1: JLString; para2: jint); overload; virtual;
> 
> === source end ===
> 
> These should be constructers, shouldn't they? Other constructors (even with parameters) were converted correctly.

What happens if you use "javap" to print that class rather than javapp? So
  javap -classpath android.jar android.os.FileObserver

> Besides this javapp is a invaluable tool for Pascal developers :D

It was to be expected that it wouldn't work perfectly for everything immediately :)


Jonas


More information about the fpc-devel mailing list