[forge-issues] [JBoss JIRA] (ROASTER-132) Broken interface promise for JavaParser

Kai Müller (Jira) issues at jboss.org
Tue Jan 22 04:10:00 EST 2019


    [ https://issues.jboss.org/browse/ROASTER-132?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13685728#comment-13685728 ] 

Kai Müller commented on ROASTER-132:
------------------------------------

Oh, I see. I'll create a PR with an enhancement of the javadoc.

> Broken interface promise for JavaParser
> ---------------------------------------
>
>                 Key: ROASTER-132
>                 URL: https://issues.jboss.org/browse/ROASTER-132
>             Project: Roaster
>          Issue Type: Bug
>          Components: API, JDT
>    Affects Versions: 2.20.8.Final
>            Reporter: Kai Müller
>            Priority: Major
>
> According to the interface JavaParser the methods "create" and "parseUnit" should retunr null of the type is not supported, but the JavaParserImpl throws instead ParserException.
> I can think about the following options:
> #  change the behaviour in JavaParserImpl
> # change the interface description, but then make multiple parsers no sense any more if the first is failing with an exception
> # basically 2. but catch the exception --> ugly code (my personal opinion)
> # Add a "canHandle" method, which returns true if this type of source can be handled
> If think, that 1. is the easiest and cleanest solution. We should then maybe enhance the error message thrown if no parser was able to handle the source code.
> What do you think?
> Best regards,
> Kai



--
This message was sent by Atlassian Jira
(v7.12.1#712002)



More information about the forge-issues mailing list