GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [java] Remove Name nodes in Import- and PackageDeclaration by oowekyala · Pull Request #1888 · pmd/pmd

Conversation

@oowekyala

@oowekyala oowekyala commented Jun 26, 2019 •
edited by adangel
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Also, ImportDeclaration is not a TypeNode anymore, for the reasons described in the comment I'm deleting on the class
    • The two issues are dependent. Name is a TypeNode so making ImportDeclaration not a TypeNode strongly suggests the removal of the Name. It was clutter anyway to have a nested node just to carry a string.
  • Also, this removes getPackage on ImportDeclaration. For the same reasons ImportDeclaration shouldn't be a TypeNode, getPackage is hard to define (it was defined as the Package of the type of ImportDeclaration). Besides, it was not used even once in our codebase and I think it's utterly useless. If you have the Class then you have the Package. This should be deprecated on master
  • Fixing compilation required editing a few rules. They use the ClassTypeResolver of the CompilationUnit, which is only a temporary crutch. Those two rules (UnnecessaryQualifiedName and UnusedImport) will anyway probably be completely rewritten to make use of the new symbol table, instead of doing their thing in isolation.

See https://github.com/pmd/pmd/wiki/Java_clean_changes#import-and-package-declarations

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
oowekyala added 3 commits June 26, 2019 18:18
@oowekyala
Remove name node in import & package decl
303b962
Make ImportDeclaration not a TypeNode
@oowekyala
Fix compilation
8715a85
@oowekyala
Doc
d774aef
@oowekyala oowekyala added the in:ast About the AST structure or API, the parsing step label Jun 26, 2019
@oowekyala oowekyala added this to the 7.0.0 milestone Jun 26, 2019
oowekyala added 3 commits June 26, 2019 19:29
@oowekyala
Circumvent noAttribute, keep image of imports & package null
7db00d1
@oowekyala
Fix comment
f2dcfc8
@oowekyala
Merge branch 'java-grammar' into grammar-remove-names
6f8adcd
@jsotuyod jsotuyod mentioned this pull request Jul 23, 2019
[ui] New rule designer pending issues pmd/pmd-designer#12
Open
19 of 21 tasks
@adangel adangel self-assigned this Jul 28, 2019
adangel
adangel reviewed Jul 28, 2019
View reviewed changes
Comment thread pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

adangel added a commit that referenced this pull request Jul 28, 2019
@adangel
[java] Deprecate ASTImportDeclaration#getPackage(), refs #1888
2957594
@adangel
adangel merged commit 6f8adcd into pmd:java-grammar Jul 28, 2019
adangel added a commit that referenced this pull request Jul 30, 2019
@adangel
[java] Deprecate ASTImportDeclaration#getImportedNameNode() as well
091ce3d
Refs #1888
@oowekyala
oowekyala deleted the grammar-remove-names branch July 31, 2019 13:52
This was referenced Jan 16, 2023
[java] Breaking Java Grammar changes for PMD 7.0.0 #1019
Closed
PMD 7 Tracking Issue #3898
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adangel adangel adangel left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@adangel adangel

Labels

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

Projects

None yet

Milestone

7.0.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@oowekyala @adangel
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.