Skip to content

Commit 2e13c06

Browse files
committed
[Java] Fix JsonPrinting version validation.
1 parent 8d2fede commit 2e13c06

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sbe-tool/src/main/java/uk/co/real_logic/sbe/json/JsonPrinter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public void print(final StringBuilder output, final UnsafeBuffer buffer, final i
5555
validateVersion(schemaId, actingVersion);
5656

5757
final int messageOffset = bufferOffset + headerDecoder.encodedLength();
58-
5958
final List<Token> msgTokens = ir.getMessage(templateId);
6059

6160
OtfMessageDecoder.decode(
@@ -71,8 +70,7 @@ private void validateId(final int schemaId)
7170
{
7271
if (schemaId != ir.id())
7372
{
74-
throw new IllegalArgumentException(
75-
String.format("Required schema id %d but was actually %d", ir.id(), schemaId));
73+
throw new IllegalArgumentException("Required schema id " + ir.id() + " but was " + schemaId);
7674
}
7775
}
7876

@@ -81,7 +79,7 @@ private void validateVersion(final int schemaId, final int actingVersion)
8179
if (actingVersion > ir.version())
8280
{
8381
throw new IllegalArgumentException(
84-
String.format("Required schema id %d but was actually %d", ir.id(), schemaId));
82+
"Required schema version " + actingVersion + " but was " + ir.version() + " for schema id " + schemaId);
8583
}
8684
}
8785

0 commit comments

Comments
 (0)