rootvector2 commented on code in PR #682:
URL: 
https://github.com/apache/commons-collections/pull/682#discussion_r3422679360


##########
src/main/java/org/apache/commons/collections4/collection/PredicatedCollection.java:
##########
@@ -409,6 +412,24 @@ public boolean addAll(final Collection<? extends E> coll) {
         return decorated().addAll(coll);
     }
 
+    /**
+     * Deserializes the collection in using a custom routine.
+     *
+     * @param in  the input stream
+     * @throws IOException if an error occurs while reading from the stream
+     * @throws ClassNotFoundException if an object read from the stream cannot 
be loaded
+     */
+    private void readObject(final ObjectInputStream in) throws IOException, 
ClassNotFoundException {
+        in.defaultReadObject();
+        Objects.requireNonNull(decorated(), "collection");

Review Comment:
   done. swapped the `Objects.requireNonNull` calls here and in 
`PredicatedMap.readObject` for explicit null checks that throw 
`InvalidObjectException` instead of an NPE.



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