Skip to content

[java] Hide internal AST api#1856

Merged
adangel merged 13 commits into
pmd:java-grammarfrom
oowekyala:grammar-hide-internal-ast-api
Jun 17, 2019
Merged

[java] Hide internal AST api#1856
adangel merged 13 commits into
pmd:java-grammarfrom
oowekyala:grammar-hide-internal-ast-api

Conversation

@oowekyala

@oowekyala oowekyala commented Jun 2, 2019

Copy link
Copy Markdown
Member

As you said @adangel I think it's useful to do that early on, because that allows us to work on a package that's not vastly deprecated.

  • Alls the setters are pulled down from interfaces and made package-private
  • Access from other packages is still possible in some cases from a utility class that is explicitly documented as internal api (InternalApiBridge).
  • That is a good way to make the abstract classes package-private too, since the downcasts are handled by that bridge class only. So I replaced usages of the base classes with usages of the interfaces everywhere.

The remaining public setters on nodes are those from Node and AbstractNode, which we should probably deprecate on master and make protected later on.

@oowekyala oowekyala added the in:ast About the AST structure or API, the parsing step label Jun 2, 2019
@oowekyala oowekyala added this to the 7.0.0 milestone Jun 2, 2019

@adangel adangel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea with InternalApiBridge - that keeps these methods separated and we ca revisit them later (e.g. ideally rule implementations wouldn't need this - if they call a method from the bridge, they obviously do too much, like the comment rules...).

return isModifier(PROTECTED);
}

void setProtected(boolean isProtected) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange, this is already deprecated/internal on master, but not here.... We'll probably get conflicts here

@adangel adangel merged commit 9da2a97 into pmd:java-grammar Jun 17, 2019
@oowekyala oowekyala deleted the grammar-hide-internal-ast-api branch June 17, 2019 18:19
@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.

2 participants