Skip to content

Conversation

@bhharsh13
Copy link
Contributor

Fixed the issue to display Semantic name with fallback - https://ikmdev.atlassian.net/browse/IIA-2518
Validated the changes on local and "java.util.NoSuchElementException: No value present" is fixed.

Before Change:
image-20250729-195741
image-20250729-165954

After Change:
No Exception thrown
Semantic Display name with fallback

PatternFacade patternFacade = semanticEntity.pattern().toProxy();
descr = viewProperties.calculator().languageCalculator().getDescriptionText(refComponent.nid()).get()+" ";
descr += viewProperties.calculator().languageCalculator().getDescriptionTextOrNid(patternFacade.nid());
descr = viewProperties.calculator().languageCalculator().getPreferredDescriptionTextWithFallbackOrNid(refComponent.nid())+" ";
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that the code was like this before, but request a slight change to get the languageCalculator.
Just call viewProperties.calculator().langaugeCalculator() one time, store in variable.
Use that variable to call the getPreferredDescriptionTextWithFallbackOrNid().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Assigned the viewProperties.calculator().langaugeCalculator() to a variable for reusability.

@bhharsh13 bhharsh13 requested a review from jdsmithsos August 1, 2025 19:48
Copy link
Contributor

@jdsmithsos jdsmithsos left a comment

Choose a reason for hiding this comment

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

looks good!

@bhharsh13 bhharsh13 merged commit 236088c into ikmdev:main Aug 1, 2025
2 checks passed
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