Skip to content

Conversation

dkimitsa
Copy link
Contributor

adds support for blocks in structures. this fixes following exception when compiling CMBufferHandlers:

java.lang.IllegalArgumentException: No @marshaler found for return type of @StructMember method <org.robovm.apple.coremedia.CMBufferHandlers: org.robovm.objc.block.Block1 getGetDecodeTimeStamp()>
at org.robovm.compiler.MarshalerLookup.findMarshalerMethod(MarshalerLookup.java:169)

In details there are several moments and fixes:

  • Marshallers for @Block affected methods are generated by ObjCBlockPlugin in ObjCBlockPlugin.Before class run. The problem here is that ClassCompiler invokes it after StructMemberMethodCompiler.reset where this marshaller is required (and where exception is happening). The fix is to move reset section of method compilers below invocation of plugins Before. This makes marshallers generated at moment StructMemberMethodCompiler.reset needs it.
  • Second moment is that ObjCBlockPlugin.Before was not considering @StructMember annotated methods as subject for method transformation and the fix is trivial -- extending condition to include the case.

…on when compiling CMBufferHandlers:

>java.lang.IllegalArgumentException: No @marshaler found for return type of @StructMember method <org.robovm.apple.coremedia.CMBufferHandlers: org.robovm.objc.block.Block1 getGetDecodeTimeStamp()>
>	at org.robovm.compiler.MarshalerLookup.findMarshalerMethod(MarshalerLookup.java:169)
@Tom-Ski Tom-Ski merged commit b10e669 into MobiVM:jdk12 Nov 7, 2019
@dkimitsa dkimitsa deleted the cocoa13_postfix3_blocks_in_structs branch November 8, 2019 10:45
dkimitsa added a commit to dkimitsa/robovm that referenced this pull request Apr 9, 2020
…on when compiling CMBufferHandlers: (MobiVM#421)

>java.lang.IllegalArgumentException: No @marshaler found for return type of @StructMember method <org.robovm.apple.coremedia.CMBufferHandlers: org.robovm.objc.block.Block1 getGetDecodeTimeStamp()>
>	at org.robovm.compiler.MarshalerLookup.findMarshalerMethod(MarshalerLookup.java:169)
dkimitsa added a commit to dkimitsa/robovm that referenced this pull request Apr 9, 2020
…on when compiling CMBufferHandlers: (MobiVM#421)

>java.lang.IllegalArgumentException: No @marshaler found for return type of @StructMember method <org.robovm.apple.coremedia.CMBufferHandlers: org.robovm.objc.block.Block1 getGetDecodeTimeStamp()>
>	at org.robovm.compiler.MarshalerLookup.findMarshalerMethod(MarshalerLookup.java:169)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants