iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

Duplicating literal " from " 3 times.

Open anukalp2804 opened this issue 6 months ago • 4 comments

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);
}

anukalp2804 avatar May 09 '26 17:05 anukalp2804

Hi @HTHou , I would like to work on this issue. Could you please assign this to me?

Thank you.

anukalp2804 avatar May 09 '26 17:05 anukalp2804

Hi @HTHou , I have raise pr regarding java:S1192, so can you please review and let me know that if there is any changes needed from my side. I really appreciate your help and guidance.

Thank you

anukalp2804 avatar May 11 '26 02:05 anukalp2804

The PR is merged.

HTHou avatar May 12 '26 01:05 HTHou

The PR is merged.

Thank you

anukalp2804 avatar May 12 '26 01:05 anukalp2804