Skip to content

fix: default null TokenScannerSymbols to DefaultTokenScannerSymbols#1328

Merged
jasmith-hs merged 1 commit into
master-2.8.xfrom
jasmith_hubspot/tagnode-default-scanner-symbols-2.8.x
Jul 24, 2026
Merged

fix: default null TokenScannerSymbols to DefaultTokenScannerSymbols#1328
jasmith-hs merged 1 commit into
master-2.8.xfrom
jasmith_hubspot/tagnode-default-scanner-symbols-2.8.x

Conversation

@jasmith-hs

Copy link
Copy Markdown
Contributor

Description

Backport to master-2.8.x.

Token (and therefore TagNode via master.getSymbols()) treats its TokenScannerSymbols as required. When a Token is constructed with a null TokenScannerSymbols, getSymbols() returns null, which leads to NullPointerExceptions in Token.parse() and TagNode.reconstructEnd().

This restores backwards compatibility for callers (e.g. downstream code that builds tokens/TagNodes directly and previously relied on default symbols) by defaulting a null TokenScannerSymbols to DefaultTokenScannerSymbols in the Token base constructor. This is the single point that feeds every getSymbols() call and parse(), so all Node/Token symbol access becomes null-safe.

Testing

  • Added TagTokenTest.itDefaultsNullSymbolsToDefaultTokenScannerSymbols, verifying a TagToken built with null symbols resolves to DefaultTokenScannerSymbols and parses correctly.
  • mvn -Dtest=TagTokenTest test passes (5/5).

This PR description was authored by Claude Code.

Tokens constructed with a null TokenScannerSymbols caused getSymbols() to
return null, leading to NPEs in Token.parse() and TagNode.reconstructEnd().
Default a null value to DefaultTokenScannerSymbols in the Token base
constructor so callers passing null remain backwards compatible.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jasmith-hs jasmith-hs self-assigned this Jul 23, 2026
@jasmith-hs
jasmith-hs marked this pull request as ready for review July 23, 2026 21:17
@jasmith-hs
jasmith-hs merged commit 97238d5 into master-2.8.x Jul 24, 2026
7 checks passed
@jasmith-hs
jasmith-hs deleted the jasmith_hubspot/tagnode-default-scanner-symbols-2.8.x branch July 24, 2026 14:36
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.

2 participants