szetszwo commented on code in PR #1596:
URL: https://github.com/apache/ratis/pull/1596#discussion_r4075558961


##########
ratis-common/src/test/java/org/apache/ratis/util/TestIOUtils.java:
##########
@@ -50,19 +68,91 @@ public void testReadObjectAllowsStackTraceElements() {
   }
 
   @Test
-  public void testReadObjectRejectsDisallowedClass() throws IOException {
+  public void testAllowedList() throws Exception {
+    // BigDecimal is in java.math which is in neither the allow-list nor the 
disallow-list
+    final BigDecimal pi = new BigDecimal("3.14");
+    assertDisallowed(pi, false);
+
+    // Hide it inside a list
+    final List<Object> list = new ArrayList<>();
+    list.add("testing");
+    list.add(pi);
+    assertDisallowed(list, false);

Review Comment:
   > rename assertDisallowed(list, false) to assertAllowed(list) and handle the 
true/false inside.
   
   assertDisallowed actually is correct:  The list has two elements, String and 
BigDecimal.  
   - assertDisallowed(list, ..): The assertion is to make sure that BigDecimal 
is disallowed, although it is inside the list.
   - assertDisallowed(.., false): the false here mean "ArrayList is NOT in the 
disallowed list"



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