Skip to content

[core] Fix BaseAntlrTerminalNode getTokenKind to return type instead of index#6472

Merged
adangel merged 4 commits intopmd:mainfrom
stokpop:fix-antlr-teminal-node-type
Feb 27, 2026
Merged

[core] Fix BaseAntlrTerminalNode getTokenKind to return type instead of index#6472
adangel merged 4 commits intopmd:mainfrom
stokpop:fix-antlr-teminal-node-type

Conversation

@stokpop
Copy link
Contributor

@stokpop stokpop commented Feb 26, 2026

Describe the PR

This fixes return value of net.sourceforge.pmd.lang.ast.impl.antlr4.BaseAntlrTerminalNode#getTokenKind and adds two unit tests to validate the behaviour.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@stokpop stokpop changed the title [pmd-core] Fix BaseAntlrTerminalNode getTokenKind to return type instead of index [core] Fix BaseAntlrTerminalNode getTokenKind to return type instead of index Feb 26, 2026
@pmd-actions-helper
Copy link
Contributor

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.

Regression Tester Report

(comment created at 2026-02-26 14:31:07+00:00 for 475ef14)

Copy link
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

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

Thanks!

@adangel adangel added this to the 7.22.0 milestone Feb 27, 2026
@adangel adangel merged commit 475ef14 into pmd:main Feb 27, 2026
13 checks passed
adangel added a commit that referenced this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[core] BaseAntlrTerminalNode should return type instead of index for getTokenKind()

2 participants