Home / Function/ checkNullElements() — netty Function Reference

checkNullElements() — netty Function Reference

Architecture documentation for the checkNullElements() function in RecyclableArrayList.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2d57f94f_580b_bff8_c67b_4d5eaf41655f["checkNullElements()"]
  eed483d0_fa64_c9fe_feea_50c5f374e56e["RecyclableArrayList"]
  2d57f94f_580b_bff8_c67b_4d5eaf41655f -->|defined in| eed483d0_fa64_c9fe_feea_50c5f374e56e
  313f3759_cb22_a87d_0558_f4b07f7568dd["addAll()"]
  313f3759_cb22_a87d_0558_f4b07f7568dd -->|calls| 2d57f94f_580b_bff8_c67b_4d5eaf41655f
  style 2d57f94f_580b_bff8_c67b_4d5eaf41655f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/internal/RecyclableArrayList.java lines 93–110

    private static void checkNullElements(Collection<?> c) {
        if (c instanceof RandomAccess && c instanceof List) {
            // produce less garbage
            List<?> list = (List<?>) c;
            int size = list.size();
            for (int i = 0; i  < size; i++) {
                if (list.get(i) == null) {
                    throw new IllegalArgumentException("c contains null values");
                }
            }
        } else {
            for (Object element: c) {
                if (element == null) {
                    throw new IllegalArgumentException("c contains null values");
                }
            }
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does checkNullElements() do?
checkNullElements() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/internal/RecyclableArrayList.java.
Where is checkNullElements() defined?
checkNullElements() is defined in common/src/main/java/io/netty/util/internal/RecyclableArrayList.java at line 93.
What calls checkNullElements()?
checkNullElements() is called by 1 function(s): addAll.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free