shishkovilja commented on code in PR #12407:
URL: https://github.com/apache/ignite/pull/12407#discussion_r2435918941


##########
modules/core/src/main/java/org/apache/ignite/internal/managers/communication/ErrorMessage.java:
##########
@@ -38,10 +38,10 @@
 public class ErrorMessage implements Message {
     /** Serialized form of throwable. */
     @Order(value = 0, method = "errorBytes")
-    private byte @Nullable [] errBytes;
+    private @Nullable byte[] errBytes;

Review Comment:
   Let's add `"NullableProblems"` to `@SuppressWarnings` for entire class:
   `@SuppressWarnings({"AssignmentOrReturnOfFieldWithMutableType", 
"NullableProblems"})`



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java:
##########
@@ -95,26 +90,54 @@ public GridDhtForceKeysResponse(int cacheId, IgniteUuid 
futId, IgniteUuid miniId
      * @param err Error.
      */
     public void error(IgniteCheckedException err) {
-        this.err = err;
+        errorMessage(new ErrorMessage(err));
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteCheckedException error() {
-        return err;
+    @Override public @Nullable Throwable error() {
+        return ErrorMessage.error(errMsg);
+    }
+
+    /**
+     * @return The error message.
+     */
+    @Nullable public ErrorMessage errorMessage() {
+        return errMsg;
+    }
+
+    /**
+     * Sets the error message.
+     *
+     * @param errMsg Error message.
+     */
+    public void errorMessage(@Nullable ErrorMessage errMsg) {
+        this.errMsg = errMsg;
     }
 
     /**
      * @return Keys.
      */
     public Collection<KeyCacheObject> missedKeys() {
-        return missedKeys == null ? Collections.<KeyCacheObject>emptyList() : 
missedKeys;
+        return missedKeys == null ? Collections.emptyList() : missedKeys;
+    }
+
+    /** @param missedKeys Missed keys. */
+    public void missedKeys(List<KeyCacheObject> missedKeys) {
+        this.missedKeys = missedKeys;
     }
 
     /**
      * @return Forced entries.
      */
     public Collection<GridCacheEntryInfo> forcedInfos() {
-        return infos == null ? Collections.<GridCacheEntryInfo>emptyList() : 
infos;
+        return infos == null ? Collections.emptyList() : infos;

Review Comment:
   ```suggestion
           return F.emptyIfNull(infos);
   ```



##########
modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtForceKeysResponse.java:
##########
@@ -95,26 +90,54 @@ public GridDhtForceKeysResponse(int cacheId, IgniteUuid 
futId, IgniteUuid miniId
      * @param err Error.
      */
     public void error(IgniteCheckedException err) {
-        this.err = err;
+        errorMessage(new ErrorMessage(err));
     }
 
     /** {@inheritDoc} */
-    @Override public IgniteCheckedException error() {
-        return err;
+    @Override public @Nullable Throwable error() {
+        return ErrorMessage.error(errMsg);
+    }
+
+    /**
+     * @return The error message.
+     */
+    @Nullable public ErrorMessage errorMessage() {
+        return errMsg;
+    }
+
+    /**
+     * Sets the error message.
+     *
+     * @param errMsg Error message.
+     */
+    public void errorMessage(@Nullable ErrorMessage errMsg) {
+        this.errMsg = errMsg;
     }
 
     /**
      * @return Keys.
      */
     public Collection<KeyCacheObject> missedKeys() {
-        return missedKeys == null ? Collections.<KeyCacheObject>emptyList() : 
missedKeys;
+        return missedKeys == null ? Collections.emptyList() : missedKeys;

Review Comment:
   ```suggestion
           return F.emptyIfNull(missedKeys);
   ```



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