Home / Function/ removeAttributeIfMatch() — netty Function Reference

removeAttributeIfMatch() — netty Function Reference

Architecture documentation for the removeAttributeIfMatch() function in DefaultAttributeMap.java from the netty codebase.

Function java CommonUtil Logging calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  36be273e_4a26_05a2_5f0e_7cf9398c207b["removeAttributeIfMatch()"]
  bbb6a8bc_5354_cb1a_513e_c44f549e2d8f["DefaultAttributeMap"]
  36be273e_4a26_05a2_5f0e_7cf9398c207b -->|defined in| bbb6a8bc_5354_cb1a_513e_c44f549e2d8f
  e79923e5_1383_ceb7_f108_ad03f3c2377a["T()"]
  e79923e5_1383_ceb7_f108_ad03f3c2377a -->|calls| 36be273e_4a26_05a2_5f0e_7cf9398c207b
  83eed009_0ae8_ac28_a205_e64e4eec83a1["remove()"]
  83eed009_0ae8_ac28_a205_e64e4eec83a1 -->|calls| 36be273e_4a26_05a2_5f0e_7cf9398c207b
  29dc4ae3_4501_cdff_abe5_6eb56b31bc3b["searchAttributeByKey()"]
  36be273e_4a26_05a2_5f0e_7cf9398c207b -->|calls| 29dc4ae3_4501_cdff_abe5_6eb56b31bc3b
  08b08571_4145_df8d_c6bf_147379e2e4cd["key()"]
  36be273e_4a26_05a2_5f0e_7cf9398c207b -->|calls| 08b08571_4145_df8d_c6bf_147379e2e4cd
  style 36be273e_4a26_05a2_5f0e_7cf9398c207b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

common/src/main/java/io/netty/util/DefaultAttributeMap.java lines 128–154

    private <T> void removeAttributeIfMatch(AttributeKey<T> key, DefaultAttribute<T> value) {
        for (;;) {
            final DefaultAttribute[] attributes = this.attributes;
            final int index = searchAttributeByKey(attributes, key);
            if (index < 0) {
                return;
            }
            final DefaultAttribute attribute = attributes[index];
            assert attribute.key() == key;
            if (attribute != value) {
                return;
            }
            final int count = attributes.length;
            final int newCount = count - 1;
            final DefaultAttribute[] newAttributes =
                    newCount == 0? EMPTY_ATTRIBUTES : new DefaultAttribute[newCount];
            // perform 2 bulk copies
            System.arraycopy(attributes, 0, newAttributes, 0, index);
            final int remaining = count - index - 1;
            if (remaining > 0) {
                System.arraycopy(attributes, index + 1, newAttributes, index, remaining);
            }
            if (ATTRIBUTES_UPDATER.compareAndSet(this, attributes, newAttributes)) {
                return;
            }
        }
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does removeAttributeIfMatch() do?
removeAttributeIfMatch() is a function in the netty codebase, defined in common/src/main/java/io/netty/util/DefaultAttributeMap.java.
Where is removeAttributeIfMatch() defined?
removeAttributeIfMatch() is defined in common/src/main/java/io/netty/util/DefaultAttributeMap.java at line 128.
What does removeAttributeIfMatch() call?
removeAttributeIfMatch() calls 2 function(s): key, searchAttributeByKey.
What calls removeAttributeIfMatch()?
removeAttributeIfMatch() is called by 2 function(s): T, remove.

Analyze Your Own Codebase

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

Try Supermodel Free