Skip to content

fix comment typo on ServiceInfo #13021

@mawen12

Description

@mawen12

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions