rpuch commented on code in PR #1405:
URL: https://github.com/apache/ignite-3/pull/1405#discussion_r1044177958


##########
modules/page-memory/src/main/java/org/apache/ignite/internal/pagememory/io/AbstractDataPageIo.java:
##########
@@ -1438,6 +1438,22 @@ protected abstract void writeRowData(
             boolean newRow
     ) throws IgniteInternalCheckedException;
 
+
+    /**
+     * Narrows an {@code int} down to {@code short} throwing an exception if 
the value cannot be exactly represented as a {@code short}.
+     *
+     * @param intValue Value to narrow down.
+     * @return Resulting short value.
+     * @throws IllegalArgumentException If the provided value does not fit the 
{@code short} range.
+     */
+    protected static short narrowIntToShort(int intValue) {

Review Comment:
   If I'm not mistaken, the check in `AbstractDataPageIo#addRow()` is made with 
`assert` keyword, so it might absent in a production environment, hence it 
cannot be relied upon. I'd prefer to either leave the check that I added or 
change the check in `addRow()` from `assert` to throwing an exception.
   
   WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to