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 — [kotlin] Suppress empty-list attribute values in tree dump tests by stokpop · Pull Request #7165 · pmd/pmd

Conversation

@stokpop

@stokpop stokpop commented Oct 8, 2026 •
edited by adangel
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Fixes one item from #7091 (follow-up tracking issue for #6893).

This just skips the empty collections in a kotlin-specific attribute printer for the tree dump tests.

Updated the 8 affected tree-dump golden fixtures (only @AnnotationFqNames = () removed, nothing else changed) and one unit test that explicitly asserted the old (noisy) behavior, inverting it to assert the attribute is now absent.

Related

  • [kotlin] Follow-ups from XPath functions/type attributes PR (#6893) #7091 — tracking issue, item: "Suppress empty-list attribute values (e.g. @AnnotationFqNames) in tree dumps"

Sorry, something went wrong.

Uh oh!

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

jborgers reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@stokpop
[kotlin] Suppress empty-list attribute values in tree dumps
6607bcc
@pmd-actions-helper

pmd-actions-helper Bot commented Oct 8, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Documentation Preview

No relevant source code has been changed, pmdtester skipped.

(comment created at 2026-10-27 10:46:36+00:00 for 6100f6c)

All reactions

Sorry, something went wrong.

Uh oh!

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

@stokpop stokpop mentioned this pull request Oct 8, 2026
[kotlin] Add @TypeName to VariableDeclaration, fix destructuring type leak #7168
Merged
@stokpop stokpop changed the title [kotlin] Suppress empty-list attribute values in tree dumps [kotlin] Suppress empty-list attribute values in tree dumps/designer Oct 9, 2026
@stokpop
stokpop marked this pull request as ready for review October 9, 2026 05:13
@adangel adangel mentioned this pull request Oct 27, 2026
[kotlin] Follow-ups from XPath functions/type attributes PR (#6893) #7091
Open
2 of 19 tasks
@adangel
Merge branch 'main' into pr-7165
bbfa57c
adangel
adangel reviewed Oct 27, 2026
View reviewed changes

@adangel adangel left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for the PR!

Actually, I wouldn't remove these attributes, if they are empty. The fact, that these attributes exist, but have no value, is still important. The initial reason, why this PR was created, was: clutter in tree dump. And this can be solved, by just not outputting these attributes in tree dumps. I still find it valueable, if all possible attributes are listed in the designer - this helps to explore and understand the AST. If the AST has already too many attributes that it is overwhelming, then we can enhance the designer: It already has a button to "Hide common attributes":

Image

We could add a second button to "Hide empty attributes" - but only, if empty attributes are really a problem.

I'll update the PR to just change the tree dump behavior in Kotlin and leave the attributes as is. Then we also don't need to reason about compatibility with existing XPath rules.

Note: That we skip null-valued attributes, is maybe something we should rethink: Ideally, we would only skip attributes, that we defined explicitly to be optional and not every attribute whose value happen to be null.

Skipping attributes also might result in bad design: If you know, that empty attributes will be skipped, then you could add the attribute to every node by default - since it will only show up, if it has a value. I'd rather be explicit which node supports which attributes.

Sorry, something went wrong.

Uh oh!

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

stokpop reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@adangel adangel added the in:pmd-internals Affects PMD's internals label Oct 27, 2026
@adangel
Suppress empty-list attributes only in tree dumps
6100f6c
The attributes still exist and are not removed.
@adangel adangel changed the title [kotlin] Suppress empty-list attribute values in tree dumps/designer [kotlin] Suppress empty-list attribute values in tree dumps Oct 27, 2026
@adangel adangel changed the title [kotlin] Suppress empty-list attribute values in tree dumps [kotlin] Suppress empty-list attribute values in tree dump tests Oct 27, 2026
@adangel adangel added this to the 7.29.0 milestone Oct 27, 2026
@adangel
adangel merged commit 979f40d into pmd:main Oct 27, 2026
12 checks passed

Uh oh!

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

@stokpop

stokpop commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for merging @adangel . I agree that it is better to have all attributes visible in the designer so you know what is available on what nodes/levels.

All reactions

Sorry, something went wrong.

Uh oh!

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

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

No one assigned

Labels

in:pmd-internals Affects PMD's internals

Projects

None yet

Milestone

7.29.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

@stokpop @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.