[foreign-jextract] RFR: Change error handling strategy in MacroParserImpl's constructor
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Wed Jul 29 14:48:30 UTC 2020
On Wed, 29 Jul 2020 13:40:06 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> Hi,
>
> This patch changes the error handling strategy in MacroParserImpl's constructor.
>
> When running the tests I ran into cryptic NPEs. It turned out that this was caused due to a failure to create the
> default ClangReparser, which led to an exception, which led to the treeMaker and macroTable fields being left
> uninitialized. This patch changes these fields to `final` to catch any future problems with not being initialized
> along all paths, as well as factoring out the constructor argument pre-processing into a static factory method, to more
> clearly show that argument pre-processing takes place when creating a MacroParserImpl instance. It also just propagates
> the exception thrown when creating the ClangReparser instead of trying to use a dummy reparser. Thanks, Jorn
Changes looks good, but probably we can ditch the whole Reparser interface thingie now?
Looks good
-------------
PR: https://git.openjdk.java.net/panama-foreign/pull/273Marked as reviewed by mcimadamore (Committer).
More information about the panama-dev
mailing list