From 787785647a4713adb0cc4bb1bcd46141b23ff900 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Thu, 29 Sep 2016 01:48:18 +0900 Subject: [PATCH] [Mono.Android] AtomicInteger shouldn't have And* properties (#240) Fixes: https://bugzilla.xamarin.com/show_bug.cgi?id=44391 `java.util.concurrent.atomic.AtomicInteger.getAndDecrement()` is bound as the `AtomicInteger.AndDecrement` property, which is "weird". Similarly, `AtomicLong.getAndDecrement()` is bound as the `AtomicLong.AndDecrement` property. Fix the `AtomicInteger` and `AtomicLong` types so that the `AndDecrement` and `AndIncrement` properties are `[Obsolete]`, with "proper" method bindings of `GetAndDecrement()` and `GetAndIncrement()`. Additionally, `metadata` had wrong relative path specification which broke our internal "monodroid" build, so correct them. --- .../AtomicInteger.cs | 17 +++++++++++++++++ .../Java.Util.Concurrent.Atomic/AtomicLong.cs | 17 +++++++++++++++++ src/Mono.Android/Mono.Android.csproj | 2 ++ src/Mono.Android/metadata | 9 +++++++++ 4 files changed, 45 insertions(+) create mode 100644 src/Mono.Android/Java.Util.Concurrent.Atomic/AtomicInteger.cs create mode 100644 src/Mono.Android/Java.Util.Concurrent.Atomic/AtomicLong.cs diff --git a/src/Mono.Android/Java.Util.Concurrent.Atomic/AtomicInteger.cs b/src/Mono.Android/Java.Util.Concurrent.Atomic/AtomicInteger.cs new file mode 100644 index 000000000..a619d11a4 --- /dev/null +++ b/src/Mono.Android/Java.Util.Concurrent.Atomic/AtomicInteger.cs @@ -0,0 +1,17 @@ +using System; + +namespace Java.Util.Concurrent.Atomic +{ + public partial class AtomicInteger + { + [Obsolete ("This property was generated for getAndDecrement() method, while it does not make sense. It will be removed in the future version")] + public int AndDecrement { + get { return GetAndDecrement (); } + } + [Obsolete ("This property was generated for getAndIncrement() method, while it does not make sense. It will be removed in the future version")] + public int AndIncrement { + get { return GetAndIncrement (); } + } + } +} + diff --git a/src/Mono.Android/Java.Util.Concurrent.Atomic/AtomicLong.cs b/src/Mono.Android/Java.Util.Concurrent.Atomic/AtomicLong.cs new file mode 100644 index 000000000..0cf935f75 --- /dev/null +++ b/src/Mono.Android/Java.Util.Concurrent.Atomic/AtomicLong.cs @@ -0,0 +1,17 @@ +using System; + +namespace Java.Util.Concurrent.Atomic +{ + public partial class AtomicLong + { + [Obsolete ("This property was generated for getAndDecrement() method, while it does not make sense. It will be removed in the future version")] + public long AndDecrement { + get { return GetAndDecrement (); } + } + [Obsolete ("This property was generated for getAndIncrement() method, while it does not make sense. It will be removed in the future version")] + public long AndIncrement { + get { return GetAndIncrement (); } + } + } +} + diff --git a/src/Mono.Android/Mono.Android.csproj b/src/Mono.Android/Mono.Android.csproj index 43c3c56ff..9c771c155 100644 --- a/src/Mono.Android/Mono.Android.csproj +++ b/src/Mono.Android/Mono.Android.csproj @@ -263,6 +263,8 @@ + + diff --git a/src/Mono.Android/metadata b/src/Mono.Android/metadata index 52b66d979..371f9d6d2 100644 --- a/src/Mono.Android/metadata +++ b/src/Mono.Android/metadata @@ -1157,6 +1157,9 @@ --> + + + + + + + +