Skip to content

Tedefo 4806 tighter type checking#114

Merged
bertrand-lorentz merged 4 commits intodevelopfrom
TEDEFO-4806-tighter-type-checking
Feb 3, 2026
Merged

Tedefo 4806 tighter type checking#114
bertrand-lorentz merged 4 commits intodevelopfrom
TEDEFO-4806-tighter-type-checking

Conversation

@rousso
Copy link
Contributor

@rousso rousso commented Feb 2, 2026

This PR updates the eforms-notice-viewer to work with the tighter type checking changes introduced in efx-toolkit-java.

Changes:

  1. Interface Adaptation (TEDEFO-4807)

    • Updates code to work with the new TypedExpression interface
    • Adapts to scalar/sequence type separation in EFX expressions
  2. Dependency Updates

    • Updates eforms-core dependency to latest version
    • Adds missing test resource files
  3. Refactoring Alignment

    • Renames ValidatorMarkupGenerator to ValidatorGenerator
    • Maintains consistency with efx-toolkit-java interface changes

Impact:
Compatibility update to ensure the notice viewer works with the enhanced type checking infrastructure. No functional changes to the viewer's behavior.

@bertrand-lorentz
Copy link
Contributor

The unit tests currently fail when run locally, with the error pasted below.
It might be because it is using view templates from the SDK itself, and those have not been updated to work with the stricter type checking.

[ERROR] Tests run: 10, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 125.0 s <<< FAILURE! -- in eu.europa.ted.eforms.viewer.NoticeViewerTest
[ERROR] eu.europa.ted.eforms.viewer.NoticeViewerTest.testEfxToHtmlFromString(String, String, String, String)[2] -- Time elapsed: 23.92 s <<< ERROR!
eu.europa.ted.efx.exceptions.TypeMismatchException: Type mismatch. Field 'BT-1375-Procedure' may return multiple values from context 'BT-137-LotsGroup', but is used as a scalar. Use a sequence expression or change the context.
at eu.europa.ted.efx.exceptions.TypeMismatchException.fieldMayRepeat(TypeMismatchException.java:74)
at eu.europa.ted.efx.sdk2.EfxExpressionTranslatorV2$ExpressionPreprocessor.exitScalarFromFieldReference(EfxExpressionTranslatorV2.java:2227)
at eu.europa.ted.efx.sdk2.EfxParser$ScalarFromFieldReferenceContext.exitRule(EfxParser.java:23569)
at org.antlr.v4.runtime.tree.ParseTreeWalker.exitRule(ParseTreeWalker.java:62)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:38)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at org.antlr.v4.runtime.tree.ParseTreeWalker.walk(ParseTreeWalker.java:36)
at eu.europa.ted.efx.sdk2.EfxTemplateTranslatorV2$TemplatePreprocessor.processTemplate(EfxTemplateTranslatorV2.java:1525)
at eu.europa.ted.efx.sdk2.EfxTemplateTranslatorV2.renderTemplate(EfxTemplateTranslatorV2.java:265)
at eu.europa.ted.efx.sdk2.EfxTemplateTranslatorV2.renderTemplate(EfxTemplateTranslatorV2.java:242)
at eu.europa.ted.efx.EfxTranslator.translateTemplate(EfxTranslator.java:88)
at eu.europa.ted.eforms.viewer.generator.XslGenerator.lambda$getTemplateTranslator$0(XslGenerator.java:208)
at eu.europa.ted.eforms.viewer.generator.XslGenerator.doGenerateString(XslGenerator.java:178)
at eu.europa.ted.eforms.viewer.generator.XslGenerator.doGenerateFile(XslGenerator.java:112)
at eu.europa.ted.eforms.viewer.generator.XslGenerator.generateFile(XslGenerator.java:64)
at eu.europa.ted.eforms.viewer.NoticeViewerTest.testGenerateHtmlFromString(NoticeViewerTest.java:151)
at eu.europa.ted.eforms.viewer.NoticeViewerTest.testEfxToHtmlFromString(NoticeViewerTest.java:93)

@rousso
Copy link
Contributor Author

rousso commented Feb 3, 2026

The unit tests currently fail when run locally, with the error pasted below. It might be because it is using view templates from the SDK itself, and those have not been updated to work with the stricter type checking.

[ERROR] Tests run: 10, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 125.0 s <<< FAILURE! -- in eu.europa.ted.eforms.viewer.NoticeViewerTest [ERROR] eu.europa.ted.eforms.viewer.NoticeViewerTest.testEfxToHtmlFromString(String, String, String, String)[2] -- Time elapsed: 23.92 s <<< ERROR! eu.europa.ted.efx.exceptions.TypeMismatchException: Type mismatch. Field 'BT-1375-Procedure' may return multiple values from context 'BT-137-LotsGroup', but is used as a scalar. Use a sequence expression or change the context. at eu.europa.ted.efx.exceptions.TypeMismatchException.fieldMayRepeat(TypeMismatchException.java:74) at

Ok @bertrand-lorentz , I temporarily disabled execution of these tests when building in GitHub or Bamboo. They will still run on dev envs. We weill re-enable them when we have a proper SDK-2 release in place.

Copy link
Contributor

@bertrand-lorentz bertrand-lorentz left a comment

Choose a reason for hiding this comment

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

Problematic unit tests are now indeed skipped in GitHub actions.

@rousso rousso dismissed bertrand-lorentz’s stale review February 3, 2026 15:51

The merge-base changed after approval.

@rousso rousso dismissed bertrand-lorentz’s stale review February 3, 2026 15:59

The merge-base changed after approval.

@bertrand-lorentz bertrand-lorentz merged commit a856c6c into develop Feb 3, 2026
1 of 2 checks passed
@bertrand-lorentz bertrand-lorentz deleted the TEDEFO-4806-tighter-type-checking branch February 3, 2026 16:19
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