File tree Expand file tree Collapse file tree
main/java/eu/europa/ted/eforms/sdk
java/eu/europa/ted/efx/sdk1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -305,16 +305,6 @@ public String getTypeOfField(String fieldId) {
305305 throw SymbolResolutionException .unknownSymbol (fieldId );
306306 }
307307
308- // Temporary: the SDK does not yet distinguish duration from measure.
309- // Both are "measure" in the SDK, but durations use the "duration-unit" codelist.
310- // Remove this when the SDK adds "duration" as a proper data type.
311- if (FieldTypes .MEASURE .getName ().equals (sdkField .getType ())) {
312- SdkField unitCodeField = sdkField .getAttributeField ("unitCode" );
313- if (unitCodeField != null && "duration-unit" .equals (unitCodeField .getCodelistId ())) {
314- return FieldTypes .DURATION .getName ();
315- }
316- }
317-
318308 return sdkField .getType ();
319309 }
320310
Original file line number Diff line number Diff line change @@ -161,6 +161,13 @@ void testFieldValueComparison_TypeMismatch() {
161161 () -> translateExpressionWithContext ("ND-Root" , "00:01:00 > BT-00-StartDate" ));
162162 }
163163
164+ // TEDEFO-5013: In SDK 1.x "measure" is the duration type (SDK 2.x introduced "duration").
165+ // A measure field compared with a duration literal should translate successfully.
166+ @ Test
167+ void testDurationComparison_WithMeasureField_TEDEFO5013 () {
168+ translateExpressionWithContext ("ND-Root" , "BT-00-Measure > P7Y" );
169+ }
170+
164171
165172 @ Test
166173 void testBooleanComparison_UsingLiterals () {
Original file line number Diff line number Diff line change 121121 "xpathAbsolute" : " /*/PathNode/DurationField" ,
122122 "xpathRelative" : " PathNode/DurationField"
123123 },
124+ {
125+ "id" : " BT-00-Measure" ,
126+ "type" : " measure" ,
127+ "parentNodeId" : " ND-Root" ,
128+ "xpathAbsolute" : " /*/PathNode/MeasureField" ,
129+ "xpathRelative" : " PathNode/MeasureField"
130+ },
124131 {
125132 "id" : " BT-00-Integer" ,
126133 "type" : " integer" ,
You can’t perform that action at this time.
0 commit comments