Skip to content

[Feature] Improve AddressMatch CIDR field naming while keeping backward compatibility #16314

Description

@yin-bo-Final

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar feature requirement.

Apache Dubbo Component

Java SDK (apache/dubbo)

Descriptions

While working on PR #16309, I noticed that AddressMatch uses cird as the field and accessor method name:

private String cird;

public String getCird() {
    return cird;
}

public void setCird(String cird) {
    this.cird = cird;
}

Based on the address matching logic, this field is used for CIDR/IP expression matching. It seems that cird may be a typo of cidr, since the correct networking term is CIDR, which stands for Classless Inter-Domain Routing.
Since getCird / setCird may already be used by configuration binding, serialization, or external code, directly renaming them may introduce compatibility risks.
I would like to propose adding backward-compatible cidr accessors while keeping the existing cird accessors.

private String cidr;

public String getCidr() {
    return cidr;
}

public void setCidr(String cidr) {
    this.cidr = cidr;
}

/**
 * @deprecated use {@link #getCidr()} instead.
 */
@Deprecated
public String getCird() {
    return cidr;
}

/**
 * @deprecated use {@link #setCidr(String)} instead.
 */
@Deprecated
public void setCird(String cird) {
    this.cidr = cird;
}

This keeps backward compatibility while making the intended CIDR naming clearer for future usage.

Related issues

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementEverything related with code enhancement or performance

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions