delei commented on issue #665:
URL: https://github.com/apache/fesod/issues/665#issuecomment-3477896301

   Based on my understanding, how about adding or utilising a utility method 
class to detect whether a collection is mutable?
   
   ```java
   public static boolean isMutableList(List<?> list) {
       if (list == null) return false;
   
       // Common mutable implementations
       if (list instanceof ArrayList ||
               list instanceof LinkedList ||
               list instanceof Vector) {
           return true;
       }
   
       // Known immutable implementations - check these first
       String className = list.getClass().getName();
       if (className.contains("Unmodifiable") ||
               className.contains("Immutable") ||
               className.equals("java.util.Arrays$ArrayList") ||
               className.contains("SingletonList") ||
               className.contains("EmptyList")) {
           return false;
       }
   
       return true;
   }
   ```
   
   
   FYI, this may not be the optimal solution, but I believe this issue should 
be handled as simply as possible. 
   
   Should this be deemed improper usage, we can enhance our documentation by 
adding guidance on such applications.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to