Skip to content

Conversation

@jonpryor
Copy link
Contributor

Fixes: #792

Commit cba6137 added [assembly: InternalsVisibleTo], allowing the
internal types from Java.Interop.dll to be seen from/used by
Java.Runtime.Environment.dll, so that MonoRuntimeValueManager
could use the type JniLocationException.

The downside to this change is that types internal to
Java.Interop.dll were visible to Java.Runtime.Environment.dll.
Types such as Java.Interop.NativeMethods, which "conflicts" with
Java.Interop.NativeMethods type in Java.Runtime.Environment.dll.

The result: 31 CS0436 warnings were introduced with commit cba6137:

Java.Interop/MonoRuntimeObjectReferenceManager.cs(16,14):
warning CS0436: The type 'NativeMethods' in '…/src/Java.Runtime.Environment/Java.Interop/JreRuntime.cs'
conflicts with the imported type 'NativeMethods' in 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.
Using the type defined in '…/src/Java.Runtime.Environment/Java.Interop/JreRuntime.cs'.

Fix these warnings by removing the [assembly: InternalsVisibleTo]
added in cba6137, and copy JniLocationException into
Java.Runtime.Environment.dll, renamed as OverrideStackTrace.

Fixes: dotnet#792

Commit cba6137 added `[assembly: InternalsVisibleTo]`, allowing the
internal types from `Java.Interop.dll` to be seen from/used by
`Java.Runtime.Environment.dll`, so that `MonoRuntimeValueManager`
could use the type `JniLocationException`.

The downside to this change is that types internal to
`Java.Interop.dll` were visible to `Java.Runtime.Environment.dll`.
Types such as `Java.Interop.NativeMethods`, which "conflicts" with
`Java.Interop.NativeMethods` type in `Java.Runtime.Environment.dll`.

The result: 31 CS0436 warnings were introduced with commit cba6137:

	Java.Interop/MonoRuntimeObjectReferenceManager.cs(16,14):
	warning CS0436: The type 'NativeMethods' in '…/src/Java.Runtime.Environment/Java.Interop/JreRuntime.cs'
	conflicts with the imported type 'NativeMethods' in 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'.
	Using the type defined in '…/src/Java.Runtime.Environment/Java.Interop/JreRuntime.cs'.

Fix these warnings by *removing* the `[assembly: InternalsVisibleTo]`
added in cba6137, and copy `JniLocationException` into
`Java.Runtime.Environment.dll`, renamed as `OverrideStackTrace`.
@jonpryor jonpryor merged commit ba6b013 into dotnet:main Feb 11, 2021
@jpobst jpobst added this to the 11.3 (16.10 / 8.10) milestone Mar 1, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 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.

Type conflict warnings.

2 participants