Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Niels-Erik
Copy link
Contributor

A bug exists in using a type from another file in an extender.
I created two tests that tests for this when using embed with as, and using embed without as.
The bug only seems to happen when embedding without as.

What happens is: that the Type Link is build, but the link is not added. This also gives a null exception when trying to throw new UnsupportedOperationException, so some Null checking has been put in.

I have also found the source that has the problem and applied a quickfix.

This bug has been introduced in Jolie 1.13, and did not exist in Jolie 1.12.

one with embed as,
and one with just embed (this one fails)
getOrBuildExtendedType now calls resolveTypeLinks after each time it calls buildType
@mwallnoefer mwallnoefer requested a review from kicito June 5, 2025 16:51
@fmontesi
Copy link
Member

Thank you all for the discussion, this looks pretty good! :)

@fmontesi fmontesi merged commit 5c6cf4f into jolie:master Jun 11, 2025
6 of 9 checks passed
@Niels-Erik Niels-Erik deleted the fix-extend-typelink-linked-type-is-null branch July 6, 2025 09:52
Niels-Erik added a commit to Niels-Erik/jolie that referenced this pull request Sep 2, 2025
* added tests for extending with a type from another file:
one with embed as,
and one with just embed (this one fails)

* added some null handling in Type when calling extend, properly to be reworked

* quickfix for TypeLink extend bug
getOrBuildExtendedType now calls resolveTypeLinks after each time it calls buildType

* changed palcement of call to resolveTypeLinks to right before calling extend, so that it catches more.

* Used String.format instead of string concatenation

* applied refactoring as per github review

* added assertions
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.

4 participants