Bug 11471 - annotations need to be generated as interface, not class
Summary: annotations need to be generated as interface, not class
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.8.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2013-03-29 03:31 UTC by Atsushi Eno
Modified: 2013-05-01 06:37 UTC (History)
1 user (show)

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

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 Atsushi Eno 2013-03-29 03:31:01 UTC
background: http://forums.xamarin.com/discussion/2722/change-base-class-in-binding

We historically generated annotation types as classes, because AOSP xml said they are <class>. But it was buggy. The correct way to implement them is rather to treat them as interface, and generate interface as well.

This brings some API change, since they are generated as classes so far. The likely migration path is that we generate "class" for those annotations that directly implement java.lang.annotation.Annotation, to implement the exact annotation and mark as [Obsolete].

public interface IDocumented : Java.Lang.Annotations.IAnnotation { ... }
[Obsolete ("This is historical and invalid class. Do not use it")]
public class Documented : Java.Lang.Object, IDocumented { ... }
Comment 1 Atsushi Eno 2013-05-01 06:37:11 UTC
Fixed [jar2xml master 4c866d1][monodroid master ef13d96]