Skip to content

3964 Fix display condition matching string literals instead of variables#4014

Open
ivicac wants to merge 2 commits intomasterfrom
3964
Open

3964 Fix display condition matching string literals instead of variables#4014
ivicac wants to merge 2 commits intomasterfrom
3964

Conversation

@ivicac
Copy link
Contributor

@ivicac ivicac commented Jan 31, 2026

The hasExpressionVariable method was incorrectly matching parameter names
inside quoted string literals, causing parameters to be removed when the
option value equaled the parameter name (e.g., type == 'type').

The fix strips single and double quoted string literals from the display
condition before checking for variable references.

Co-Authored-By: Claude Opus 4.5 noreply@anthropic.com

The hasExpressionVariable method was incorrectly matching parameter names
inside quoted string literals, causing parameters to be removed when the
option value equaled the parameter name (e.g., type == 'type').

The fix strips single and double quoted string literals from the display
condition before checking for variable references.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a bug in the hasExpressionVariable method where parameter names inside quoted string literals were incorrectly matched as variable references. This caused parameters to be removed when the option value equaled the parameter name (e.g., type == 'type').

Changes:

  • Modified hasExpressionVariable to strip quoted string literals before checking for variable references
  • Added comprehensive test cases to verify the fix handles various scenarios with string literals

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
WorkflowNodeParameterFacadeImpl.java Added regex pattern to remove single and double quoted string literals before matching parameter names
WorkflowNodeParameterFacadeTest.java Added test method testHasExpressionVariableIgnoresStringLiterals with 8 test cases covering string literals in display conditions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Address PR review feedback by updating the regex pattern to correctly
handle escaped quotes in string literals like 'it\'s' or "He said \"hello\"".

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sonarqubecloud
Copy link

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.

[bug]: parameter in display condition isn't setting when option value equals parameter name

1 participant