You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Andriy Redko (Jira)" <ji...@apache.org> on 2021/01/20 00:51:00 UTC

[jira] [Commented] (CXF-8411) Improve FastInfoset interceptors' compatibility with GraalVM native compilation

    [ https://issues.apache.org/jira/browse/CXF-8411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17268300#comment-17268300 ] 

Andriy Redko commented on CXF-8411:
-----------------------------------

Hey [~bnazare], thanks a lot for the suggestion, I think the change is trivial, the PR will be much appreciated, thank you.

> Improve FastInfoset interceptors' compatibility with GraalVM native compilation
> -------------------------------------------------------------------------------
>
>                 Key: CXF-8411
>                 URL: https://issues.apache.org/jira/browse/CXF-8411
>             Project: CXF
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 3.4.2
>            Reporter: Bruno Gonçalves
>            Priority: Major
>
> The FastInfoset jar is an optional dependency of CXF which means most applications will not have it on their classpath. When that is the case,  the GraalVM native compilation of {{FIStaxInInterceptor}} and {{FIStaxOutInterceptor}} will fail. That in itself is not a big deal as it would be trivial to apply some substitutions however, the fact that the two interceptors use classes from FastInfoset in the return values of some of their methods makes them impossible to substitute.
> The two offending methods are:
> {{FIStaxInInterceptor}} -> {{private StAXDocumentParser getParser(InputStream in)}}
> {{FIStaxOutInterceptor}} -> {{private StAXDocumentSerializer getOutput(OutputStream out)}}
> I suggest replacing the FastInfoset classes in the return values with the appropriate StAX interfaces: {{XMLStreamReader}} and {{XMLStreamWriter}} respectively. There's also a variable in {{FIStaxOutInterceptor}} whose type could be changed in the same way. These few changes would make the two interceptors trivial to substitute when FastInfoset is not present at native compilation time.
> If there's interest in this change, I can offer a PR pretty quickly.
> An alternative to these changes could be to turn the FastInfoset support into an extension which could then be disabled during native compilation. However, the implications of that kind of change are not something I can properly appreciate with my limited knowledge of the CXF codebase.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)