tkalkirill commented on code in PR #3565:
URL: https://github.com/apache/ignite-3/pull/3565#discussion_r1557429262


##########
modules/core/src/main/java/org/apache/ignite/internal/wrapper/Wrappers.java:
##########
@@ -34,4 +36,19 @@ public static <T> T unwrap(Object object, Class<T> 
classToUnwrap) {
 
         return classToUnwrap.cast(object);
     }
+
+    /**
+     * Unwraps an object or returns {@code null} if it's {@code null}.
+     *
+     * @param object Object to unwrap.
+     * @param classToUnwrap Class which is to be unwrapped.
+     * @see #unwrap(Object, Class)
+     */
+    public static @Nullable <T> T unwrapNullable(@Nullable Object object, 
Class<T> classToUnwrap) {

Review Comment:
   I saw that method `java.lang.Class#cast` will return `null` if `null` is 
passed to it, I think we can change the signature of 
`org.apache.ignite.internal.wrapper.Wrappers#unwrap` or add a check to it.



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