Skip to content

fix: allow reserved keywords in package names (backport #486)#491

Merged
lukaszlenart merged 1 commit intoognl-3-4-xfrom
claude/analyze-ognl-issue-103-011CV2GS3ed59CKQqjc5QxsB
Nov 29, 2025
Merged

fix: allow reserved keywords in package names (backport #486)#491
lukaszlenart merged 1 commit intoognl-3-4-xfrom
claude/analyze-ognl-issue-103-011CV2GS3ed59CKQqjc5QxsB

Conversation

@lukaszlenart
Copy link
Copy Markdown
Collaborator

@lukaszlenart lukaszlenart commented Nov 11, 2025

Port the fix from PR #486 to resolve issue #103 where OGNL parser fails to parse class references containing reserved keywords in package names (e.g., @jp.or.example.Utils@method()).

Changes:

  • Modified ognl.jj grammar to add classNamePart() production that accepts both identifiers and reserved keywords (or, and, not, in, etc.)
  • Updated instanceof and className() productions to use classNamePart()
  • Added PackageKeywordTest.java with comprehensive test coverage

This allows package names commonly used in Japanese domains (.jp.or.) and other scenarios where reserved keywords appear in package names.

Fixes #103

@lukaszlenart lukaszlenart added this to the 3.4.9 milestone Nov 11, 2025
…3-4-x)

Port the fix from PR #486 to resolve issue #103 where OGNL parser
fails to parse class references containing reserved keywords in
package names (e.g., @jp.or.example.Utils@method()).

Changes:
- Modified ognl.jj grammar to add classNamePart() production that
  accepts both identifiers and reserved keywords (or, and, not, in, etc.)
- Updated instanceof and className() productions to use classNamePart()
- Added PackageKeywordTest.java with comprehensive test coverage

This allows package names commonly used in Japanese domains (.jp.or.)
and other scenarios where reserved keywords appear in package names.

Fixes #103
@lukaszlenart lukaszlenart force-pushed the claude/analyze-ognl-issue-103-011CV2GS3ed59CKQqjc5QxsB branch from 7589f87 to 42a0712 Compare November 11, 2025 14:52
@sonarqubecloud
Copy link
Copy Markdown

@lukaszlenart
Copy link
Copy Markdown
Collaborator Author

@harawata wdyt?

@lukaszlenart lukaszlenart marked this pull request as ready for review November 11, 2025 15:04
@harawata
Copy link
Copy Markdown
Contributor

Thank you for taking a look at the issue, @lukaszlenart ,

The added tests look thorough. 👍
I have never used JavaCC, so I may not be qualified to review this, but I'll let you know if I noticed something.

Cc: @kazuki43zoo

@lukaszlenart lukaszlenart merged commit b0a10c3 into ognl-3-4-x Nov 29, 2025
4 of 5 checks passed
@lukaszlenart lukaszlenart deleted the claude/analyze-ognl-issue-103-011CV2GS3ed59CKQqjc5QxsB branch November 29, 2025 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants