Bug 9143 - Twice defined static helper variable
Summary: Twice defined static helper variable
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: 4.4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2012-12-27 11:27 UTC by Mart Roosmaa
Modified: 2013-03-05 15:06 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 Mart Roosmaa 2012-12-27 11:27:59 UTC
When there are 2 methods with same name, one which takes a generic list as a parameter and the other one a regular list, the binding generator generates the helper static method twice.

Which results in the generated code ( gist @ https://gist.github.com/4389571 ) producing the following error: `Error CS0102: The type 'Facebook.Session.OpenRequest' already contains a definition for 'id_setPermissions_Ljava_util_List_' (CS0102)`

The generator should either have a different name for a generic list static variable, or keep track of variables it has already defined to avoid this problem.
Comment 1 Atsushi Eno 2013-03-05 15:06:42 UTC
I am sorry to take long time to reply, I thought it is part of new Facebook binding issue that should be fixed in the latest release.

This is actually twice generation of the same method but those two methods resulting in the same API signature and thus compile error. Since we cannot arbitrarily determine which of them should be "live", one of them needs to be explicitly removed by Metadata.xml using <remove-node> element by those who binds the Java API. They would be most likely identical operation in the end, but we cannot say it is always true.

(Things may become different if we make changes on how to bind collections, but this manual removal rule applies so far.)