Skip to content

Duplicating literal " from " 3 times. #17630

@anukalp2804

Description

@anukalp2804

Description

This PR fixes a SonarCloud, reports a violation of rule java:S1192, issue related to duplicated string literals in the TElastic Framed Transport module.

The string literal " from " was used multiple times. It has been replaced with a constant to improve maintainability and readability.

Sonar Issue

https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=17612&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true

Files modified:

iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TElasticFramedTransport.java

How to fix

  • Introduced a constant FROM
  • Replaced all occurrences of " from " with the constant

Example

private static final String ACTION = "action";  

public void run() {
  prepare(ACTION);                             
  execute(ACTION);
  release(ACTION);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions