Skip to content

Commit bcdf133

Browse files
austnwilpopematt
andauthored
Apply suggestions from code review
Co-authored-by: Matthew Pope <81593196+popematt@users.noreply.github.com>
1 parent bdda6f3 commit bcdf133

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/com/amazon/ion/bytecode/bin11/bytearray/ShortTimestampDecoder.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import java.math.BigDecimal
1111

1212
/**
1313
* Helper class for decoding the various short timestamp encoding variants from a [ByteArray].
14+
*
15+
* TODO(perf): avoid auto-boxing the `0` integer for the offset when constructing the Timestamp instance.
1416
*/
1517
internal object ShortTimestampDecoder {
1618
private const val MASK_4 = 0b1111

src/test/java/com/amazon/ion/bytecode/bin11/bytearray/PrimitiveDecoderTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ class PrimitiveDecoderTest {
166166
@CsvSource(
167167
" 9223372036854775808, 00000000 00000000 00000000 00000000 00000000 00000000 00000000 10000000 00000000",
168168
"-9223372036854775809, 11111111 11111111 11111111 11111111 11111111 11111111 11111111 01111111 11111111",
169+
" 1, 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000",
170+
" -1, 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111",
169171
)
170172
fun testReadFixedIntAsBigInteger(expectedValue: BigInteger, input: String) {
171173
val data = input.binaryStringToByteArray()

src/test/java/com/amazon/ion/bytecode/bin11/bytearray/ReferenceOpcodeHandlerTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal class ReferenceOpcodeHandlerTest {
3232
OpCode.VARIABLE_LENGTH_SYMBOL -> ReferenceOpcodeHandler(Instructions.I_SYMBOL_REF)
3333
OpCode.VARIABLE_LENGTH_BLOB -> ReferenceOpcodeHandler(Instructions.I_BLOB_REF)
3434
OpCode.VARIABLE_LENGTH_CLOB -> ReferenceOpcodeHandler(Instructions.I_CLOB_REF)
35-
else -> fail("Opcode is not a variable-length reference opcode: 0x${opcode.toSingleHexByte()}")
35+
else -> fail("Opcode is not a variable-length reference opcode: 0x${opcode.toByte().toHexString()}")
3636
}
3737
handler.shouldCompile(input, bytecode)
3838
}

0 commit comments

Comments
 (0)