Bug 14687 - Non-abstract Java method produces abstract method in C# binding
Summary: Non-abstract Java method produces abstract method in C# binding
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.8.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2013-09-12 13:28 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2013-09-17 11:14 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Test case (93.27 KB, application/zip)
2013-09-12 13:28 UTC, Brendan Zagaeski (Xamarin Team, assistant)

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Brendan Zagaeski (Xamarin Team, assistant) 2013-09-12 13:28:55 UTC
Created attachment 4854 [details]
Test case

Filed on behalf of a user.

## Steps to reproduce
1. Open attached test case.
2. Build.

## Result
The method Com.Nostra13.Universalimageloader.Core.Assist.Deque.LinkedBlockingDeque.AbstractItr.Next() is bound as an abstract method, but `api.xml` correctly [1] shows that it is non-abstract:

<method abstract="false" deprecated="not deprecated" final="false" name="next" native="false" return="E" static="false" synchronized="false" visibility="public">

[1] https://github.com/nostra13/Android-Universal-Image-Loader/blob/e4d6a16f353e6f0a98185fda7995f89c54c104ea/library/src/com/nostra13/universalimageloader/core/assist/deque/LinkedBlockingDeque.java#L1087

## Build error
"UniversalImageLoaderBinding/obj/Debug/generated/src/Com.Nostra13.Universalimageloader.Core.Assist.Deque.LinkedBlockingDeque.cs(24,24): Error CS0534: `Com.Nostra13.Universalimageloader.Core.Assist.Deque.LinkedBlockingDeque.DescendingItr' does not implement inherited abstract member `Com.Nostra13.Universalimageloader.Core.Assist.Deque.LinkedBlockingDeque.AbstractItr.Next()' (CS0534) (UniversalImageLoaderBinding)"

## Source for the JAR file

## Version information
Xamarin.Android 4.8.2
Xamarin Studio 4.1.10
Comment 1 Atsushi Eno 2013-09-17 07:33:39 UTC
TL;DR - it is due to generics limitation.

This next() is NOT from LinkedBlockingDeque.AbstractItr but from java.util.Iterator. Since AbstractItr.next() specifies "E" as the return type, it is not regarded as the same method that Iterator.next().

There *may* be some remedy that a generator that deals generics perfectly but that's not what we do for generator, or we don't even think it's really doable.

Hence it is required to remove the cause of the problem maunally. In this case, generic parameter E is causing the issue, so we give another metadata fix:

    <attr path="/api/package[@name='com.nostra13.universalimageloader.core.assist.deque']/class[@name='LinkedBlockingDeque.AbstractItr']/method[@name='next']" name="return">Java.Lang.Object</attr>

With this it compiles.

(Override check is done in Java level, so "managedReturn" doesn't work here.)
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2013-09-17 11:14:42 UTC
Sounds good. Thanks!