Skip to content

chore: #2058 Clean up ExpressionParser.validateSuffixFound - #2060

Merged
lbroudoux merged 1 commit into
microcks:masterfrom
Heyy-Himanshuu:chore/2058-expression-parser-cleanup
Apr 30, 2026
Merged

lbroudoux merged 1 commit into
microcks:masterfrom
Heyy-Himanshuu:chore/2058-expression-parser-cleanup

Conversation

@Heyy-Himanshuu

Copy link
Copy Markdown
Contributor

Address two Sonar maintainability findings on ExpressionParser:

  • Remove unused 'expressionPrefix' parameter from the private validateSuffixFound helper and update its single call site.
  • Extract template.substring(prefixIndex) into a local 'unparsed' variable so it is computed once and reused for both the log message and the ParseException message, avoiding the eager invocation that was being passed as a logger argument.

Behaviour is unchanged.

Description

  • commons/util-el — ExpressionParser.validateSuffixFound: removed the unused expressionPrefix parameter and updated the single private call site (rule: unused method parameter, L100).
  • commons/util-el — ExpressionParser.validateSuffixFound: extracted template.substring(prefixIndex) into a local unparsed variable, eliminating the duplicate substring call and the eager method invocation passed as a logger argument (rule: invoke method only conditionally, L104).
  • No public API surface changed; validateSuffixFound is private static with a single caller inside parseExpressions.
  • mvn spotless:check -pl commons/util-el passes locally; existing tests in commons/util-el exercise both branches of validateSuffixFound (missing-suffix path) so behaviour is covered by the current suite.

Related issue(s)

See also #2058

Address two Sonar maintainability findings on ExpressionParser:

- Remove unused 'expressionPrefix' parameter from the private
  validateSuffixFound helper and update its single call site.
- Extract template.substring(prefixIndex) into a local 'unparsed'
  variable so it is computed once and reused for both the log
  message and the ParseException message, avoiding the eager
  invocation that was being passed as a logger argument.

Behaviour is unchanged.

Signed-off-by: Git-HimanshuRathi <[email protected]>

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thank you!

@lbroudoux lbroudoux added kind/task java Pull requests that update Java code labels Apr 30, 2026
@lbroudoux lbroudoux added this to the 1.15.0 milestone Apr 30, 2026
@lbroudoux
lbroudoux merged commit 66d167c into microcks:master Apr 30, 2026
7 checks passed
@github-actions

Copy link
Copy Markdown

🎉 @Git-HimanshuRathi

You are now a Microcks community contributor! 💖

Thanks and congrats 🚀 on merging your first pull request! We are delighted and very proud of you! 👏

📢 If you're using Microcks in your organization, please add your company name to this list. 🙏 It really helps the project to gain momentum and credibility. It's a small contribution back to the project with a big impact.

If you need to know why and how to add yourself to the list, please read the blog post "Join the Microcks Adopters list and Empower the vibrant open source Community 🙌"

Kudos and please keep going, we need you 🙌

@Heyy-Himanshuu
Heyy-Himanshuu deleted the chore/2058-expression-parser-cleanup branch May 1, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update Java code kind/task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants