Skip to content

[Java.Interop.Tools.JavaCallableWrappers] make TypeNameMapGenerator d… #91

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

Merged
merged 1 commit into from
Sep 28, 2016

Conversation

radekdoulik
Copy link
Member

…isposable

  • we need that, because the resolver is referenced inside cecil
    objects and so if we dispose the resolver in the constructor, the
    disposed resolver is later used thru Write methods and it fails
    because its cache is already disposed

@dnfclas
Copy link

dnfclas commented Sep 27, 2016

Hi @radekdoulik, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, DNFBOT;

@dnfclas
Copy link

dnfclas commented Sep 27, 2016

@radekdoulik, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, DNFBOT;

@jonpryor
Copy link
Member

@radekdoulik: Do you have the stack trace that you're trying to fix here?

…isposable

 - we need that, because the resolver is referenced inside cecil
   objects and so if we dispose the resolver in the constructor [0],
   the disposed resolver is later used thru Write methods [1] and it
   fails because its cache is already disposed

   [0] the location of the disposal
      at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Dispose (System.Boolean disposing) [0x00000] in <3f2ebd7ea1fd47bd954f448c66f03323>:0
      at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Dispose () [0x00000] in <3f2ebd7ea1fd47bd954f448c66f03323>:0
      at Java.Interop.Tools.JavaCallableWrappers.TypeNameMapGenerator..ctor (System.Collections.Generic.IEnumerable`1[T] assemblies, System.Action`2[T1,T2] logMessage) [0x00000] in <3076bd81225243d6b1a7e6e2e66cb5f7>:0
      at Xamarin.Android.Tasks.GenerateJavaStubs.WriteTypeMappings (System.Collections.Generic.List`1[T] types) [0x00000] in <d1b286cda0c74ed8bdaf1b21993bd410>:0
      at Xamarin.Android.Tasks.GenerateJavaStubs.Run (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x00000] in <d1b286cda0c74ed8bdaf1b21993bd410>:0
      at Xamarin.Android.Tasks.GenerateJavaStubs.Execute () [0x00000] in <d1b286cda0c74ed8bdaf1b21993bd410>:0
      ...

   [1] exception when using the disposed resolver (because cache is cleared and thus null)
	Error executing task GenerateJavaStubs: System.NullReferenceException: Object reference not set to an instance of an object
	  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference, Mono.Cecil.ReaderParameters parameters) [0x00028] in <3f2ebd7ea1fd47bd954f448c66f03323>:0
	  at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference reference) [0x00001] in <3f2ebd7ea1fd47bd954f448c66f03323>:0
	  at Mono.Cecil.MetadataResolver.Resolve (Mono.Cecil.TypeReference type) [0x0004e] in <4f9b8c8361824d0ca9025449919e12be>:0
	  at Mono.Cecil.ModuleDefinition.Resolve (Mono.Cecil.TypeReference type) [0x00007] in <4f9b8c8361824d0ca9025449919e12be>:0
	  at Mono.Cecil.TypeReference.Resolve () [0x00014] in <4f9b8c8361824d0ca9025449919e12be>:0
	  at Java.Interop.Tools.Cecil.TypeDefinitionRocks.GetBaseType (Mono.Cecil.TypeDefinition type) [0x00014] in <3f2ebd7ea1fd47bd954f448c66f03323>:0
	  at Java.Interop.Tools.Cecil.TypeDefinitionRocks+<GetTypeAndBaseTypes>c__Iterator0.MoveNext () [0x00048] in <3f2ebd7ea1fd47bd954f448c66f03323>:0
	  at System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) [0x00048] in <51a1d86c1edf494cacaba8bbf8d1334e>:0
	  at Java.Interop.Tools.Cecil.TypeDefinitionRocks.ImplementsInterface (Mono.Cecil.TypeDefinition type, System.String interfaceName) [0x00014] in <3f2ebd7ea1fd47bd954f448c66f03323>:0
	  at Java.Interop.Tools.TypeNameMappings.JniType.ToJniName (Mono.Cecil.TypeDefinition type, Java.Interop.ExportParameterKind exportKind) [0x00049] in <3076bd81225243d6b1a7e6e2e66cb5f7>:0
	  at Java.Interop.Tools.TypeNameMappings.JniType.ToJniName (Mono.Cecil.TypeDefinition type) [0x00001] in <3076bd81225243d6b1a7e6e2e66cb5f7>:0
	  at Java.Interop.Tools.JavaCallableWrappers.TypeNameMapGenerator.GetTypeMapping (System.Func`2[T,TResult] skipType, System.Func`2[T,TResult] key, System.Func`2[T,TResult] value) [0x00047] in <3076bd81225243d6b1a7e6e2e66cb5f7>:0
	  at Java.Interop.Tools.JavaCallableWrappers.TypeNameMapGenerator.WriteJavaToManaged (System.IO.Stream output) [0x00012] in <3076bd81225243d6b1a7e6e2e66cb5f7>:0
	  at Xamarin.Android.Tasks.GenerateJavaStubs.UpdateWhenChanged (System.String path, System.Action`1[T] generator) [0x00014] in <d1b286cda0c74ed8bdaf1b21993bd410>:0
	  at Xamarin.Android.Tasks.GenerateJavaStubs.WriteTypeMappings (System.Collections.Generic.List`1[T] types) [0x00078] in <d1b286cda0c74ed8bdaf1b21993bd410>:0
	  at Xamarin.Android.Tasks.GenerateJavaStubs.Run (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x00153] in <d1b286cda0c74ed8bdaf1b21993bd410>:0
	  at Xamarin.Android.Tasks.GenerateJavaStubs.Execute () [0x001f2] in <d1b286cda0c74ed8bdaf1b21993bd410>:0
          ...
@radekdoulik radekdoulik force-pushed the TypeNameMapGenerator-disposable branch from 815eb51 to 24c6820 Compare September 28, 2016 17:05
@radekdoulik
Copy link
Member Author

yup. I have updated the commit message. see radekdoulik@24c6820

@jonpryor jonpryor merged commit 40b75e9 into dotnet:master Sep 28, 2016
jonpryor pushed a commit that referenced this pull request Sep 25, 2020
Changes: dotnet/android-tools@3974fc3...f2af06f

  * dotnet/android-tools@f2af06f: [Xamarin.Android.Tools.AndroidSdk] Fix a few nullability warnings (#97)
  * dotnet/android-tools@5718cd2: Fix sort ordering for ndk-bundle, add macOS support (#91)
  * dotnet/android-tools@8e63795: [Xamarin.Android.Tools.AndroidSdk] Add API-29, API-30 to KnownVersions (#89)
  * dotnet/android-tools@a6a23bb: [Xamarin.Android.Tools.AndroidSdk] Default SDK component versions (#93)
  * dotnet/android-tools@32a1e2c: [build] fail macOS build if tests fail (#94)
  * dotnet/android-tools@79a0141: Return a default for unknown API levels (#90)
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 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.

3 participants