[foreign] RFR: 8224244: Cleanup libclang Java API

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue May 21 08:25:31 UTC 2019


Looks very good - couple of comments:

* I think it would be handy to collect all the translation unit options 
into an enum - I'm referring to these:

   46     private final static int CXTranslationUnit_DetailedPreprocessingRecord = 0x01;


That would have been really helpful when writing the reparsing code, 
when often I had to browse the clang headers to look for these.

* it seem to me that if the parser catches the index exception and then 
wraps  it as a runtime exception (IllegalStateException) then you can 
revert most of the changes to the other classes? Also, another thing to 
consider: maybe we wanna make the parsing exception an unchecked 
exception? After all, there's not much recovery that can be done on 
those, forcing all clients to catch it seems excessive?

Maurizio

On 20/05/2019 21:53, Henry Jen wrote:
> Hi,
>
> Please review the webrev[1] for clang Java API cleanup that came up with earlier work on atomic type support.
> Mainly to throw a checked exception on parsing error, and move translation unit APIs into TranslationUnit class.
>
> Cheers,
> Henry
>
> [1] http://cr.openjdk.java.net/~henryjen/panama/8224244/0/webrev/
> [2] https://bugs.openjdk.java.net/browse/JDK-8224244


More information about the panama-dev mailing list