Bug 8226 - Java @Override+final methods bound as C# override, not C# sealed+override
Summary: Java @Override+final methods bound as C# override, not C# sealed+override
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.3.x
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2012-11-05 14:40 UTC by Jonathan Pryor
Modified: 2012-11-06 09:56 UTC (History)
1 user (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Jonathan Pryor 2012-11-05 14:40:59 UTC
Context: http://lists.ximian.com/pipermail/monodroid/2012-November/012768.html

Problem: FragmentActivity.OnRetainNonConfigurationInstance() is `override`, but not `sealed override`:
http://androidapi.xamarin.com/?link=M%3aAndroid.Support.V4.App.FragmentActivity.OnRetainNonConfigurationInstance()

Consequently, user code can override the method from C#. However, this fails during Java compilation because the Java method is `final`, and cannot be overridden: http://developer.android.com/reference/android/support/v4/app/FragmentActivity.html#onRetainNonConfigurationInstance()

Method XML declaration:

<method abstract="false" deprecated="not deprecated" final="true" name="onRetainNonConfigurationInstance" native="false" return="java.lang.Object" static="false" synchronized="false" visibility="public">

//method/[@final='true'] methods should either be non-virtual or (when overriding base class methods) be `sealed override`.
Comment 1 Atsushi Eno 2012-11-06 09:56:38 UTC
Fixed in master (cf04b49).