diff --git a/build-tools/gradle/gradle/wrapper/gradle-wrapper.properties b/build-tools/gradle/gradle/wrapper/gradle-wrapper.properties index fae08049a..d6e308a63 100644 --- a/build-tools/gradle/gradle/wrapper/gradle-wrapper.properties +++ b/build-tools/gradle/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/Java.Base/Java.Lang/StringBuffer.cs b/src/Java.Base/Java.Lang/StringBuffer.cs index 13a798613..8488622b4 100644 --- a/src/Java.Base/Java.Lang/StringBuffer.cs +++ b/src/Java.Base/Java.Lang/StringBuffer.cs @@ -4,5 +4,15 @@ namespace Java.Lang { partial class StringBuffer : IEnumerable, IEnumerable { + +#if JAVA_API_21 + IAppendable? IAppendable.Append (char c) => + Append (c); + IAppendable? IAppendable.Append (ICharSequence? s) => + Append (s); + IAppendable? IAppendable.Append (ICharSequence? s, int a, int b) => + Append (s, a, b); +#endif // JAVA_API_21 + } } diff --git a/src/Java.Base/Java.Lang/StringBuilder.cs b/src/Java.Base/Java.Lang/StringBuilder.cs index 0eecdaa24..f71efa4df 100644 --- a/src/Java.Base/Java.Lang/StringBuilder.cs +++ b/src/Java.Base/Java.Lang/StringBuilder.cs @@ -4,5 +4,15 @@ namespace Java.Lang { partial class StringBuilder : IEnumerable, IEnumerable { + +#if JAVA_API_21 + IAppendable? IAppendable.Append (char c) => + Append (c); + IAppendable? IAppendable.Append (ICharSequence? s) => + Append (s); + IAppendable? IAppendable.Append (ICharSequence? s, int a, int b) => + Append (s, a, b); +#endif // JAVA_API_21 + } } diff --git a/src/Java.Base/Java.Lang/Thread.cs b/src/Java.Base/Java.Lang/Thread.cs new file mode 100644 index 000000000..d13a6bb4e --- /dev/null +++ b/src/Java.Base/Java.Lang/Thread.cs @@ -0,0 +1,30 @@ +namespace Java.Lang { + partial class Thread { + +#if JAVA_API_21 + partial interface IBuilder { + partial class IOfPlatformInvoker { + IBuilder? IBuilder.InheritInheritableThreadLocals (bool value) => + InheritInheritableThreadLocals (value); + IBuilder? IBuilder.Name (string? name) => + Name (name); + IBuilder? IBuilder.Name (string? name, long v) => + Name (name, v); + IBuilder? IBuilder.UncaughtExceptionHandler (IUncaughtExceptionHandler? u) => + UncaughtExceptionHandler (u); + } + partial class IOfVirtualInvoker { + IBuilder? IBuilder.InheritInheritableThreadLocals (bool value) => + InheritInheritableThreadLocals (value); + IBuilder? IBuilder.Name (string? name) => + Name (name); + IBuilder? IBuilder.Name (string? name, long v) => + Name (name, v); + IBuilder? IBuilder.UncaughtExceptionHandler (IUncaughtExceptionHandler? u) => + UncaughtExceptionHandler (u); + } + } +#endif // JAVA_API_21 + + } +} diff --git a/src/Xamarin.Android.Tools.Bytecode/Methods.cs b/src/Xamarin.Android.Tools.Bytecode/Methods.cs index 6059b12eb..a0fdfba78 100644 --- a/src/Xamarin.Android.Tools.Bytecode/Methods.cs +++ b/src/Xamarin.Android.Tools.Bytecode/Methods.cs @@ -300,14 +300,16 @@ void UpdateParametersFromMethodParametersAttribute (ParameterInfo[] parameters) MethodParameterAccessFlags.Final | MethodParameterAccessFlags.Synthetic; var pinfo = methodParams.ParameterInfo; int startIndex = 0; - while (startIndex < pinfo.Count && - ((pinfo [startIndex].AccessFlags & OuterThis1) == OuterThis1 || - (pinfo [startIndex].AccessFlags & OuterThis2) == OuterThis2)) { + while (IsConstructor && + startIndex < pinfo.Count && + ((pinfo [startIndex].AccessFlags & OuterThis1) == OuterThis1 || + (pinfo [startIndex].AccessFlags & OuterThis2) == OuterThis2)) { startIndex++; } Debug.Assert ( parameters.Length == pinfo.Count - startIndex, - $"Unexpected number of method parameters in `{DeclaringType.FullJniName}.{Name}{Descriptor}`: expected {parameters.Length}, got {pinfo.Count - startIndex}"); + $"Unexpected number of method parameters in `{DeclaringType.FullJniName}.{Name}{Descriptor}`: expected {parameters.Length}, got {pinfo.Count - startIndex}! " + + $"pinfo.Count={pinfo.Count}, startIndex={startIndex}, pinfo={string.Join (", ", pinfo.Select (p => p.ToString ()))}"); int end = Math.Min (parameters.Length, pinfo.Count - startIndex); for (int i = 0; i < end; ++i) { var p = pinfo [i + startIndex];