Bug 11777 - FlagsAttribute [Flags] missing on FileCreationMode enum (and lots of other enums)
Summary: FlagsAttribute [Flags] missing on FileCreationMode enum (and lots of other en...
Status: CONFIRMED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.7.x
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Radek Doulik
URL:
Depends on:
Blocks:
 
Reported: 2013-04-14 09:18 UTC by softlion
Modified: 2017-09-01 19:04 UTC (History)
5 users (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 for Bug 11777 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description softlion 2013-04-14 09:18:52 UTC
FlagsAttribute [Flags] is missing on FileCreationMode enum (and lots of other enums)

FlagsAttribute is not required, but should be set on all enums which can be combined.

Code analysis tools have this rule and detects inconsistencies.
Comment 1 Radek Doulik 2013-06-11 09:43:08 UTC
It is fixed in master and will be available in the next alpha release.
Comment 2 Udham Singh 2014-03-27 09:54:09 UTC
I have checked this issue on following builds:

Windows 8.1
Xamarin Studio : 4.2.3 (build 60)
Xamarin.Android: 4.13.0 (Business Edition)

As per my observation, I have noticed that FileCreationMode enum has been marked as [Flags] attribute, but also noticed that the other or few more enums are not marked as [Flags].

Please refer the screencast: http://screencast.com/t/7sAUnjay2

Hence I am reopening this issue.
Comment 3 Jon Douglas [MSFT] 2017-09-01 19:04:03 UTC
I am confirming this issue that many enums in Xamarin.Android that should have [Flags] do not have the [Flags] attribute and thus require workarounds to combine. I would list all these items in this bug report, but I believe a larger amount of investigation is needed.

I'm curious if we can find all these items using: https://developer.android.com/reference/android/support/annotation/IntDef.html and the "flags" = true to figure out where each enum needs a [Flags] attribute.

Example:

https://github.com/android/platform_frameworks_base/blob/b056324630b8adfeb38393bcab49f3b9c720f4fd/core/java/android/content/Context.java#L89-L94