File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
sbe-tool/src/main/java/uk/co/real_logic/sbe/xml Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,11 @@ public PrimitiveType encodingType()
168168 */
169169 public int encodedLength ()
170170 {
171+ if (presence () == Presence .CONSTANT )
172+ {
173+ return 0 ;
174+ }
175+
171176 return encodingType .size ();
172177 }
173178
Original file line number Diff line number Diff line change @@ -425,7 +425,14 @@ else if (field.type() != null)
425425 return blockLength ;
426426 }
427427
428- blockLength = field .computedOffset () + fieldLength ;
428+ if (field .presence () == Presence .CONSTANT )
429+ {
430+ blockLength = field .computedOffset ();
431+ }
432+ else
433+ {
434+ blockLength = field .computedOffset () + fieldLength ;
435+ }
429436 }
430437 }
431438
@@ -440,7 +447,7 @@ private static void validateBlockLength(
440447 handleError (
441448 node ,
442449 "specified blockLength provides insufficient space " +
443- computedBlockLength + " > " + specifiedBlockLength );
450+ computedBlockLength + " > " + specifiedBlockLength );
444451 }
445452 }
446453}
You can’t perform that action at this time.
0 commit comments