From 71dd0ce47553f41b89df0f4d635b6920cc8592c7 Mon Sep 17 00:00:00 2001 From: Matthew Pope Date: Thu, 9 May 2024 15:31:18 -0700 Subject: [PATCH] PR feedback changes --- .editorconfig | 2 ++ .../java/com/amazon/ion/impl/IonCursorBinary.java | 4 ++-- .../IonReaderContinuableApplicationBinaryTest.java | 1 - .../impl/IonReaderContinuableCoreBinaryTest.java | 14 +++++++++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.editorconfig b/.editorconfig index c8aca0c51..35da4aa33 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,6 +2,8 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace=true + +[{*.kt,*.kts}] ij_kotlin_imports_layout = * ij_kotlin_packages_to_use_import_on_demand=com.amazon.ion.**,java.util.* diff --git a/src/main/java/com/amazon/ion/impl/IonCursorBinary.java b/src/main/java/com/amazon/ion/impl/IonCursorBinary.java index 7f0f999d8..b831f1f86 100644 --- a/src/main/java/com/amazon/ion/impl/IonCursorBinary.java +++ b/src/main/java/com/amazon/ion/impl/IonCursorBinary.java @@ -583,7 +583,7 @@ private boolean ensureCapacity(long minimumNumberOfBytesRequired) { /** * Attempts to fill the buffer so that it contains at least `numberOfBytes` after `index`. * @param index the index after which to fill. - * @param numberOfBytes the number of bytes after `index` that need to be present. + * @param numberOfBytes the number of bytes starting at `index` that need to be present. * @return false if not enough bytes were available in the stream to satisfy the request; otherwise, true. */ private boolean fillAt(long index, long numberOfBytes) { @@ -1119,7 +1119,7 @@ private long slowReadFlexUInt_1_1() { private long slowReadLengthOfFlexUInt_1_1(long position) { int length = 1; while (true) { - if (!fillAt(position, 0)) { + if (!fillAt(position, 1)) { return -1; } int numZeros = Integer.numberOfTrailingZeros(buffer[(int) position]); diff --git a/src/test/java/com/amazon/ion/impl/IonReaderContinuableApplicationBinaryTest.java b/src/test/java/com/amazon/ion/impl/IonReaderContinuableApplicationBinaryTest.java index 11c9c613c..30cac7c32 100644 --- a/src/test/java/com/amazon/ion/impl/IonReaderContinuableApplicationBinaryTest.java +++ b/src/test/java/com/amazon/ion/impl/IonReaderContinuableApplicationBinaryTest.java @@ -19,7 +19,6 @@ import static com.amazon.ion.impl.IonCursorTestUtilities.endStream; import static com.amazon.ion.impl.IonCursorTestUtilities.fillIntValue; import static com.amazon.ion.impl.IonCursorTestUtilities.scalar; -import static com.amazon.ion.impl.IonCursorTestUtilities.scalar; import static com.amazon.ion.impl.IonCursorTestUtilities.fillSymbolValue; public class IonReaderContinuableApplicationBinaryTest { diff --git a/src/test/java/com/amazon/ion/impl/IonReaderContinuableCoreBinaryTest.java b/src/test/java/com/amazon/ion/impl/IonReaderContinuableCoreBinaryTest.java index 491aceb89..f0e1d2c1e 100644 --- a/src/test/java/com/amazon/ion/impl/IonReaderContinuableCoreBinaryTest.java +++ b/src/test/java/com/amazon/ion/impl/IonReaderContinuableCoreBinaryTest.java @@ -14,7 +14,19 @@ import java.io.ByteArrayInputStream; import static com.amazon.ion.BitUtils.bytes; -import static com.amazon.ion.impl.IonCursorTestUtilities.*; +import static com.amazon.ion.impl.IonCursorTestUtilities.STANDARD_BUFFER_CONFIGURATION; +import static com.amazon.ion.impl.IonCursorTestUtilities.Expectation; +import static com.amazon.ion.impl.IonCursorTestUtilities.ExpectationProvider; +import static com.amazon.ion.impl.IonCursorTestUtilities.assertSequence; +import static com.amazon.ion.impl.IonCursorTestUtilities.container; +import static com.amazon.ion.impl.IonCursorTestUtilities.endContainer; +import static com.amazon.ion.impl.IonCursorTestUtilities.endStream; +import static com.amazon.ion.impl.IonCursorTestUtilities.fillContainer; +import static com.amazon.ion.impl.IonCursorTestUtilities.fillIntValue; +import static com.amazon.ion.impl.IonCursorTestUtilities.fillStringValue; +import static com.amazon.ion.impl.IonCursorTestUtilities.fillSymbolValue; +import static com.amazon.ion.impl.IonCursorTestUtilities.scalar; +import static com.amazon.ion.impl.IonCursorTestUtilities.startContainer; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertThrows;