Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix comment typo on ServiceInfo #13021

Open
mawen12 opened this issue Jan 8, 2025 · 0 comments · May be fixed by #13022
Open

fix comment typo on ServiceInfo #13021

mawen12 opened this issue Jan 8, 2025 · 0 comments · May be fixed by #13022

Comments

@mawen12
Copy link

mawen12 commented Jan 8, 2025

Describe the bug
The comment about key format on ServiceInfo constrcutor and field GROUP_POSITION is error.
In the ServiceInfo#getKey(name, clusters) method, it use @@ to concat name and clusters. because the name format is groupName@@serviceName, so the complete key format should be groupName@@name@@clusters.

public class ServiceInfo {
    // the error comment
    /**
     * file name pattern: groupName@@name@clusters.
     */
    private static final int GROUP_POSITION = 0;

    //...

   // the error comment
    /**
     * There is only one form of the key:groupName@@name@clusters.
     */
    public ServiceInfo(final String key) {
        // ...
    }

    public static String getKey(String name, String clusters) {
        
        if (!isEmpty(clusters)) {
            // the name format is groupName@@serviceName
            // the complete format is groupName@@serviceName@@clusters
            return name + Constants.SERVICE_INFO_SPLITER + clusters;
        }
        
        return name;
    }

    //...
}

Expected behavior
The descriptor of the key format is correct, it should be groupName@@name@@clusters

Actually behavior
The descriptor of the key format is incorrect, it is groupName@@name@clusters

How to Reproduce

Desktop (please complete the following information):

  • Branch [develop]
  • Module [naming/api]

Additional context

@mawen12 mawen12 changed the title fix comment typo on ServiceInfo(key) constructor fix comment typo on ServiceInfo Jan 8, 2025
@KomachiSion KomachiSion linked a pull request Jan 10, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants