Skip to content

Commit 5a1082a

Browse files
committed
[Java] Regenerate Java IR codecs.
1 parent 43053d2 commit 5a1082a

File tree

8 files changed

+110
-14
lines changed

8 files changed

+110
-14
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecDecoder.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class FrameCodecDecoder
1515
public static final int TEMPLATE_ID = 1;
1616
public static final int SCHEMA_ID = 1;
1717
public static final int SCHEMA_VERSION = 0;
18+
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
1819

1920
private final FrameCodecDecoder parentMessage = this;
2021
private DirectBuffer buffer;
@@ -316,6 +317,12 @@ public String packageName()
316317
final int limit = parentMessage.limit();
317318
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
318319
parentMessage.limit(limit + headerLength + dataLength);
320+
321+
if (0 == dataLength)
322+
{
323+
return "";
324+
}
325+
319326
final byte[] tmp = new byte[dataLength];
320327
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
321328

@@ -401,6 +408,12 @@ public String namespaceName()
401408
final int limit = parentMessage.limit();
402409
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
403410
parentMessage.limit(limit + headerLength + dataLength);
411+
412+
if (0 == dataLength)
413+
{
414+
return "";
415+
}
416+
404417
final byte[] tmp = new byte[dataLength];
405418
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
406419

@@ -486,6 +499,12 @@ public String semanticVersion()
486499
final int limit = parentMessage.limit();
487500
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
488501
parentMessage.limit(limit + headerLength + dataLength);
502+
503+
if (0 == dataLength)
504+
{
505+
return "";
506+
}
507+
489508
final byte[] tmp = new byte[dataLength];
490509
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
491510

sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/FrameCodecEncoder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class FrameCodecEncoder
1515
public static final int TEMPLATE_ID = 1;
1616
public static final int SCHEMA_ID = 1;
1717
public static final int SCHEMA_VERSION = 0;
18+
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
1819

1920
private final FrameCodecEncoder parentMessage = this;
2021
private MutableDirectBuffer buffer;
@@ -254,7 +255,7 @@ public FrameCodecEncoder packageName(final String value)
254255
final byte[] bytes;
255256
try
256257
{
257-
bytes = value.getBytes("UTF-8");
258+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
258259
}
259260
catch (final java.io.UnsupportedEncodingException ex)
260261
{
@@ -341,7 +342,7 @@ public FrameCodecEncoder namespaceName(final String value)
341342
final byte[] bytes;
342343
try
343344
{
344-
bytes = value.getBytes("UTF-8");
345+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
345346
}
346347
catch (final java.io.UnsupportedEncodingException ex)
347348
{
@@ -428,7 +429,7 @@ public FrameCodecEncoder semanticVersion(final String value)
428429
final byte[] bytes;
429430
try
430431
{
431-
bytes = value.getBytes("UTF-8");
432+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
432433
}
433434
catch (final java.io.UnsupportedEncodingException ex)
434435
{

sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/MessageHeaderDecoder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
public class MessageHeaderDecoder
1212
{
1313
public static final int ENCODED_LENGTH = 8;
14+
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
15+
1416
private int offset;
1517
private DirectBuffer buffer;
1618

sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/MessageHeaderEncoder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
public class MessageHeaderEncoder
1212
{
1313
public static final int ENCODED_LENGTH = 8;
14+
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
15+
1416
private int offset;
1517
private MutableDirectBuffer buffer;
1618

sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecDecoder.java

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class TokenCodecDecoder
1515
public static final int TEMPLATE_ID = 2;
1616
public static final int SCHEMA_ID = 1;
1717
public static final int SCHEMA_VERSION = 0;
18+
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
1819

1920
private final TokenCodecDecoder parentMessage = this;
2021
private DirectBuffer buffer;
@@ -634,6 +635,12 @@ public String name()
634635
final int limit = parentMessage.limit();
635636
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
636637
parentMessage.limit(limit + headerLength + dataLength);
638+
639+
if (0 == dataLength)
640+
{
641+
return "";
642+
}
643+
637644
final byte[] tmp = new byte[dataLength];
638645
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
639646

@@ -719,6 +726,12 @@ public String constValue()
719726
final int limit = parentMessage.limit();
720727
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
721728
parentMessage.limit(limit + headerLength + dataLength);
729+
730+
if (0 == dataLength)
731+
{
732+
return "";
733+
}
734+
722735
final byte[] tmp = new byte[dataLength];
723736
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
724737

@@ -804,6 +817,12 @@ public String minValue()
804817
final int limit = parentMessage.limit();
805818
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
806819
parentMessage.limit(limit + headerLength + dataLength);
820+
821+
if (0 == dataLength)
822+
{
823+
return "";
824+
}
825+
807826
final byte[] tmp = new byte[dataLength];
808827
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
809828

@@ -889,6 +908,12 @@ public String maxValue()
889908
final int limit = parentMessage.limit();
890909
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
891910
parentMessage.limit(limit + headerLength + dataLength);
911+
912+
if (0 == dataLength)
913+
{
914+
return "";
915+
}
916+
892917
final byte[] tmp = new byte[dataLength];
893918
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
894919

@@ -974,6 +999,12 @@ public String nullValue()
974999
final int limit = parentMessage.limit();
9751000
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
9761001
parentMessage.limit(limit + headerLength + dataLength);
1002+
1003+
if (0 == dataLength)
1004+
{
1005+
return "";
1006+
}
1007+
9771008
final byte[] tmp = new byte[dataLength];
9781009
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
9791010

@@ -1059,6 +1090,12 @@ public String characterEncoding()
10591090
final int limit = parentMessage.limit();
10601091
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
10611092
parentMessage.limit(limit + headerLength + dataLength);
1093+
1094+
if (0 == dataLength)
1095+
{
1096+
return "";
1097+
}
1098+
10621099
final byte[] tmp = new byte[dataLength];
10631100
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
10641101

@@ -1144,6 +1181,12 @@ public String epoch()
11441181
final int limit = parentMessage.limit();
11451182
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
11461183
parentMessage.limit(limit + headerLength + dataLength);
1184+
1185+
if (0 == dataLength)
1186+
{
1187+
return "";
1188+
}
1189+
11471190
final byte[] tmp = new byte[dataLength];
11481191
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
11491192

@@ -1229,6 +1272,12 @@ public String timeUnit()
12291272
final int limit = parentMessage.limit();
12301273
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
12311274
parentMessage.limit(limit + headerLength + dataLength);
1275+
1276+
if (0 == dataLength)
1277+
{
1278+
return "";
1279+
}
1280+
12321281
final byte[] tmp = new byte[dataLength];
12331282
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
12341283

@@ -1314,6 +1363,12 @@ public String semanticType()
13141363
final int limit = parentMessage.limit();
13151364
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
13161365
parentMessage.limit(limit + headerLength + dataLength);
1366+
1367+
if (0 == dataLength)
1368+
{
1369+
return "";
1370+
}
1371+
13171372
final byte[] tmp = new byte[dataLength];
13181373
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
13191374

@@ -1399,6 +1454,12 @@ public String description()
13991454
final int limit = parentMessage.limit();
14001455
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
14011456
parentMessage.limit(limit + headerLength + dataLength);
1457+
1458+
if (0 == dataLength)
1459+
{
1460+
return "";
1461+
}
1462+
14021463
final byte[] tmp = new byte[dataLength];
14031464
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
14041465

@@ -1484,6 +1545,12 @@ public String referencedName()
14841545
final int limit = parentMessage.limit();
14851546
final int dataLength = (int)(buffer.getShort(limit, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF);
14861547
parentMessage.limit(limit + headerLength + dataLength);
1548+
1549+
if (0 == dataLength)
1550+
{
1551+
return "";
1552+
}
1553+
14871554
final byte[] tmp = new byte[dataLength];
14881555
buffer.getBytes(limit + headerLength, tmp, 0, dataLength);
14891556

sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/TokenCodecEncoder.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class TokenCodecEncoder
1515
public static final int TEMPLATE_ID = 2;
1616
public static final int SCHEMA_ID = 1;
1717
public static final int SCHEMA_VERSION = 0;
18+
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
1819

1920
private final TokenCodecEncoder parentMessage = this;
2021
private MutableDirectBuffer buffer;
@@ -414,7 +415,7 @@ public TokenCodecEncoder name(final String value)
414415
final byte[] bytes;
415416
try
416417
{
417-
bytes = value.getBytes("UTF-8");
418+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
418419
}
419420
catch (final java.io.UnsupportedEncodingException ex)
420421
{
@@ -501,7 +502,7 @@ public TokenCodecEncoder constValue(final String value)
501502
final byte[] bytes;
502503
try
503504
{
504-
bytes = value.getBytes("UTF-8");
505+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
505506
}
506507
catch (final java.io.UnsupportedEncodingException ex)
507508
{
@@ -588,7 +589,7 @@ public TokenCodecEncoder minValue(final String value)
588589
final byte[] bytes;
589590
try
590591
{
591-
bytes = value.getBytes("UTF-8");
592+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
592593
}
593594
catch (final java.io.UnsupportedEncodingException ex)
594595
{
@@ -675,7 +676,7 @@ public TokenCodecEncoder maxValue(final String value)
675676
final byte[] bytes;
676677
try
677678
{
678-
bytes = value.getBytes("UTF-8");
679+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
679680
}
680681
catch (final java.io.UnsupportedEncodingException ex)
681682
{
@@ -762,7 +763,7 @@ public TokenCodecEncoder nullValue(final String value)
762763
final byte[] bytes;
763764
try
764765
{
765-
bytes = value.getBytes("UTF-8");
766+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
766767
}
767768
catch (final java.io.UnsupportedEncodingException ex)
768769
{
@@ -849,7 +850,7 @@ public TokenCodecEncoder characterEncoding(final String value)
849850
final byte[] bytes;
850851
try
851852
{
852-
bytes = value.getBytes("UTF-8");
853+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
853854
}
854855
catch (final java.io.UnsupportedEncodingException ex)
855856
{
@@ -936,7 +937,7 @@ public TokenCodecEncoder epoch(final String value)
936937
final byte[] bytes;
937938
try
938939
{
939-
bytes = value.getBytes("UTF-8");
940+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
940941
}
941942
catch (final java.io.UnsupportedEncodingException ex)
942943
{
@@ -1023,7 +1024,7 @@ public TokenCodecEncoder timeUnit(final String value)
10231024
final byte[] bytes;
10241025
try
10251026
{
1026-
bytes = value.getBytes("UTF-8");
1027+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
10271028
}
10281029
catch (final java.io.UnsupportedEncodingException ex)
10291030
{
@@ -1110,7 +1111,7 @@ public TokenCodecEncoder semanticType(final String value)
11101111
final byte[] bytes;
11111112
try
11121113
{
1113-
bytes = value.getBytes("UTF-8");
1114+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
11141115
}
11151116
catch (final java.io.UnsupportedEncodingException ex)
11161117
{
@@ -1197,7 +1198,7 @@ public TokenCodecEncoder description(final String value)
11971198
final byte[] bytes;
11981199
try
11991200
{
1200-
bytes = value.getBytes("UTF-8");
1201+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
12011202
}
12021203
catch (final java.io.UnsupportedEncodingException ex)
12031204
{
@@ -1284,7 +1285,7 @@ public TokenCodecEncoder referencedName(final String value)
12841285
final byte[] bytes;
12851286
try
12861287
{
1287-
bytes = value.getBytes("UTF-8");
1288+
bytes = value.isEmpty() ? new byte[0] : value.getBytes("UTF-8");
12881289
}
12891290
catch (final java.io.UnsupportedEncodingException ex)
12901291
{

sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/VarDataEncodingDecoder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
public class VarDataEncodingDecoder
99
{
1010
public static final int ENCODED_LENGTH = -1;
11+
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
12+
1113
private int offset;
1214
private DirectBuffer buffer;
1315

sbe-tool/src/main/java/uk/co/real_logic/sbe/ir/generated/VarDataEncodingEncoder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
public class VarDataEncodingEncoder
99
{
1010
public static final int ENCODED_LENGTH = -1;
11+
public static final java.nio.ByteOrder BYTE_ORDER = java.nio.ByteOrder.LITTLE_ENDIAN;
12+
1113
private int offset;
1214
private MutableDirectBuffer buffer;
1315

0 commit comments

Comments
 (0)