Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to dotnet/android-tools/main@3debf8e0 #1236

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

Changes: dotnet/android-tools@137ad81...3debf8e

  * dotnet/android-tools@3debf8e: [BaseTasks] Import Xamarin.Build.AsyncTask (#237)
  * dotnet/android-tools@9674590: Update pipeline and pipeline info in README.md (#239)
  * dotnet/android-tools@1c09dcc: Update README.md and build scripts (#238)
  * dotnet/android-tools@2606225: Bump to dotnet/msbuild@33de0b22 (#232)
  * dotnet/android-tools@555d509: Bump LibZipSharp and Xamarin.Build.AsyncTask (#236)
  * dotnet/android-tools@da2c33e: Force loc task pool image to windows (#234)
@jonpryor
Copy link
Member Author

jonpryor commented Jul 5, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonpryor jonpryor merged commit 6f9defa into main Jul 5, 2024
4 checks passed
@jonpryor jonpryor deleted the dev/jonp/jonp-bump-dat-3debf8e0 branch July 5, 2024 18:15
jonpryor added a commit to dotnet/android that referenced this pull request Jul 8, 2024
Fixes: #9038

Changes: dotnet/java-interop@ccafbe6...7a058c0

  * dotnet/java-interop@7a058c0e: [Java.Interop] Add `IJavaPeerable.JavaAs()` extension method (dotnet/java-interop#1234)
  * dotnet/java-interop@6f9defa5: Bump to dotnet/android-tools@3debf8e0 (dotnet/java-interop#1236)
  * dotnet/java-interop@6923fb89: [ci] Add dependabot branches to build triggers (dotnet/java-interop#1233)
  * dotnet/java-interop@573028f3: [ci] Use macOS 13 Ventura build agents (dotnet/java-interop#1235)

dotnet/java-interop@7a058c0e adds a new `IJavaPeerable.JavaAs<T>()`
extension method, to perform type casts which return `null` when
the cast will not succeed instead of throwing an exception.

Update `AndroidValueManager.CreatePeer()` to check for Java-side
type compatibility (by way of `TypeManager.CreateInstance()`).
Previously, this would not throw:

	var instance        = …
	var r               = instance.PeerReference;
	var wrap_instance   = JniRuntime.CurrentRuntime.ValueManager.CreatePeer (
	        reference: ref r,
	        options: JniObjectReferenceOptions.Copy,
	        targetType: typeof (SomeInterfaceThatInstanceDoesNotImplement));
	// `wrap_instance` is not null, `.CreatePeer()` does not throw

	wrap_instance.SomeMethod();
	// will throw, due to a type mismatch.

`AndroidValueManager.CreatePeer()` will now return `null` if the
Java instance referenced by the `reference:` parameter is not
convertible to `targetType`, as per [`JNIEnv::IsAssignableFrom()`][0].

[0]: https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#IsAssignableFrom
@github-actions github-actions bot locked and limited conversation to collaborators Aug 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant