You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/03/15 13:09:53 UTC

[GitHub] [ignite] alamar commented on a change in pull request #8868: IGNITE-8635: Add a Method to Inspect BinaryObject Size

alamar commented on a change in pull request #8868:
URL: https://github.com/apache/ignite/pull/8868#discussion_r594319612



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/binary/BinaryEnumObjectImpl.java
##########
@@ -473,4 +473,13 @@ public BinaryEnumObjectImpl(BinaryContext ctx, byte[] arr) {
 
         return reader.afterMessageRead(BinaryEnumObjectImpl.class);
     }
+
+    /** {@inheritDoc} */
+    @Override public int size() {
+        if (valBytes == null) {

Review comment:
       I don't think that returning -1 is meaningful here. We should marshal if size() requested and valBytes is null, such as in valueBytes, e.g.:
   
           if (valBytes != null)
               return valBytes;
   
           valBytes = U.marshal(ctx.marshaller(), this);
   
           return valBytes;
   
   Also, please note that if() with single-line body should not be brace-indented.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org