Skip to content

[java] Extract CatchParameter from FormalParameter#2202

Merged
oowekyala merged 9 commits into
pmd:java-grammarfrom
oowekyala:grammar-catch-formal
Jan 16, 2020
Merged

[java] Extract CatchParameter from FormalParameter#2202
oowekyala merged 9 commits into
pmd:java-grammarfrom
oowekyala:grammar-catch-formal

Conversation

@oowekyala

@oowekyala oowekyala commented Jan 7, 2020

Copy link
Copy Markdown
Member

Point two of #998

  • Extract CatchParameter from FormalParameter
  • Introduce UnionType to represent multicatch types, eg IOException | AssertionError. This is just a trick (the Java type system doesn't feature union types), but it makes it so that each VariableDeclaratorId has either exactly one type node, or zero if the type is inferred.
  • Cleanup the API of ASTCatchClause:
    • Remove getCaughtExceptionTypes, getExceptionName, getCaughtExceptionTypeNodes, isMulticatchStatement
    • All those are now accessible on the CatchParameter and we don't need to duplicate them

TODO on master

  • Deprecate ASTCatchStatement#getBlock in favour of getBody

@oowekyala oowekyala added the in:ast About the AST structure or API, the parsing step label Jan 7, 2020
@oowekyala oowekyala added this to the 7.0.0 milestone Jan 7, 2020
@ghost

ghost commented Jan 7, 2020

Copy link
Copy Markdown
1 Message
📖 No java rules are changed!

Generated by 🚫 Danger

oowekyala added a commit that referenced this pull request Jan 16, 2020
@oowekyala oowekyala merged commit eed4df9 into pmd:java-grammar Jan 16, 2020
@oowekyala oowekyala deleted the grammar-catch-formal branch January 16, 2020 22:30
@adangel adangel mentioned this pull request Jan 23, 2023
55 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in:ast About the AST structure or API, the parsing step

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant